=======================================================================
What is the DBNEWID utility ?
DBNEWID is a database utility that can change the internal database identifier (DBID) or the database name (DBNAME) or both for a database.
=======================================================================
Example:
After restore ATESTD2 database, Rename the database into ATESTS1:
SHUTDOWN IMMEDIATE
echo $ORACLE_SID
STARTUP MOUNTORACLE instance started.
Total System Global Area 1.8858E+10 bytes
Fixed Size 2221336 bytes
Variable Size 1694505704 bytes
Database Buffers 1.7096E+10 bytes
Redo Buffers 64880640 bytes
Database mounted.
SQL> exit
nid TARGET=sys/pass DBNAME=ATESTS1
DBNEWID: Release 10.2.0.4.0 - Production on Wed Oct 21 12:25:29 2011
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to database ATESTD2 (DBID=1422735007)
Connected to server version 10.2.0
Control Files in database:
/ora02/oradata/ATESTS1/control01.ctl
/ora03/oradata/ATESTS1/control02.ctl
/ora04/oradata/ATESTS1/control03.ctl
Change database ID and database name ATESTD2 to ATESTS1? (Y/[N]) =>
Control File /ora02/oradata/ATESTS1/control01.ctl - dbid changed, wrote new name
Control File /ora03/oradata/ATESTS1/control02.ctl - dbid changed, wrote new name
Control File /ora04/oradata/ATESTS1/control03.ctl - dbid changed, wrote new name
Instance shut down
Database name changed to ATESTS1.
Modify parameter file and generate a new password file before restarting.
Database ID for database ATESTS1 changed to 404185722.
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 succesfully.
=======================================================================
After DBNEWID change:
=======================================================================
SHUTDOWN IMMEDIATE
1)create a new password file orapw
2)modify init.ora with new db name(*.DB_NAME=ATESTS1)
3)set new ORACLE HOME and SID
4)Modify Listernaer.ora
5)create new spfile
6)Startup of the database with open resetlogs
STARTUP MOUNT
ALTER DATABASE OPEN RESETLOGS;
========================================================================
What is the DBNEWID utility ?
DBNEWID is a database utility that can change the internal database identifier (DBID) or the database name (DBNAME) or both for a database.
=======================================================================
Example:
After restore ATESTD2 database, Rename the database into ATESTS1:
SHUTDOWN IMMEDIATE
echo $ORACLE_SID
STARTUP MOUNTORACLE instance started.
Total System Global Area 1.8858E+10 bytes
Fixed Size 2221336 bytes
Variable Size 1694505704 bytes
Database Buffers 1.7096E+10 bytes
Redo Buffers 64880640 bytes
Database mounted.
SQL> exit
nid TARGET=sys/pass DBNAME=ATESTS1
DBNEWID: Release 10.2.0.4.0 - Production on Wed Oct 21 12:25:29 2011
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to database ATESTD2 (DBID=1422735007)
Connected to server version 10.2.0
Control Files in database:
/ora02/oradata/ATESTS1/control01.ctl
/ora03/oradata/ATESTS1/control02.ctl
/ora04/oradata/ATESTS1/control03.ctl
Change database ID and database name ATESTD2 to ATESTS1? (Y/[N]) =>
Control File /ora02/oradata/ATESTS1/control01.ctl - dbid changed, wrote new name
Control File /ora03/oradata/ATESTS1/control02.ctl - dbid changed, wrote new name
Control File /ora04/oradata/ATESTS1/control03.ctl - dbid changed, wrote new name
Instance shut down
Database name changed to ATESTS1.
Modify parameter file and generate a new password file before restarting.
Database ID for database ATESTS1 changed to 404185722.
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 succesfully.
=======================================================================
After DBNEWID change:
=======================================================================
SHUTDOWN IMMEDIATE
1)create a new password file orapw
2)modify init.ora with new db name(*.DB_NAME=ATESTS1)
3)set new ORACLE HOME and SID
4)Modify Listernaer.ora
5)create new spfile
6)Startup of the database with open resetlogs
STARTUP MOUNT
ALTER DATABASE OPEN RESETLOGS;
========================================================================
No comments:
Post a Comment