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

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.dbf

BS 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

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.dbf

BS 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_1
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u01/oracle/11G/dbs/13puabbl_1_1 recid=35 stamp=870657397
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u01/oracle/11G/dbs/15puabjq_1_1 recid=37 stamp=870657658
Crosschecked 2 objects

<pre name="code" class="sql">delete expired 这个命令一执行完,就少一个备份了。
 

RMAN> delete noprompt expired backupset;

using channel ORA_DISK_1

List of Backup Pieces
BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
37      37      1   1   EXPIRED     DISK        /u01/oracle/11G/dbs/15puabjq_1_1
deleted backup piece
backup piece handle=/u01/oracle/11G/dbs/15puabjq_1_1 recid=37 stamp=870657658
Deleted 1 EXPIRED objects


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.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_1
ORA-19505: failed to identify file "/u01/oracle/11G/dbs/15puabjq_1_1"
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of catalog command at 02/03/2015 01:53:23
RMAN-06209: List of failed objects
RMAN-06211: ==========================
RMAN-06212:   Object Type   Filename/Handle
RMAN-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_1
ORA-19505: failed to identify file "/u01/oracle/11G/dbs/15puabjq_1_1"
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of catalog command at 02/03/2015 01:53:40
RMAN-06209: List of failed objects
RMAN-06211: ==========================
RMAN-06212:   Object Type   Filename/Handle
RMAN-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 backuppiece
backup 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.dbf

BS 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_1
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u01/oracle/11G/dbs/13puabbl_1_1 recid=35 stamp=870657397
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u01/oracle/11G/dbs/mvdiry/15puabjq_1_1 recid=38 stamp=870659638
Crosschecked 2 objects

RMAN> delete noprompt expired backupset;

using channel ORA_DISK_1

RMAN> 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值