1. DB_NAME 表示数据库名称,DB_NAME 会保持在数据文件头、控制文件、REDO文件里,所以更改DB_NAME不能仅仅修改spfile ,还需要用nid 来进行更改,并且更改后还需要手工做些工作,使其生效。
DB_NAME 最长 8 个字符。

2. 在 DG下,主库和物理从库的 DB_NAME 是一致的,主库和物理从库的DB_UNIQUE_NAME 不同,DB_UNIQUE_NAME 用于标识主从库。

修改 DB_UNIQUE_NAME 需要修改 spfile 并重启数据库;
由于 DB_NAME 记录在数据文件头、控制文件、REDO文件里,所以修改 DB_NAME 一般有两种方式:
(1)备份控制文件到trace,修改 spfile,重启数据库,resetlogs 打开数据库
(2)或者通过 nid 命令修改

3. SID:System Identifier

The SID identifies the instance's shared memory on a host, but may not uniquely distinguish this instance
from other instances

doc上把sid解释为在host上用sid来标示实例的共享内存的,可见sid主要是和os打交道的。

sid可以通过如下语句在库中查询: select instance_name from v$instance;

(I):如果你只想更改数据库的id(dbid),那么你只需要指定target参数就可以了,具体的操作过程,请参考如下:
1. Backup 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
5. 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
(II):如果你想只更改数据库名(db_name),那么你需要设置SETNAME参数为Y,同时指定DBNAME参数,具体的操作过程,请参考如下:
1. Backup 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 SETNAME=Y
- the value of DBNAME is the new dbname of the database
- SETNAME must be set to Y. The default is N and causes the
DBID to be changed also.
5. 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(without resetlogs)
(III):如果你想同时更改数据库名(db_name)和数据库ID(dbid),那么你要指定DBNAME参数,同时设置SETNAME为N(其值默认也为N),具体操作过程,请参考如下:
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
(IV):如果你只更改了数据库名,而没有更改数据库id,那么你打开数据库就不需要open resetlogs了。
在构建DG的时候,从库上提示:

ORA-16047: DGID mismatch between destination setting and standby

其实就是主从库上配置的 db_unique_name, log_archive_config 参数是否匹配导致的。

最新文章

  1. Unicode 转成中文
  2. IntelliJ 2016.02设置maven 阿里云加速
  3. C# 实现HTML5服务器推送事件
  4. Android笔记之adb命令应用实例1(手机端与PC端socket通讯下)
  5. 深度RAMOS,把操作系统全部安装在内存上
  6. 超人学院Hadoop大数据技术资源分享
  7. 久未更 ~ 四之 —— Vsftpd出现 Failed to start Vsftpd ftp daemon错误
  8. Java编程思想(后)
  9. Python对HDFS的一些基础操作
  10. BZOJ3963 WF2011MachineWorks(动态规划+斜率优化+cdq分治)
  11. ajax 获取服务器返回的XML字符串
  12. 【PyQt5-Qt Designer】浅谈关闭窗口
  13. 【PyCharm疑问】在pycharm中带有中文时,有时会导致程序判断错误,是何原因?
  14. 2017/05/23 java 基础 随笔
  15. python scrapy 调试模式
  16. e835. 使JTabbedPane中的卡片生效和失效
  17. Win7下静态编译QT5.12源码
  18. urllib模块和urllib2模块的区别
  19. manjaro i3 配置笔记
  20. mysql-otp 驱动中设置utf8mb4

热门文章

  1. [转]How to get return values and output values from a stored procedure with EF Core?
  2. [转]ASP.NET web API 2 OData enhancements
  3. MVC缓存(一)
  4. win10下设置IIS、安装php7.2
  5. js实现队列结构
  6. java 自定义异常处理
  7. SQLServer数据库系统概念
  8. ZJOI2012 网络——LCT相关题目
  9. js中变量声明有var和没有var的区别
  10. CentOS6.5(3)----设置自己安装的程序开机自动启动