How to change the DB_UNIQUE_NAME in a RAC database

1) Remove the database, instance and service resources from CRS, this does NOT affect database itself.

$ srvctl stop database -d orcl
$ srvctl remove database -d orcl

 

2) Start the database and change the db_unique_name at database level.

SQL> Startup;
SQL> alter system set db_unique_name=orcl_test scope=spfile sid=’*’;
SQL> alter system set db_domain=test.us.oracle.com scope=spfile sid=’*’;  << only required when db_domain needs to be changed.
SQL> alter database rename global_name to orcl_test.us.oracle.com;

 

3) Now add the database resource to cluster-level.

$ srvctl add database -d orcl_test -n orcl -o <ORACLE_HOME>
$ srvctl add instance -d orcl_test -i orcl1 -n
racnode01
$ srvctl add instance -d orcl_test -i orcl2 -n racnode02

 

4) Create dependency between database and ASM instance so that database starts after ASM instance starts.

$ srvctl modify instance -d orcl_test -i orcl1 -s +ASM1
$ srvctl modify instance -d orcl_test -i orcl2 -s +ASM2

Please note that, for 11.2, it is no longer required to modify at instance level, it should be done at database level:

srvctl modify database -d <db_unique_name> -a “<diskgroup_list>

 

5) Create database service, the following example add sevice  with both instances as preferred

$ srvctl add service -d orcl_test -s orclsrv -r “orcl1,orcl2”
Doc ID 1604421.1

Hits: 2

Leave a Reply

Your email address will not be published. Required fields are marked *