rman备份,未用catalog,控制文件丢失的解决(2)
2008-12-16 13:05:18 来源:WEB开发网PROCEDURE restoreControlfileTo(cfname IN varchar2);
-- This copies the controlfile from the backup set to an operating system
-- file. If the database is mounted, the name must NOT match any of the
-- current controlfiles.
--
-- Input parameters:
-- cfname
-- Name of file to create or overwrite with the controlfile from the
-- backup set.
PROCEDURE restoreDataFileTo( dfnumber IN binary_integer
,toname IN varchar2 default NULL);
--
-- restoreDataFileTo creates the output file from a complete backup in the
-- backup set.
如果您有兴趣可以去阅读一下这两个文件的注释说明.
我们首先尝试恢复控制文件:
SQL>startup force nomount;
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.restoreControlfileTo(cfname=>'d:oracleControl01.ctl');
8 sys.dbms_backup_restore.restoreBackupPiece(done=>done,handle=>'D:KDEDEMO_01FR79OT_1_1.DBF', params=>null);
9 sys.dbms_backup_restore.deviceDeallocate;
10 END;
11 /
PL/SQL procedure successfully completed.
OK,控制文件恢复完成.对以上内容的解释:
第五行 分配一个device channel,因为使用的操作系统文件,所以这里为空,如果是从磁带上恢复要用
更多精彩
赞助商链接