catalog命令可以用来扫描备份片,文件拷贝(datafile or controlfile copy),也可以用来扫描归档日志,所以,只要你的备份还在,归档还在,即使catalog database崩溃,控制文件重建,照样可以用这些备份来做恢复。 扫描备份片 CATALOG BACKUPPIECE ‘?/oradata/01dmsbj4_1_1.bcp’; 扫描归档日志 CATALOG ARCHIVELOG ‘?/oradata/archive1_30.dbf’, ‘?/oradata/archive1_31.dbf’; 扫描数据文件拷贝,并且将其做为增量备份的level 0 CATALOG DATAFILECOPY ‘?/oradata/users01.bak’ LEVEL 0; 扫描控制文件拷贝 CATALOG CONTROLFILECOPY ‘controlfilecopy.ctl’ 扫描整个目录,如果备份片或者归档日志文件太多,可以放到一个目录中,一次性扫描就行 CATALOG START WITH ‘/tmp/arch_logs’; 扫描闪回恢复区 CATALOG RECOVERY AREA NOPROMPT; 这里需要注意将备份的log和备份文件一起保存下来,不然就不知道哪些文件属于哪个备份集,恢复的时候就要多浪费些时间啦。但是注意这些命令是有限制的,其中的一个限制是不能注册备份文件到不同的数据库: You cannot use CATALOG to catalog a file that belongs to a different database. 也就是说你至少还需要原数据库的控制文件。 否则就会出现类似如下的错误: $ rman target / Recovery Manager: Release 10.2.0.1.0 - Production on Thu May 22 01:02:56 2008 Copyright (c) 1982, 2005, Oracle. All rights reserved. connected to target database (not started) RMAN> set dbid=1490303982 executing command: SET DBID RMAN> startup mount; Oracle instance started database mounted Total System Global Area 285212672 bytes Fixed Size 1218992 bytes Variable Size 92276304 bytes Database Buffers 188743680 bytes Redo Buffers 2973696 bytes RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of startup command at 05/22/2008 01:03:08 RMAN-06189: current DBID 1490303982 does not match target mounted database (1492784050) 当然我们可以通过先修改一个恢复数据库的DBID,然后再来注册这个备份集。如何修改DBID可以参考