Steps to Rename RAC Database
Assumption:
- Two Node RAC; Database name orcl and Instance orcl1 and orcl2 running on HostA and HostB
- Name to be changed: Databse – Prod and instances prod1 and prod2
Steps:
a. From the instance orcl1, Backup the control file to trace. (Alter database backup controlfile to trace; )
b. Create pfile from the spfile (Create pfile=<’path/filename’> from spfile; )
c. Check the online redo-log files name, path and size on each nodes.
d. Take the complete backup of the database (To be towards safer side ).
———————————————————————————————
1. ) Shutdown the database using srvctl
$ srvctl stop database -d orcl
2. ) On one of the nodes, say on HostA,
Edit the pfile ( Created earlier), and change the following parameters.
Cluster_database=False
db_name=prod
Also, change all the occurances of orcl to prod.., Change the path of the Control_files..etc., as required.
Save the file as $ORACLE_HOME/dbs/initprod1.ora
3. ) Startup the database to nomount state by using the pfile.
4. ) Edit the Control file script , which should look as below. Make sure the script contains online redo-logs of instance orcl1 only. Run this script from SQL prompt in nomount state.
SQL> CREATE CONTROLFILE set DATABASE “PROD“ RESETLOGS NOARCHIVELOG
MAXLOGFILES 192
MAXLOGMEMBERS 3
MAXDATAFILES 1024
MAXINSTANCES 32
MAXLOGHISTORY 292
LOGFILE
GROUP 1 ‘/u03/oradata/redo01.log’ SIZE 50M,
GROUP 2 ‘/u03/oradata/redo02.log’ SIZE 50M
DATAFILE
‘/u03/oradata/system01.dbf’,
‘/u03/oradata/undotbs01.dbf’,
‘/u03/oradata/sysaux01.dbf’,
‘/u03/oradata/users01.dbf’,
‘/u03/oradata/example01.dbf’,
‘/u03/oradata/undotbs02.dbf’
CHARACTER SET WE8ISO8859P1
;
ALTER DATABASE ADD LOGFILE THREAD 2
GROUP 3 ‘/u03/oradata/redo03.log’ SIZE 50M REUSE,
GROUP 4 ‘/u03/oradata/redo04.log’ SIZE 50M REUSE;
ALTER DATABASE ENABLE PUBLIC THREAD 2;
ALTER DATABASE OPEN RESETLOGS;
5. ) Change the init.ora parameter Cluster_database=False back to Cluster_database=True.
6.) Create spfile from pfile and place it in the shared location as it was earlier.
SQL> Create spfile=’<path>/spfileprod.ora’ from pfile;
Shutdown immediate and start the instance with spfile
7. ) Start the second instance on on NodeB with the new spfile. (From sql prompt)
8. ) Remove the ORCL instance from CRS.
srvctl remove database -d orcl
9. ) Register PROD isntance with the CRS.
srvctl add database -d prod -o $ORACLE_HOME
srvctl add instance -d prod -i prod1 -n NodeA
srvctl add instance -d prod -i prod2 -n NodeB
10. ) Change the instance names in the tnsnames.ora and listener.ora files.
Steps to Rename RAC Database « Mike Desouza's Blog said,
November 17, 2009 at 10:05 am
[...] November 17, 2009 by michael dsouza Taken from http://orapark.wordpress.com/2008/04/16/steps-to-rename-rac-database/ [...]