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

[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/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/1698901/viewspace-103261/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值