How to change the db name using nid utility

Introduction to Nid Utility:

NID is an utility which is used to change the database internal name and dbname of a database. The utility is placed in the $ORACLE_HOME/bin directory. Prior to the nid utility we need to manually create a database and give it a new database name by recreating a control file.

Here I am going to change the db name from standby to Canada.

Overview steps:

Step:1 Mount the database with old db name(standby)

Step:2 Run the nid utility (syntax: nid sys/password@CURRENT_DBNAME DBNAME=NEW_DBNAME)

Step:3 Once you run the nid utility the name will be changed to new db name.(standby to Canada)

Step:4 Then you have to change the db_name in the parameter file.

Step:5 change the spfile to a new db name.

Step:6 Now open the database with reset logs option.

Step:1 mount the database with old db name.

Step:2 Run the nid utility

Syntax: nid sys/password@CURRENT_DBNAME DBNAME=NEW_DBNAME

Step:3 change the db_name in the parameter file.

Step:4 Rename the spfile to a new db name.

cp spfileSTANDBY.ora spfileCANADA.ora

Step:5 Open the database with resetlogs option.

Step:6 Register the database information to the listener using the command  “alter system register;”

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:
Ramkumar’s LinkedIn: https://www.linkedin.com/in/ramkumardba/
LinkedIn Group: https://www.linkedin.com/in/ramkumar-m-0061a0204/
Facebook Page: https://www.facebook.com/Oracleagent-344577549964301
Ramkumar’s Twitter : https://twitter.com/ramkuma02877110
Ramkumar’s Telegram: https://t.me/oracleageant
Ramkumar’s Facebook: https://www.facebook.com/ramkumarram8

 

Change PDB name with DBNEWID Utility in 19c


DBNEWID Utility:

NID utility has been introduced with Oracle 10g to change the database name and id. Without NID changing the DBNAME is only possible by recreating the control files. Changing the DBID was not possible before, as this is the database unique identifier. Giving a database a new DBNAME is common after migration of a database instance using Data Guard or duplicate where DBNAME and DB_UNIQUE_NAME differs and shall be synchronized afterwards. In some situation an ORA-01103 error occurs and changing the DBNAME to a new value may be needed.

OVERVIEW:

  1. Verifying the pluggable database
  2. For rename the pluggable database, We need to open the database in Restricted Mode
  3. Set the container database name
  4. Renaming the pluggable database
  5. Open the pluggable database

Note : For an example , I am taking Source PDB “Mumbai” and renaming as “Noida”,  

Step 1:

Verifying the available pluggable database in our local CDB

SQL> select con_id,name,open_mode from v$Pdbs;

Step 2:

Before we need to rename the pluggable database ,We should bring the PDB close and open it in “RESTRICTED MODE”

alter pluggable database mumbai close;

Step 3:

Opening the PDB in restricted mode,

alter pluggable database mumbai open restricted;

Step 4:

Set the PDB “MUMBAI”

alter session set container=mumbai;

Step 5:

Here we are renaming the pluggable database name “mumbai” as “noida”

alter pluggable database rename global_name to noida;

Step 6:

Here we can check the renamed pdb by issuing the below command

select con_id,name,open_mode from v$Pdbs;

But , the database is in restricted mode so we need to open the database,

Now the database name has been changed .