文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > IT/计算机 > Oracle-修改DB_NAME-和-DBID
侵权投诉

Oracle-修改DB_NAME-和-DBID

Oracle-修改DB_NAME-和-DBID

Oracle 修改DB_NAME 和 DBIDOracle 修改DB_NAME 和 DBID


一. 相关概念

关于DB_NAME,INSTANCE_NAME 的定义,参考我的Blog:
DBID,SID,DB_NAME,DB_DOMAIN,INSTANCE_NAME,DB_UNIQUE_NAME,SERVICE_NAMES 及监听参数的说明
doc.guandang.net

关于NID命令的使用,参考Blog:
How to Change the DBID and the DBNAME by using NID [ID 224266.1]
doc.guandang.net

在这篇blog里提到了一下信息:
The NID (New Database ID)is a new utility introduced with Oracle 9.2. The NID utility allows you to change only the DBNAME, or only the DBID or both DBNAME and DBID in the same command.

-- 我们可以使用NID 命令只修改DBNAME, 或者只修改DBID,或者2个都修改。

他们的区别如下:
1. If you change the DBID you must open the database with the RESETLOGS option, which re-creates the online redo logs and resets their sequence to 1.
-- 修改DBID,必须要用resetlogs 打开数据库。 这个在之前的DBID 的介绍里说过,因为DBID 存在与数据文件,redo log 和控制文件。 所以如果修改了DBID, 则必须要使用resetlogs打开。

2. If you change the DBNAME without changing the DBID then this does not require you to open with the RESETLOGS option, so database backups and archived logs are not invalidated. You must change the DB_NAME initialization parameter after a database name change to reflect the new name. Also, you may have to re-create the Oracle password file. If you restore an old backup of the control file (before the name change, then you should use the initialization parameter file and password file from before the database name change.

关于NID 修改DBID 和DBNAME的具体3种用法,参考之前的那片文章。

在这里还有一点要注意, 就是orapwSID 和 initSID.ora 是和INSTANCE_NAME 对应的,如果这个参数修改了,那么这2个文件也需要修改并与INSTANCE_NAME 对应。 修改这个参数也很简单,就是在init 文件里指定一个名称即可,如:*.INSTANCE_NAME=orcl


二. 修改DBID, DBNAME步骤
在这里,只演示一下修改DBID 和 DBNAME的操作。 并不修改INSTANE_NAME.

步骤如下:
1. Backup of the database.
2. Shutdown IMMEDIATE of the database
3. STARTUP MOUNT
4. Open one session and run NID with sysdba privileges
% nid TARGET=SYS/password@test_db DBNAME=test_db2
- the value of DBNAME is the new dbname of the database
5. After DBNEWID successfully changes the DBID,Shutdown IMMEDIATE of the database
6. Set the DB_NAME initialization parameter in the initialization parameter file to the new database name.
7. Create a new password file.
8. Startup of the database with open resetlogs


在修改之前,先看一下数据库的参数:
SQL> select name,dbid,db_unique_name from v$database;
NAME DBID DB_UNIQUE_NAME
--------- ---------

第1页

热门文档

相关文档

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email