RMAN备份异机恢复并创建新DBID(七)
base open
SQL> alter database open resetlogs;
Database altered.
SQL> select name,dbid from v$database;
NAME DBID
--------- ----------
ORCL 1340095604
已成功更改dbid。
(2)修改DBID 和DB_NAME
注意一点,修改DB_NAME 之前,要将spfile 创建成pfile,因为修改dbname之后,原来的参数文件就没用了。所以要保证最新的参数。 还有修改DB_NAME的值为最新值。 修改完之后,然后用这个新参数启动DB.
SQL> shutdown immediate
SQL> startup mount;
[oracle@rhel133 dbs]$ nid target=sys/oracle dbname=test64
DBNEWID: Release 10.2.0.4.0 - Production on Tue Apr 9 16:59:05 2013
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to database ORCL (DBID=1340095604)
Connected to server version 10.2.0
Control Files in database:
/u01/oradata/orcl/control01.ctl
/u01/oradata/orcl/control02.ctl
/u01/oradata/orcl/control03.ctl
Change database ID and database name ORCL to TEST64 (Y/[N]) => yes
Proceeding with operation
Changing database ID from 1340095604 to 380502617
Changing database name from ORCL to TEST64
Control File /u01/oradata/orcl/control01.ctl - modified
Control File /u01/oradata/orcl/control02.ctl - modified
Control File /u01/oradata/orcl/control03.ctl - modified
Datafile /u01/oradata/orcl/system01.dbf - dbid changed, wrote new name
Datafile /u01/oradata/orcl/undotbs01.dbf - dbid changed, wrote new name
Datafile /u01/oradata/orcl/sysaux01.dbf - dbid changed, wrote new name
Datafile /u01/oradata/orcl/DEALSPACE_002.dbf - dbid changed, wrote new name
Datafile /u01/oradata/orcl/DEALSPACE_001.dbf - dbid changed, wrote new name
Datafile /u01/oradata/orcl/l5mspace01.dbf - dbid changed, wrote new name
Datafile /u01/oradata/orcl/RCFSPACE_002.dbf - dbid changed, wrote new name
Datafile /u01/oradata/orcl/RCFSPACE_001.dbf - dbid changed, wrote new name
Datafile /u01/oradata/orcl/DTSPACE_001.dbf - dbid changed, wrote new name
Datafile /u01/oradata/orcl/temp01.dbf - dbid changed, wrote new name
Control File /u01/oradata/orcl/control01.ctl - dbid changed, wrote new name
Control File /u01/oradata/orcl/control02.ctl - dbid changed, wrote new name
Control File /u01/oradata/orcl/control03.ctl - dbid changed, wrote new name
Instance shut down
Database name changed to TEST64.
Modify parameter file and generate a new password file before restarting.
Database ID for database TEST64 changed to 380502617.
All previous backups and archived redo logs for this database are unusable.
Database is not aware of previous backups and archived logs in Recovery Area.
Database has been shutdown, open database with RESETLOGS option.
Succesfully changed database name and ID.
DBNEWID - Completed succesfully.
[oracle@rhel133 dbs]$ vi initorcl.ora 修改dbname为test64
[oracle@rhel133 dbs]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Tue Apr 9 17:01:06 2013
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 1325400064 bytes
Fixed Size 1267236 bytes
Variable Size 1256196572 bytes
Database Buffers 52428800 bytes
Redo Buffers 15507456 bytes
Database mounted.