DBA Corner

Data is stored somewhere

Oracle DBNEWID (NID): Change a DBID or Database Name

Oracle’s DBNEWID utility, invoked as nid, can change a database identifier (DBID), a database name (DBNAME), or both. This is useful after cloning a database that must be distinguished from its source in an RMAN repository.

Understand the consequences

  • Changing the DBID makes backups and archived logs created under the old DBID unusable for the renamed incarnation.
  • A DBID change requires opening the database with RESETLOGS.
  • A DBNAME change also requires parameter-file, password-file, service, and monitoring updates.
  • DBNEWID is not used directly on a physical standby; review the Data Guard procedure for the topology.

Change the DBID only

SQL> SHUTDOWN IMMEDIATE;
SQL> STARTUP MOUNT;

$ nid TARGET=/

Change the DBID and DBNAME

SQL> SHUTDOWN IMMEDIATE;
SQL> STARTUP MOUNT;

$ nid TARGET=/ DBNAME=TESTDB

To change only the name while preserving the DBID, add SETNAME=YES. Use a recoverable whole-database backup before starting, and read the full utility output before confirming.

After NID completes

  1. Update DB_NAME and related parameter, password, network, and service files when the name changed.
  2. Start the database in mount mode and open it with RESETLOGS when the DBID changed.
  3. Verify DBID and NAME in V$DATABASE.
  4. Update or re-register the database in the recovery catalog as appropriate.
  5. Take a new full backup immediately.

Multitenant note

On supported multitenant releases, review the PDB parameter. Oracle recommends PDB=ALL when the cloned CDB’s pluggable databases also need new identifiers.

Reference

Follow the release-specific Oracle DBNEWID documentation for restrictions and recovery steps.


Comments

Leave a Reply

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