概述
[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/
最后
以上就是洁净蜡烛为你收集整理的RMAN-06495: must explicitly specify DBID with SET DBID command的全部内容,希望文章能够帮你解决RMAN-06495: must explicitly specify DBID with SET DBID command所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复