一般数据库能mount获取dbid比较容易c:\users\liangweigt;rman target /恢复管理器: release 10.2.0.3.0 - production on 星期五
一般数据库能mount获取dbid比较容易
c:\users\liangwei>rman target /
恢复管理器: release 10.2.0.3.0 - production on 星期五 10月 7 21:29:05 2011
copyright (c) 1982, 2005, oracle. all rights reserved.
已连接到目标数据库: test (dbid=2061567322, 未打开)
sql> select dbid from v$database;
dbid
----------
2061567322
数据库不能mount的情况下获取dbid的方法
1.如果有awr报告,从awr报告中也可以获取dbid
workload repository report for
db name db id instance inst num release rac host
------------ ----------------- ------------ ------------- ----------- ------- ------------
test 2061567322 test 1 10.2.0.3.0 no ss-liangwei
二、从备份文件中恢复控制文件后mount数据库
rman> restore controlfile from 'e:\oracle\product\10.2.0\flash_recovery_area\test\backupset\2011_10_
07\o1_mf_ncsnf_tag20111007t172440_78xkdlgf_.bkp';
启动 restore 于 07-10月-11
使用通道 ora_disk_1
通道 ora_disk_1: 正在复原控制文件
通道 ora_disk_1: 恢复完成, 用时: 00:00:04
输出文件名=e:\oracle\product\10.2.0\oradata\test\control01.ctl
输出文件名=e:\oracle\product\10.2.0\oradata\test\control02.ctl
输出文件名=e:\oracle\product\10.2.0\oradata\test\control03.ctl
完成 restore 于 07-10月-11
sql> alter database mount;
数据库已更改。
c:\users\liangwei>rman target /
恢复管理器: release 10.2.0.3.0 - production on 星期五 10月 7 21:48:52 2011
copyright (c) 1982, 2005, oracle. all rights reserved.
已连接到目标数据库: test (dbid=2061567322, 未打开)
三、设置错误的dbid在restore时rman会告诉你正确的dbid
c:\users\liangwei>rman target /
恢复管理器: release 10.2.0.3.0 - production on 星期五 10月 7 21:40:51 2011
copyright (c) 1982, 2005, oracle. all rights reserved.
连接到目标数据库: test (未装载)
rman> set dbid=1234567890
正在执行命令: set dbid
rman> restore database;
启动 restore 于 07-10月-11
释放的通道: ora_disk_1
启动 implicit crosscheck backup 于 07-10月-11
rman-00569: =============== error message stack follows ===============
rman-00571: ===========================================================
rman-03002: restore 命令 (在 10/07/2011 21:42:50 上) 失败
rman-12010: 自动通道分配初始化失败
rman-06189: 当前 dbid 1234567890 与目标装载数据库 (2061567322) 不匹配
,