ITPub博客

首页 > Linux操作系统 > Linux操作系统 > RMAN-06495: must explicitly specify DBID with SET DBID command

RMAN-06495: must explicitly specify DBID with SET DBID command

原创 Linux操作系统 作者:fjmingyang 时间:2019-05-07 13:45:05 0 删除 编辑

[oracle@standby oradata]$ rman target /

Recovery Manager: Release 9.2.0.4.0 - Production

Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.

connected to target database (not started)

首先启动数据库到nomount状态

RMAN> startup nomount;

Oracle instance started

Total System Global Area 135337420 bytes

Fixed Size 452044 bytes
Variable Size 109051904 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes

尝试从自动备份中恢复控制文件

RMAN> restore controlfile to '/opt/oracle/oradata/control01.ctl' from autobackup;

Starting restore at 09-MAR-05

using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=11 devtype=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 03/09/2005 10:15:05
RMAN-06495: must explicitly specify DBID with SET DBID command

此时提示,必须显示的指定DBID,Oracle才能正确定位备份文件

RMAN> set DBID=1367687269

executing command: SET DBID

RMAN> restore controlfile to '/opt/oracle/oradata/control01.ctl' from autobackup;

Starting restore at 09-MAR-05

using channel ORA_DISK_1
channel ORA_DISK_1: looking for autobackup on day: 20050309
channel ORA_DISK_1: autobackup found: c-1367687269-20050309-00
channel ORA_DISK_1: controlfile restore from autobackup complete
Finished restore at 09-MAR-05

借用下eygle的例子:),这里谈谈为什么需要set dbid? 从字面上很容易理解,就是指定数据库的ID,(每个数据库的ID都是不同的,这里指定的是你要恢复的数据库的ID)。我们知道,Oracle startup nomount是需要parameter file的,而parameter file有指定db_name ,那为什么还需要set dbid呢?其实RMAN是可以使用一个dummy parameter file启动instance到nomount状态的,即虚拟一个db name为DUMMY的DB,故

restore controlfile to '/opt/oracle/oradata/control01.ctl' from autobackup;

RMAN无法判定你要从哪个DB的autobackup恢复

BTW:DBID可以在RMAN连接时得到

[oracle@standby oradata]$ rman target /

Recovery Manager: Release 9.2.0.4.0 - Production

Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.

connected to target database: PRIMARY (DBID=1367687269)

也可以从v$database得到

SQL> select dbid from v$database;

DBID
----------
3152029224

实际上每个数据文件和控制文件上也都包含dbid信息,可以自己写程序从数据文件文件中读取出来


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/1698901/viewspace-103261/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2006-04-03

  • 博文量
    66
  • 访问量
    48788