|
|
 |
 |
|
|
 |
|
控制文件丢失的解决办法
|
|
|
|
编辑:华夏媒体 作者:未知 来源:网络 时间:2006-07-29 总浏览量:1554 |
|
文字大小:[ 大 中 小 ]
文字颜色: 双击滚屏/单击停止 |
|
[上一页] [1] [2] [3] [4] [5] [6] [7] [下一页]
|
-- return value is NULL when using operating system files.
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. 如果您有兴趣可以去阅读一下这两个文件的注释说明. 我们首先尝试恢复控制文件: [page_break]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:\oracle\Control01.ctl’); 8 sys.dbms_backup_restore.restoreBackupPiece(done=>done,handle=>’D:\KDE\DEMO_01FR79OT_1_1.DBF’, params=>null); 9 sys.dbms_backup_restore.deviceDeallocate; 10 END; 11 / PL/SQL procedure successfully completed.
OK,控制文件恢复完成.对以上内容的解释: 第五行 分配一个device channel,因为使用的操作系统文件,所以这里为空,如果是从磁带上恢复要用 "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
|
|
[上一页] [1] [2] [3] [4] [5] [6] [7] [下一页]
|
|
|
打印 收藏 关闭 至顶部 |
|
 |
|