Modifying the Oracle Instance name
System Environment: CentOS 6.5
Oracle Version: 10.2
1. Check the original database instance name
$ echo $ORACLE _sid
ORCL
$ sqlplus/as SYSDBA
> select instance from V$thread;
INSTANCE
--------------------------------------------------------------------------------
ORCL
2. Close the database
> Shutdown Immediate;
> exit;
3. Modify the ORACLE_SID environment variables for Oracle users, as modified by ORCL to Doiido
$ vi/home/oracle/.bash_profile
Export Oracle_sid=doiido
$ source/home/oracle/.bash_profile
4. Modify the/etc/oratab file to change the SID name from ORCL to Doiido
$ vi/etc/oratab
Doiido:/u01/app/oracle/11.2/db_1:y
5. Enter the $oracle_home/dbs directory
Modify all file names that contain the original SID to the corresponding new SID.
$ cd $ORACLE _home/dbs
$ mv Hc_zf.dat Hc_doiido.dat
$ mv Lkzf Lkdoiido
$ mv Orapwzf Orapwdoiido
$ mv Spfilezf.ora Spfiledoiido.ora
6. Rebuilding the password file
Because the password file cannot be used in a new instance after it has been renamed, rebuild
$ orapwd file= $ORACLE _home/dbs/orapw$oracle_sid password=123456 entries=5 force=y
7. Start the database
$ sqlplus/as SYSDBA
> Startup
8. Check the database instance name
Check the DB instance name with the following statement and discover that the instance name has changed from ORCL to Doiido
> select instance from V$thread;
INSTANCE
--------------------------------------------------------------------------------
Doiido
This time although the instance name has been changed to Doiido, but the database name (dbname) is still ORCL, so the client is still unable to connect, if need to connect, you need to modify dbname
Oracle Modify Instance Name SID