There are two methods: one is to transfer controlfile out and modify the database name and then recreate it; the other is to use the nib tool to modify it. Here we will introduce how to modify the nib tool.
The tool nib is provided by Oracle 9i and is used to modify the database name.
Step 1: Back up the entire database.
Because this operation may fail, you must back up the data first.
Step 2: Shut down the database normally and then start it to the mount state.
Step 3: Use nib to modify the Database Name
Modify the command to nid target = sys/welcome1 dbname = webdb
After the modification is complete, the system prompts that the database has been closed and must be opened using open resetlogs.
Step 4: Open the database.
Before opening the file, you need to generate the initialization parameter file and password file that match the new database name. The listener file also needs to be modified accordingly.
/U04/webdb_rman @ db3 => webreader $ nid target = sys/welcome1 dbname = webdb
DBNEWID: Release 10.2.0.4.0-Production on Tue May 15 11:43:33 2012
Copyright (c) 1982,200 7, Oracle. All rights reserved.
Connected to database WEBREADER (DBID = 4271057885)
Connected to server version 10.2.0
Control Files in database:
+ VG1/webdb/control01.ctl
+ VG1/webdb/control02.ctl
+ VG1/webdb/control03.ctl
Change database ID and database name WEBREADER to WEBDB? (Y/[N]) => Y
Proceeding with operation
Changing database ID from 4271057885 to 2506031974
Changing database name from WEBREADER to WEBDB
Control File + VG1/webdb/control01.ctl-modified
Control File + VG1/webdb/control02.ctl-modified
Control File + VG1/webdb/control03.ctl-modified
Datafile + VG1/webdb/system01.dbf-dbid changed, wrote new name
Datafile + VG2/webdb/data_salebill05.dbf-dbid changed, wrote new name
Datafile + VG1/webdb/sysaux01.dbf-dbid changed, wrote new name
Datafile + VG1/webdb/users01.dbf-dbid changed, wrote new name
Datafile + VG1/webdb/undotbs02.dbf-dbid changed, wrote new name
...........................
Instance shut down
Database name changed to WEBDB.
Modify parameter file and generate a new password file before restarting.
Database ID for database WEBDB changed to 2506031974.
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./u04/webdb_rman @ db3 => webreader $ sqlplus/as sysdba
SQL * Plus: Release 10.2.0.4.0-Production on Tue May 15 11:42:04 2012
Copyright (c) 1982,200 7, Oracle. All Rights Reserved.
Connected:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0-64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 5.1540E + 10 bytes
Fixed Size 2179936 bytes
Variable Size 6425676960 bytes
Database Buffers 4.5097E + 10 bytes
Redo Buffers 14594048 bytes
Database mounted.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0-64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
/U04/webdb_rman @ db3 => webreader $ export ORACLE_SID = webdb
/U04/webdb_rman @ db3 => webdb $ sqlplus/as sysdba
SQL * Plus: Release 10.2.0.4.0-Production on Tue May 15 11:44:47 2012
Copyright (c) 1982,200 7, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> startup mount
ORACLE instance started.
Total System Global Area 5.1540E + 10 bytes
Fixed Size 2179936 bytes
Variable Size 6425676960 bytes
Database Buffers 4.5097E + 10 bytes
Redo Buffers 14594048 bytes
Database mounted.
SQL> show parameter db_name
NAME TYPE VALUE
-----------------------------------------------------------------------------
Db_name string webdb
SQL> alter database open resetlogs;
Database altered.
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination + VG2
Oldest online log sequence 1
Next log sequence to archive 1
Current log sequence 1
SQL>
For more information about Oracle, see Oracle topics page http://www.bkjia.com/topicnews.aspx? Tid = 12