This article explains the steps which DBA must use to Change RAC Database Name.

Before we must start the steps to change database name. Every DBA must know the condition in which have to change the name of a database.

  1.  When cloning the database on the same server.
  2. When we need to refresh the data. 
DATABASE NAME =RACDB
instance_name=RACDB1( on node 1 ) and RACDB2 ( node 2 )
echo $ORACLE_SID
RACDB1
  1. Create pfile from spfile in non-default location.
SQL> create pfile=’/u02/oraclenetwork/RACDB/initRACDB.ora’ from spfile;
File created.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 – 64bit Production
[localhost:RACDB1]$ pwd
/u01/app/oracle/product/11.2.0.3/db_1/dbs
[localhost:RACDB1]$ cd
[localhost:RACDB1]$ cd /u02/oraclenetwork/RACDB/
[localhost:RACDB1]$ cp initRACDB.ora initRACDB.ora_bkp
[localhost:RACDB1]$ vi initRACDB.ora ---comment all the RAC specific parameters as shown below
[localhost:RACDB1]$ s
SQL> shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

2. Mount The Database using new pfile as shown below

Note: SID is same as earlier

[localhost:RACDB1]$ pwd
/u02/oraclenetwork/RACDB
SQL> startup mount pfile=’/u02/oraclenetwork/RACDB/initRACDB.ora’;
ORACLE instance started.

Total System Global Area 3106619392 bytes
Fixed Size 2232392 bytes
Variable Size 1862275000 bytes
Database Buffers 1224736768 bytes
Redo Buffers 17375232 bytes
Database mounted.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 – 64bit Production

Note: Below is sample pfile

comment the RACDB2 parameters–

#RACDB2.instance_number=2
#RACDB2.local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.1)(PORT=1525))))’
[localhost:RACDB1]$ cat /u02/oraclenetwork/RACDB/initRACDB.ora
#*.cluster_database=true
*.compatible=’11.2.0.0.0′
*.control_files=’+DATA_GRP_1/RACDB/controlfile/current.272.872156757′,’+ARCH_GRP_1/RACDB/controlfile/current.1623.871600291′
*.db_block_size=8192
*.db_create_file_dest=’+DATA_GRP_1′
*.db_domain=”
*.db_name=’RACDB’
*.db_recovery_file_dest=’+ARCH_GRP_1′
*.db_recovery_file_dest_size=6005194752
*.diagnostic_dest=’/u01/app/oracle’
RACDB1.instance_number=1
#RACDB2.instance_number=2
#RACDB2.local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.1)(PORT=1525))))’
*.log_archive_format=’%t_%s_%r.dbf’
*.memory_target=3111124992
*.open_cursors=300
*.processes=150
*.remote_listener=’racdev-scan.corp.otn.com:1521′
*.remote_login_passwordfile=’exclusive’
RACDB1.thread=1
#RACDB2.thread=2
#RACDB2.undo_tablespace=’UNDOTBS1′
RACDB1.undo_tablespace=’UNDOTBS2′

Now use the nid utility :

[localhost:RACDB1]$ nid TARGET=sys/oracle dbname=RACDBnew

DBNEWID: Release 11.2.0.3.0 – Production on Wed Feb 25 08:40:51 2015

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

Connected to database RACDB (DBID=3599526942)

Connected to server version 11.2.0

Control Files in database:
+DATA_GRP_1/RACDB/controlfile/current.272.872156757
+ARCH_GRP_1/RACDB/controlfile/current.1623.871600291

Change database ID and database name RACDB to RACDBNEW? (Y/[N]) => Y

Proceeding with operation
Changing database ID from 3599526942 to 3696324691
Changing database name from RACDB to RACDBNEW
Control File +DATA_GRP_1/RACDB/controlfile/current.272.872156757 – modified
Control File +ARCH_GRP_1/RACDB/controlfile/current.1623.871600291 – modified
Datafile +DATA_GRP_1/RACDB/datafile/system.304.87215712 – dbid changed, wrote new name
Datafile +DATA_GRP_1/RACDB/datafile/sysaux.299.87215712 – dbid changed, wrote new name
Datafile +DATA_GRP_1/RACDB/datafile/undotbs1.298.87215712 – dbid changed, wrote new name
Datafile +DATA_GRP_1/RACDB/datafile/undotbs2.297.87215712 – dbid changed, wrote new name
Datafile +DATA_GRP_1/RACDB/datafile/users.296.87215712 – dbid changed, wrote new name
Datafile +DATA_GRP_1/RACDB/tempfile/temp.300.87160030 – dbid changed, wrote new name
Control File +DATA_GRP_1/RACDB/controlfile/current.272.872156757 – dbid changed, wrote new name
Control File +ARCH_GRP_1/RACDB/controlfile/current.1623.871600291 – dbid changed, wrote new name
Instance shut down

Database name changed to RACDBNEW.
Modify parameter file and generate a new password file before restarting.
The database ID for database RACDBNEW changed to 3696324691.
All previous backups and archived redo logs for this database are unusable.
The database is not aware of previous backups and archived logs in Recovery Area.
A database has been shutdown, open database with RESETLOGS option.
Successfully changed database name and ID.
DBNEWID – Completed successfully.

Mount Database with new pfile.

[localhost:RAC11]$ export ORACLE_SID=RACDBNEW
[localhost:RACDBNEW]$ s

SQL*Plus: Release 11.2.0.3.0 Production on Wed Feb 25 08:59:19 2015
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup mount pfile=’/u02/oraclenetwork/RACDB/initRACDBNEW.ora’;
ORACLE instance started.

Total System Global Area 3106619392 bytes
Fixed Size 2232392 bytes
Variable Size 1711280056 bytes
Database Buffers 1375731712 bytes
Redo Buffers 17375232 bytes
Database mounted.

SQL> select status from v$instance;
STATUS
————
MOUNTED

SQL> select name from v$database;
NAME
———
RACDBNEW

SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

SQL> alter database open RESETLOGS;
Database altered.
SQL> select open_mode from v$database;
OPEN_MODE
——————–
READ WRITE
SQL> create spfile=’+DATA_GRP_1/RACDB/spfileRACDBNEW.ora’ from pfile=’/u02/oraclenetwork/RACDB/RACDBNEW.ora’;
File created.

SQL> !echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0.3/db_1

SQL> select name from v$database;

NAME
———
RACDBNEW

Register Database with the Cluster.

[localhost:RACDBNEW]$ srvctl add database -d RACDBNEW -o /u01/app/oracle/product/11.2.0.3/db_1 -r primary -s OPEN -p +DATA_GRP_1/RACDB/spfileRACDBNEW.ora
[localhost:RACDBNEW]$ srvctl add instance -d RACDBNEW -i RACDBNEW1 -n localhost
[localhost:RACDBNEW]$ srvctl config database -d RACDBNEW -a
Database unique name: RACDBNEW
Database name:
Oracle home: /u01/app/oracle/product/11.2.0.3/db_1
Oracle user: oracle
Spfile: +DATA_GRP_1/RACDB/spfileRACDBNEW.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: RACDBNEW
Database instances: RACDBNEW1,RACDBNEW2
Disk Groups:
Mount point paths:
Services:
Type: RAC
Database is enabled
Database is administrator managed

Thank you for reading. I hope this post add meaningful information in your Oracle’s Knowledge.

Thank you for giving your valuable time to read the above information.

If you want to be updated with all our articles send us the Invitation or Follow us:

Skant Gupta’s LinkedIn: www.linkedin.com/in/skantali/

Joel Perez’s LinkedIn: www.linkedin.com/in/SirDBaaSJoelPerez

Anuradha’s LinkedIn: https://www.linkedin.com/in/dbaanuradhamudgal/

LinkedIn Group: Oracle Cloud DBAAS

Facebook Page: OracleHelp

About The Author

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.