rman备份,未用catalog,控制文件丢失的解决(2)
2008-12-16 13:05:18 来源:WEB开发网"sbt_tape";
第六行 指明开始restore ;
第七行 指出待恢复文件目标存储位置;
第八行 从哪个备份片中恢复;
第九行 释放设备通道.
不妨对以上操作的结果验证一下:
SQL> host dir d:oracle
Volume in drive D is DATA
Volume Serial Number is DC79-57F8
Directory of d:oracle
07/18/2004 09:08 PM <DIR> .
07/18/2004 09:08 PM <DIR> ..
06/08/2004 03:21 PM <DIR> admin
07/18/2004 09:08 PM 1,871,872 CONTROL01.CTL
07/16/2004 11:27 AM <DIR> ORA92
07/18/2004 09:02 PM <DIR> oradata
这样,我们成功的restore了控制文件 .如果控制文件在Full备份之后单独做的,接下来关掉实例,拷贝控制文件到具体位置,然后rman 执行restore database;即可。
可是,我们这里的情况有些不同.
视丢失文件的情况而定,继续进行如下的恢复操作:
代码:--------------------------------------------------------------------------------
SQL> DECLARE
2 devtype varchar2(256);
3 done boolean;
4 BEGIN
5 devtype:=sys.dbms_backup_restore.deviceAllocate (type=>'',ident=>'t1');
6 sys.dbms_backup_restore.restoreSetDatafile;
7 sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>01,toname=>'
d:oracleoradatademoSYSTEM01.DBF');
8 sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>02,toname=>'
d:oracleoradatademoUNDOTBS01.DBF');
9 sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>03,toname=>'
d:oracleoradatademoDRSYS01.DBF');
10 sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>04,toname=>'
d:oracleoradatademoEXAMPLE01.DBF');
11 sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>05,toname=>'
d:oracleoradatademoINDX01.DBF');
12 sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>06,toname=>'
d:oracleoradatademoODM01.DBF');
13 sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>07,toname=>'
d:oracleoradatademoTOOLS01.DBF');
14 sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>08,toname=>'
d:oracleoradatademoUSERS01.DBF');
15 sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>09,toname=>'
d:oracleoradatademoXDB01.DBF');
16 sys.dbms_backup_restore.restoreBackupPiece(done=>done,handle=>'
D:KDEDEMO_01FR79OT_1_1.DBF', params=>null);
17 sys.dbms_backup_restore.deviceDeallocate;
18 END;
19 /
PL/SQL procedure successfully completed.
更多精彩
赞助商链接