Oracle修改实例名

只需要修改环境变量ORACLE_ID,口令文件及参数文件的名称即可

  • 关闭数据库、停止实例
SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options
  • 修改环境变量ORACLE_SID
[oracle@db-sys~]$ vim .bash_profile

export ORACLE_BASE=/usr/local/oracle

export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1

##############################################################

#####   修改环境变量ORACLE_SID的取值为book

export ORACLE_SID=book

##############################################################

export ORACLE_OWNER=oracle

export PATH=$PATH:$ORACLE_HOME/bin:$HOME/bin

alias sqlplus='rlwrap sqlplus'

alias rman='rlwrap rman'

alias lsnrctl='rlwrap lsnrctl'

[oracle@db-sys~]$ source .bash_profile
  • 修改口令文件和参数文件的名称
[oracle@dbs]$ ls

hc_DBUA0.dat  hc_orcl.dat  init.ora  lkBOOK  lkBOOKS  lkMYDB  lkORCL  orapworcl  spfileorcl.ora

[oracle@dbs]$ pwd

/usr/local/oracle/product/11.2.0/db_1/dbs

[oracle@dbs]$ mv orapworcl orapwbook

[oracle@dbs]$ mv spfileorcl.ora spfilebook.ora

[oracle@dbs]$ ls

hc_DBUA0.dat  hc_orcl.dat  init.ora  lkBOOK  lkBOOKS  lkMYDB  lkORCL  orapwbook  spfilebook.ora
  • 修改完成后启动实例,查看实例名称即可:

 

 

SQL> show parameter name;

 

posted @ 2023-01-12 15:21  LuckinAaron  阅读(213)  评论(0编辑  收藏  举报