RENAMING INSTANCE
In this article we will learn how to rename a oracle instance.
Step 1 :
Check instance information
1 2 3 4 |
SYS>>select instance_name from v$instance; Inst-Name ---------- primary |
My instance name is primary.
No i want to convert Primary to PROD.
Step 2 :
Shutdown the database
1 2 3 4 5 6 7 |
SYS>>shut immediate; Database closed. Database dismounted. ORACLE instance shut down. SYS>>exit Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options |
Step 3 :
Change Instance Name in bash_profile :
1 2 3 4 5 6 7 8 9 10 11 12 |
[oracle@dba12 ~]$ vi .bash_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin export ORACLE_SID=prod export ORACLE_HOME=/oraeng/app/oracle/product/12.1.0 export PATH=$ORACLE_HOME/bin:$PATH:. export TNS_ADMIN=$HOME |
Step 4 :
Run the bash_profile
1 |
[oracle@dba12 ~]$ . .bash_profile |
Step 5 :
Go to dbs location and rename the pfile from initprimary.ora to initprod.ora
1 2 3 4 5 6 |
[oracle@dba12 ~]$ cd $ORACLE_HOME/dbs [oracle@dba12 dbs]$ ls -lrt initprimary.ora -rwxr--r-- 1 oracle dba 3152 Jan 3 07:16 initprimary.ora [oracle@dba12 dbs]$ mv initprimary.ora init$ORACLE_SID.ora [oracle@dba12 dbs]$ ls -lrt init$ORACLE_SID.ora -rwxr--r-- 1 oracle dba 3152 Jan 3 07:16 initprod.ora |
Step 6 :
Connect to sqlplus and startup the database .
1 2 3 4 5 6 7 8 9 10 11 12 13 |
[oracle@dba12 ~]$ sqlplus / as sysdba SQL*Plus: Release 12.1.0.2.0 Production on Wed Jan 3 08:26:53 2001 Copyright (c) 1982, 2014, Oracle. All rights reserved. Connected to an idle instance. SYS>>startup ORACLE instance started. Total System Global Area 260046848 bytes Fixed Size 2923192 bytes Variable Size 167773512 bytes Database Buffers 83886080 bytes Redo Buffers 5464064 bytes Database mounted. Database opened. |
Step 7:
Check the instance name
1 2 3 4 |
SYS>>select instance_name from v$instance; Inst-Name --------- prod |
I hope above steps will be useful for renaming the Oracle Instance .
Thank you ……….
sampriti
Thanks for the useful information!! In case of RAC setup what more modifications need to be done?? Please help!!