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>