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

使用nib修改Oracle数据库名称

[日期:2012-06-13] 来源:Linux社区  作者:mikixiyou [字体:大 中 小]

有两个方法:一是将controlfile 转出来,修改数据库名称重建;另一个是使用nib 工具修改。我这里介绍nib 工具修改操作方法。

工具nib 是Oracle 9i 开始提供的,专门用于修改数据库名称。

第一步,备份整库。

因为这种操作会有可能失败,所以必须要先备份。

第二步,将库正常关闭,再启动到mount 状态。

第三步,使用nib 修改数据库名称

修改命令为  nid target=sys/welcome1 dbname=webdb

修改完成后,提示数据库已经关闭,需要使用open resetlogs 方式打开。

第四步,打开数据库。

打开之前,需要新生成符合新数据库名称的初始化参数文件和密码文件。监听器文件也需要做针对性修改。

/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, 2007, Oracle.  All Rights Reserved.
Connected to:
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, 2007, 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>

更多Oracle相关信息见Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

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