使用nid命令修改db name及dbid(二)

2014-11-24 16:14:13 · 作者: · 浏览: 5
on 10.2.0
Control Files in database:
/u02/database/SYBO/controlf/cntl1SYBO.ctl
/u02/database/SYBO/controlf/cntl2SYBO.ctl
/u02/database/SYBO/controlf/cntl3SYBO.ctl
Change database name of database CLBO to MMBO (Y/[N]) => Y
Proceeding with operation
Changing database name from CLBO to MMBO
Control File /u02/database/SYBO/controlf/cntl1SYBO.ctl - modified
Control File /u02/database/SYBO/controlf/cntl2SYBO.ctl - modified
Control File /u02/database/SYBO/controlf/cntl3SYBO.ctl - modified
.................省略.................
Database name changed to MMBO.
Modify parameter file and generate a new password file before restarting.
Succesfully changed database name.
DBNEWID - Completed succesfully.
--修改pfile文件中的db_name参数,并重新启动数据库(略)
--校验修伽后的状态,dbid未发生变化,但dbname以及被修改
$ export ORACLE_SID=MMBO
$ sqlplus / as sysdba
SQL> select dbid,name,open_mode from v$database;
DBID NAME OPEN_MODE
---------- --------- ----------
1924111546 MMBO READ WRITE
5、同时修改dbname以及dbid
[sql]
$ export ORACLE_SID=MMBO
SQL> startup mount pfile=/u02/database/SYBO/initMMBO.ora
$ nid target=/ dbname=SYBO
DBNEWID: Release 10.2.0.3.0 - Production on Wed Apr 24 19:12:57 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to database MMBO (DBID=1924111546)
Connected to server version 10.2.0
Control Files in database:
/u02/database/SYBO/controlf/cntl1SYBO.ctl
/u02/database/SYBO/controlf/cntl2SYBO.ctl
/u02/database/SYBO/controlf/cntl3SYBO.ctl
Change database ID and database name MMBO to SYBO (Y/[N]) => Y
Proceeding with operation
Changing database ID from 1924111546 to 4235963258
Changing database name from MMBO to SYBO
Control File /u02/database/SYBO/controlf/cntl1SYBO.ctl - modified
Control File /u02/database/SYBO/controlf/cntl2SYBO.ctl - modified
Control File /u02/database/SYBO/controlf/cntl3SYBO.ctl - modified
Datafile /u02/database/SYBO/oradata/sysSYBO.dbf - dbid changed, wrote new name
................
Datafile /u02/database/SYBO/temp/tmp.dbf - dbid changed, wrote new name
Control File /u02/database/SYBO/controlf/cntl1SYBO.ctl - dbid changed, wrote new name
Control File /u02/database/SYBO/controlf/cntl2SYBO.ctl - dbid changed, wrote new name
Control File /u02/database/SYBO/controlf/cntl3SYBO.ctl - dbid changed, wrote new name
Instance shut down
Database name changed to SYBO.
Modify parameter file and generate a new password file before restarting.
Database ID for database SYBO changed to 4235963258.
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.
--修改pfile文件的db_name,并重命名了pfile文件为initSYBO.ora
SQL> startup pfile=/u02/database/SYBO/initSYBO.ora
ORACLE instance started.
Database mounted.
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open