为什么需要set dbid

You should only run the SET DBID command in the following specialized circumstances:
  • You are not connected to a recovery catalog and want to restore the control file (see Example 2-137). The same restriction applies when you use the Data Recovery Advisor to restore a control file autobackup. CONFIGURE can locate an autobackup and restore it only if SET DBID is issued before ADVISE FAILURE.
  • You want to restore the server parameter file (see Example 2-138).
  • You are connected to the recovery catalog but not the target database and use the FOR DB_UNIQUE_NAME option on the CONFIGURELISTREPORTSHOW, or UNREGISTER commands.


这个是官方文档的说法,但是我还是不明白为什么需要set dbid。
为什么知道了db_name还不能restore controlfile?为什么连到recovery catalog就不用set dbid?

”为什么知道了db_name还不能restore controlfile?“

db_name不是一个数据库的唯一标识

rman 通过 dbid 和 controlfile的自动备份格式 来决定 哪些控制文件是针对这个 DB的。

想象一个场景 没有DBID , 同一个OS上 存有 2个  db_name 一样的 不同DB  在特定的区域对 控制文件做了自动备份(autobackup controlfile), 当丢失控制文件时  若没有dbid 这个唯一标识 如何 确定 哪一个控制文件 是对的呢?

RMAN uses the autobackup format and DBID to determine where to hunt for the control file autobackup. If one is found, RMAN restores the control file from that backup to all of the control file locations listed in the CONTROL_FILES initialization parameter.

http://docs.oracle.com/cd/B19306_01/backup.102/b14192/recov004.htm

Restrictions and Usage Notes for the SET DBID Command

You should only run the SET DBID command in the following specialized circumstances:

    You are not connected to a recovery catalog and want to restore the control file or server parameter file.

    You are connected to a recovery catalog and want to restore the control file, but the database name is not unique in the recovery catalog.

    The server parameter file is lost and you want to restore it.


http://docs.oracle.com/cd/B19306 ... 194/rcmsynta055.htm


“那为什么连到recovery catalog就不用set dbid?”

仅仅在 recovery catalog的记录中 相关DB NAME是 Unique 唯一的情况 下 ,不需要设置 dbid 即可restore controlfile 

反过来说 如果 recovery catalog中 注册(Register)了2个 db name一致的 DB ,那么也会要求你 set dbid

猜你喜欢

转载自blog.csdn.net/w892824196/article/details/84203035