Steps To Change The Oracle Database Name Using Nid Utility

We will change the database name from DEV to PROD.

1. Mount the database


SQL> STARTUP MOUNT

ORACLE instance started.

Total System Global Area 8754618368 bytes
Fixed Size 4646288 bytes
Variable Size 3556776560 bytes
Database Buffers 5033164800 bytes
Redo Buffers 160030720 bytes
Database mounted.

SQL> select name,open_mode from v$database;

NAME OPEN_MODE
--------- --------------------
DEV MOUNTED

2. Run the NID utility


SYNTAX – nid sys/password@CURRENT_DBNAME DBNAME=NEW_DBNAME

 

[oracle@funoracledb]$ nid target=sys/oracle@DEV DBNAME=PROD

DBNEWID: Release 12.1.0.1.0 - Production on Tue May 17 20:38:51 2016

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

Connected to database DEV (DBID=738282423)

Connected to server version 12.1.0

Control Files in database:
/u02/oradata/PROD/control01.ctl
/u02/oradata/PROD/control02.ctl

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

Proceeding with operation
Changing database ID from 738282423 to 23523233232
Changing database name from DEV to PROD
Control File /u02/oradata/PROD/control01.ctl - modified
Control File /u02/oradata/PROD/control02.ctl - modified
Datafile /u02/oradata/PROD/system01.db - dbid changed, wrote new name
Datafile /u02/oradata/PROD/sysaux01.db - dbid changed, wrote new name
Datafile /u02/oradata/PROD/undotbs01.db - dbid changed, wrote new name
Datafile /u02/oradata/PROD/users01.db - dbid changed, wrote new name
Control File /u02/oradata/PROD/control01.ctl - dbid changed, wrote new name
Control File /u02/oradata/PROD/control02.ctl - dbid changed, wrote new name
Instance shut down

Database name changed to PROD.

Modify parameter file and generate a new password file before restarting.

Database ID for database PROD changed to 23523233232.
All previous backups and archived redo logs for this database are unusable.
Database has been shutdown, open database with RESETLOGS option.
Succesfully changed database name and ID.
DBNEWID - Completed successfully.


3. Change DB name in pfile and startup with reset logs




If you like please follow and comment