使用nib修改Oracle数据库名称
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了使用nib修改Oracle数据库名称,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含4134字,纯文字阅读大概需要6分钟。
内容图文
![使用nib修改Oracle数据库名称](/upload/InfoBanner/zyjiaocheng/550/6d41df9ee7be4f1090a0cc7eafb68f0c.jpg)
使用nib修改Oracle数据库名称,有两个方法:一是将controlfile 转出来,修改数据库名称重建;另一个是使用nib 工具修改。我这里介
有两个方法:一是将controlfile 转出来,修改数据库名称重建;另一个是使用nib 工具修改。我这里介绍nib 工具修改操作方法。
工具nib 是Oracle 9i 开始提供的,专门用于修改数据库名称。
第一步,备份整库。
因为这种操作会有可能失败,所以必须要先备份。
第二步,将库正常关闭,再启动到mount 状态。
第三步,使用nib 修改数据库名称
修改命令为 nid target=sys/welcome1 dbname=webdb
修改完成后,,提示数据库已经关闭,需要使用open resetlogs 方式打开。
第四步,打开数据库。
打开之前,需要新生成符合新数据库名称的初始化参数文件和密码文件。监听器文件也需要做针对性修改。
/u04/webdb_rman@db3=>webreader$nid target=sys/welcome1 dbname=webdb
DBNEWID: Release 10.2.0.4.0 - Production on Tue May 15 11:43:33 2012
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to database WEBREADER (DBID=4271057885)
Connected to server version 10.2.0
Control Files in database:
+VG1/webdb/control01.ctl
+VG1/webdb/control02.ctl
+VG1/webdb/control03.ctl
Change database ID and database name WEBREADER to WEBDB? (Y/[N]) => Y
Proceeding with operation
Changing database ID from 4271057885 to 2506031974
Changing database name from WEBREADER to WEBDB
Control File +VG1/webdb/control01.ctl - modified
Control File +VG1/webdb/control02.ctl - modified
Control File +VG1/webdb/control03.ctl - modified
Datafile +VG1/webdb/system01.dbf - dbid changed, wrote new name
Datafile +VG2/webdb/data_salebill05.dbf - dbid changed, wrote new name
Datafile +VG1/webdb/sysaux01.dbf - dbid changed, wrote new name
Datafile +VG1/webdb/users01.dbf - dbid changed, wrote new name
Datafile +VG1/webdb/undotbs02.dbf - dbid changed, wrote new name
………………………
Instance shut down
Database name changed to WEBDB.
Modify parameter file and generate a new password file before restarting.
Database ID for database WEBDB changed to 2506031974.
All previous backups and archived redo logs for this database are unusable.
Database has been shutdown, open database with RESETLOGS option.
Succesfully changed database name and ID.
DBNEWID - Completed succesfully.
/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 专题页面 ?tid=12
内容总结
以上是互联网集市为您收集整理的使用nib修改Oracle数据库名称全部内容,希望文章能够帮你解决使用nib修改Oracle数据库名称所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。