5、同时修改dbname以及dbid
$ 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
SQL> alter database open resetlogs;
Database altered.
SQL> select dbid,name,open_mode from v$database;
DBID NAME OPEN_MODE
---------- --------- ----------
2315014338 SYBO READ WRITE
--接下来重建spfile文件以及密码文件,配值监听,tnsnames.ora,修改global name,重建dbconsole,全备等,此处省略.
--对于仅仅修改dbid的情形不再演示. mount状态下发布命令 nid target=sys/pwd 即可.
更多Oracle相关信息见Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12
