Monday, December 14, 2015

Change Database name and DBID using "New Database ID (nid) "


New Database ID (nid) is an Oracle database utility to change  either any one of bother of the DBID and password since Oracle 9.2,

To change DBID database has to be opene via resetlogs options to reset the online redo logs sequence from 1 while only DB name is to be changed there is no need to reset the logs.

nid is a simple and useful utility to change dbid after database clone.

1. To change DBID, use below mentioned command as oracle user

$ nid target=sys/abc123

Login as sys user and bounce the DB and open with resetlogs option

SQL> startup mount;
SQL> alter database open resetlogs;


2. To change DB name, run the command

$ nid TARGET=SYS/abc123 DBNAME=orclsby1 SETNAME=Y

make a new pfile by copying existing one,

cd $ORACLE_HOME/dbs

cp initorcl.ora initorclsby1.ora

change db_name parameter in pfile

*.db_name='orclsby1'

startup database;


SQL> select database_name from v$database;

DATABASE_NAME
--------------------------------------------------------------------------------
ORCLSBY1

No comments:

Post a Comment