Modify 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 user's ORACLE_SID environment variables, such as modified by ORCL to LINUXIDC
$ vi/home/oracle/.bash_profile
Export ORACLE_SID=LINUXIDC
$ source/home/oracle/.bash_profile
4. Modify the/etc/oratab file to change the SID name from ORCL to LINUXIDC
$ vi/etc/oratab
Linuxidc:/u01/app/oracle/11.2/db_1:y
5, into the $oracle_home/dbs directory
The modification of all file names containing the original SID to the corresponding new SID.
$ cd $ORACLE _home/dbs
$ mv Hc_zf.dat Hc_linuxidc.dat
$ mv Lkzf LKLINUXIDC
$ mv Orapwzf ORAPWLINUXIDC
$ mv Spfilezf.ora Spfilelinuxidc.ora
6. Rebuild Password file
Because the password file cannot be used in a new instance after renaming it, the 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 database instance name with the following statement, discovering that the instance name has been changed from ORCL to LINUXIDC
> select instance from V$thread;
INSTANCE
--------------------------------------------------------------------------------
Linuxidc
This time, although the instance name has been changed to LINUXIDC, but the database name (dbname) is still ORCL, so the client still cannot connect, if you need to connect, you need to modify dbname