找回被转移的备份文件 delete expired ;catalog

来源:互联网 发布:票据打印的软件 编辑:程序博客网 时间:2024/05/20 01:34
RMAN> list backup of tablespace users;List of Backup Sets===================BS Key  Type LV Size       Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------35      Full    7.46M      DISK        00:00:00     03-FEB-15              BP Key: 35   Status: AVAILABLE  Compressed: NO  Tag: TAG20150203T011637        Piece Name: /u01/oracle/11G/dbs/13puabbl_1_1  List of Datafiles in backup set 35  File LV Type Ckp SCN    Ckp Time  Name  ---- -- ---- ---------- --------- ----  4       Full 1355964    03-FEB-15 /u01/oracle/oradata/db01/users01.dbfBS Key  Type LV Size       Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------37      Full    7.46M      DISK        00:00:01     03-FEB-15              BP Key: 37   Status: AVAILABLE  Compressed: NO  Tag: TAG20150203T012058        Piece Name: /u01/oracle/11G/dbs/15puabjq_1_1  List of Datafiles in backup set 37  File LV Type Ckp SCN    Ckp Time  Name  ---- -- ---- ---------- --------- ----  4       Full 1356093    03-FEB-15 /u01/oracle/oradata/db01/users01.dbfRMAN> list backup of tablespace users;List of Backup Sets===================BS Key  Type LV Size       Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------35      Full    7.46M      DISK        00:00:00     03-FEB-15              BP Key: 35   Status: AVAILABLE  Compressed: NO  Tag: TAG20150203T011637        Piece Name: /u01/oracle/11G/dbs/13puabbl_1_1  List of Datafiles in backup set 35  File LV Type Ckp SCN    Ckp Time  Name  ---- -- ---- ---------- --------- ----  4       Full 1355964    03-FEB-15 /u01/oracle/oradata/db01/users01.dbfBS Key  Type LV Size       Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------37      Full    7.46M      DISK        00:00:01     03-FEB-15              BP Key: 37   Status: AVAILABLE  Compressed: NO  Tag: TAG20150203T012058        Piece Name: /u01/oracle/11G/dbs/15puabjq_1_1  List of Datafiles in backup set 37  File LV Type Ckp SCN    Ckp Time  Name  ---- -- ---- ---------- --------- ----  4       Full 1356093    03-FEB-15 /u01/oracle/oradata/db01/users01.dbf
<pre name="code" class="sql">15puabjq_1_1这个备份文件直接mv 移动到新文件夹,系统不立即知道它过期了,如下命令:
RMAN> delete noprompt expired backupset;using channel ORA_DISK_1
应该先检查,系统才知道,有过期文件<span style="font-family: Arial, Helvetica, sans-serif;">15puabjq_1_1</span>。
RMAN> crosscheck backupset of tablespace users;using channel ORA_DISK_1crosschecked backup piece: found to be 'AVAILABLE'backup piece handle=/u01/oracle/11G/dbs/13puabbl_1_1 recid=35 stamp=870657397crosschecked backup piece: found to be 'EXPIRED'backup piece handle=/u01/oracle/11G/dbs/15puabjq_1_1 recid=37 stamp=870657658Crosschecked 2 objects
<pre name="code" class="sql">delete expired 这个命令一执行完,就少一个备份了。
RMAN> delete noprompt expired backupset;using channel ORA_DISK_1List of Backup PiecesBP Key  BS Key  Pc# Cp# Status      Device Type Piece Name------- ------- --- --- ----------- ----------- ----------37      37      1   1   EXPIRED     DISK        /u01/oracle/11G/dbs/15puabjq_1_1deleted backup piecebackup piece handle=/u01/oracle/11G/dbs/15puabjq_1_1 recid=37 stamp=870657658Deleted 1 EXPIRED objectsRMAN> list backup of tablespace users;List of Backup Sets===================BS Key  Type LV Size       Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------35      Full    7.46M      DISK        00:00:00     03-FEB-15              BP Key: 35   Status: AVAILABLE  Compressed: NO  Tag: TAG20150203T011637        Piece Name: /u01/oracle/11G/dbs/13puabbl_1_1  List of Datafiles in backup set 35  File LV Type Ckp SCN    Ckp Time  Name  ---- -- ---- ---------- --------- ----  4       Full 1355964    03-FEB-15 /u01/oracle/oradata/db01/users01.dbf
<pre name="code" class="sql">catalog backuppiece '/u01/oracle/11G/dbs/15puabjq_1_1';
这个命令在原目录是执行报错的,因为没有文件。
RMAN> catalog backuppiece '/u01/oracle/11G/dbs/15puabjq_1_1';ORA-19870: error reading backup piece /u01/oracle/11G/dbs/15puabjq_1_1ORA-19505: failed to identify file "/u01/oracle/11G/dbs/15puabjq_1_1"ORA-27037: unable to obtain file statusLinux-x86_64 Error: 2: No such file or directoryAdditional information: 3RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of catalog command at 02/03/2015 01:53:23RMAN-06209: List of failed objectsRMAN-06211: ==========================RMAN-06212:   Object Type   Filename/HandleRMAN-06213: --------------- ---------------------------------------------------RMAN-06214: Backup Piece    /u01/oracle/11G/dbs/15puabjq_1_1
<pre name="code" class="sql"><pre name="code" class="sql">catalog backuppiece '/u01/oracle/11G/dbs/15puabjq_1_1';
这个命令在原目录是执行报错的,因为没有文件,这里再次确认。
RMAN> catalog backuppiece '/u01/oracle/11G/dbs/15puabjq_1_1';ORA-19870: error reading backup piece /u01/oracle/11G/dbs/15puabjq_1_1ORA-19505: failed to identify file "/u01/oracle/11G/dbs/15puabjq_1_1"ORA-27037: unable to obtain file statusLinux-x86_64 Error: 2: No such file or directoryAdditional information: 3RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of catalog command at 02/03/2015 01:53:40RMAN-06209: List of failed objectsRMAN-06211: ==========================RMAN-06212:   Object Type   Filename/HandleRMAN-06213: --------------- ---------------------------------------------------RMAN-06214: Backup Piece    /u01/oracle/11G/dbs/15puabjq_1_1
<pre name="code" class="sql"><pre name="code" class="sql"><pre name="code" class="sql">catalog backuppiece '/u01/oracle/11G/dbs/mvdiry/15puabjq_1_1';
这个命令ok的,因为备份文件在此新的目录下。
RMAN> catalog backuppiece '/u01/oracle/11G/dbs/mvdiry/15puabjq_1_1';cataloged backuppiecebackup piece handle=/u01/oracle/11G/dbs/mvdiry/15puabjq_1_1 recid=38 stamp=870659638
证明已找回备份文件。
RMAN> list backup of tablespace users;List of Backup Sets===================BS Key  Type LV Size       Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------35      Full    7.46M      DISK        00:00:00     03-FEB-15              BP Key: 35   Status: AVAILABLE  Compressed: NO  Tag: TAG20150203T011637        Piece Name: /u01/oracle/11G/dbs/13puabbl_1_1  List of Datafiles in backup set 35  File LV Type Ckp SCN    Ckp Time  Name  ---- -- ---- ---------- --------- ----  4       Full 1355964    03-FEB-15 /u01/oracle/oradata/db01/users01.dbfBS Key  Type LV Size       Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------37      Full    7.46M      DISK        00:00:01     03-FEB-15              BP Key: 38   Status: AVAILABLE  Compressed: NO  Tag: TAG20150203T012058        Piece Name: /u01/oracle/11G/dbs/mvdiry/15puabjq_1_1  List of Datafiles in backup set 37  File LV Type Ckp SCN    Ckp Time  Name  ---- -- ---- ---------- --------- ----  4       Full 1356093    03-FEB-15 /u01/oracle/oradata/db01/users01.dbf
<pre name="code" class="sql">再次证明已找回备份文件。
但是目录要注意是新的目录哦。/u01/oracle/11G/dbs/mvdiry/15puabjq_1_1
RMAN> crosscheck backupset of tablespace users;using channel ORA_DISK_1crosschecked backup piece: found to be 'AVAILABLE'backup piece handle=/u01/oracle/11G/dbs/13puabbl_1_1 recid=35 stamp=870657397crosschecked backup piece: found to be 'AVAILABLE'backup piece handle=/u01/oracle/11G/dbs/mvdiry/15puabjq_1_1 recid=38 stamp=870659638Crosschecked 2 objectsRMAN> delete noprompt expired backupset;using channel ORA_DISK_1RMAN> 

0 0
原创粉丝点击