设为首页 加入收藏

TOP

【翻译自mos文章】当控制文件的备份丢失时,怎么restoredatabase(二)
2015-07-24 12:13:37 来源: 作者: 【 】 浏览:163
Tags:翻译 mos 文章 控制 文件 备份 失时 怎么 restoredatabase
ckup/ORA1122-backup-080312.log File Name: /u03/backup/2dn5blsq_1_1 File Name: /u03/backup/2cn5blrn_1_1 File Name: /u03/backup/ora102-080312.log File Name: /u03/backup/27n5bkd0_1_1 cataloging files... cataloging done List of Cataloged Files ======================= File Name: /u03/backup/2dn5blsq_1_1 File Name: /u03/backup/2cn5blrn_1_1 List of Files Which Where Not Cataloged ======================================= File Name: /u03/backup/28n5bki6_1_1 RMAN-07518: Reason: Foreign database file DBID: 2353175563 Database Name: ORA1122 File Name: /u03/backup/ORA1122-backup-080312.log RMAN-07517: Reason: The file header is corrupted File Name: /u03/backup/ora102-080312.log RMAN-07517: Reason: The file header is corrupted File Name: /u03/backup/27n5bkd0_1_1 RMAN-07518: Reason: Foreign database file DBID: 2353175563 Database Name: ORA1122 RMAN> list backup; using target database control file instead of recovery catalog List of Backup Sets =================== BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 1 Full 1.05M DISK 00:00:00 08-MAR-12 BP Key: 1 Status: AVAILABLE Compressed: YES Tag: TAG20120308T101415 Piece Name: /u03/backup/2dn5blsq_1_1 Control File Included: Ckp SCN: 1320981 Ckp time: 08-MAR-12 SPFILE Included: Modification time: 08-MAR-12 BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 2 Full 107.40M DISK 00:00:00 08-MAR-12 BP Key: 2 Status: AVAILABLE Compressed: YES Tag: TAG20120308T101415 Piece Name: /u03/backup/2cn5blrn_1_1 List of Datafiles in backup set 2 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 1 Full 1320981 08-MAR-12 +DATA/ora102/datafile/system.257.775126603 2 Full 1320981 08-MAR-12 3 Full 1320981 08-MAR-12 4 Full 1320981 08-MAR-12 5 Full 1320981 08-MAR-12 RMAN>

5. 使用dbms_backup_restore package 来restore datafile。请注意:datafile的名字不重要,只要对于要恢复的datafile,是唯一的名字即可。

SQL>  -- use script

DECLARE
  devtype varchar2(256);
  done boolean;
BEGIN
  devtype := dbms_backup_restore.DeviceAllocate(type=>null, ident=>'d1');
  dbms_backup_restore.RestoreSetDatafile;
  dbms_backup_restore.RestoreDatafileTo(dfnumber => 4,toname => '/u03/datafile4.dbf');
  dbms_backup_restore.RestoreDatafileTo(dfnumber => 2,toname => '/u03/datafile2.dbf');
  dbms_backup_restore.RestoreDatafileTo(dfnumber => 3,toname => '/u03/datafile3.dbf');
  dbms_backup_restore.RestoreDatafileTo(dfnumber => 5,toname => '/u03/datafile5.dbf');
  dbms_backup_restore.RestoreDatafileTo(dfnumber => 1,toname => '/u03/datafile1.dbf');
  dbms_backup_restore.RestoreBackupPiece(done => done,handle =>'/u03/backup/2cn5blrn_1_1', params => null);
  dbms_backup_restore.DeviceDeallocate;
END;
/

PL/SQL procedure successfully completed.


元数据显示只有datafile 1,我么需要重建控制文件以便带上所有需要恢复的datafiles

SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
+DATA/ora102/datafile/system.257.775126603

SQL> shutdown immediate;  startup nomount;
ORACLE instance started.

Total System Global Area 209715200 bytes
Fixed Size 1272864 bytes
Variable Size 142607328 bytes
Database Buffers 58720256 bytes
Redo Buffers 7114752 bytes
SQL>!cat /u0
首页 上一页 1 2 3 下一页 尾页 2/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇undo表空间异常增大印发的空间不.. 下一篇linux主机监控信息显示

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: