美文网首页
改Oracle实例名

改Oracle实例名

作者: 传棋Jaking | 来源:发表于2018-06-06 15:46 被阅读0次

    详细步骤:

    SQL> shutdown immediate;
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    SQL> quit
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    [oracle@localhost Desktop]$ cd 
    [oracle@localhost ~]$ vim .bashrc
    [oracle@localhost ~]$ cat .bashrc 
    # .bashrc
    
    # Source global definitions
    if [ -f /etc/bashrc ]; then
        . /etc/bashrc
    fi
    
    # User specific aliases and functions
    export ORACLE_SID=orcl_new #将实例名改为orcl_new
    export ORACLE_BASE=/oracle/app/oracle
    export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
    export LIBPATH=$ORACLE_HOME/lib
    export
    PATH=$ORACLE_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin
    umask 022
    [oracle@localhost ~]$ source .bashrc 
    [oracle@localhost ~]$ cd $ORACLE_HOME/dbs
    [oracle@localhost dbs]$ ls -lrt
    total 20
    -rw-r--r--. 1 oracle oinstall 2851 May 15  2009 init.ora
    -rw-r-----. 1 oracle oinstall   24 May 31 16:51 lkORCL
    -rw-r-----. 1 oracle oinstall 1536 May 31 16:52 orapworcl
    -rw-r-----. 1 oracle oinstall 2560 Jun  5 23:48 spfileorcl.ora
    -rw-rw----. 1 oracle oinstall 1544 Jun  6 03:28 hc_orcl.dat
    [oracle@localhost dbs]$ cp spfileorcl.ora spfileorcl_new.ora
    [oracle@localhost dbs]$ sqlplus / as sysdba
    
    SQL*Plus: Release 11.2.0.3.0 Production on Wed Jun 6 03:37:10 2018
    
    Copyright (c) 1982, 2011, Oracle.  All rights reserved.
    
    Connected to an idle instance.
    
    SQL> startup nomount;
    ORACLE instance started.
    
    Total System Global Area 1603411968 bytes
    Fixed Size          2228784 bytes
    Variable Size         939527632 bytes
    Database Buffers      654311424 bytes
    Redo Buffers            7344128 bytes
    SQL> alter database mount;
    
    Database altered.
    
    SQL> select status from v$instance;
    
    STATUS
    ------------
    MOUNTED
    
    SQL> alter database open;
    
    Database altered.
    
    SQL> select status from v$instance;
    
    STATUS
    ------------
    OPEN
    
    SQL> show parameter name;
    
    NAME                     TYPE    VALUE
    ------------------------------------ ----------- ------------------------------
    db_file_name_convert             string
    db_name                  string  orcl
    db_unique_name               string  orcl
    global_names                 boolean     FALSE
    instance_name                string  orcl_new #实例名已改为orcl_new
    lock_name_space              string
    log_file_name_convert            string
    processor_group_name             string
    service_names                string  orcl
    SQL> Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    [oracle@localhost dbs]$ echo $ORACLE_SID
    #实例名已改为orcl_new
    orcl_new
    
    

    相关文章

      网友评论

          本文标题:改Oracle实例名

          本文链接:https://www.haomeiwen.com/subject/kwwbsftx.html