你好,游客 登录 注册 搜索
背景:
阅读新闻

使用nid命令修改 db name 及 dbid

[日期:2013-05-04] 来源:Linux社区  作者:Robinson [字体:大 中 小]

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

linux
相关资讯       oracle dbid 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款