report need backup redundancy 1 tablespace users;删除"过期"备份

RMAN> report need backup redundancy 1 tablespace users;

Report of files with less than 1 redundant backups
File #bkps Name
---- ----- -----------------------------------------------------
4    0     /u01/oracle/oradata/db01/users01.dbf

RMAN> backup tablespace users;

Starting backup at 03-FEB-15
using channel ORA_DISK_1
using channel ORA_DISK_2
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00004 name=/u01/oracle/oradata/db01/users01.dbf
channel ORA_DISK_1: starting piece 1 at 03-FEB-15
channel ORA_DISK_1: finished piece 1 at 03-FEB-15
piece handle=/u01/oracle/11G/dbs/0vpua7f7_1_1 tag=TAG20150203T001015 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 03-FEB-15

RMAN> report need backup redundancy 1 tablespace users;

Report of files with less than 1 redundant backups
File #bkps Name
---- ----- -----------------------------------------------------

RMAN> exit


Recovery Manager complete.
[oracle@Slave1Hadoop51 ~]$ ls -ltr /u01/oracle/11G/dbs/0vpua7f7_1_1
ls: /u01/oracle/11G/dbs/0vpua7f7_1_1: No such file or directory
[oracle@Slave1Hadoop51 ~]$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Tue Feb 3 00:12:31 2015

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

connected to target database: DB01 (DBID=1467107934)

RMAN> crosscheck backupset of tablespace users;--crosscheck backupset device type disk;初步判断是范围大小的差别,显然前者更精确。

using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=139 devtype=DISK
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u01/oracle/11G/dbs/0cpua34n_1_1 recid=12 stamp=870648983
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u01/oracle/11G/dbs/0tpua572_1_1 recid=29 stamp=870651106
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u01/oracle/11G/dbs/0upua7c3_1_1 recid=30 stamp=870653315
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u01/oracle/11G/dbs/0vpua7f7_1_1 recid=31 stamp=870653415
Crosschecked 4 objects


RMAN> report need backup redundancy 1 tablespace users;

Report of files with less than 1 redundant backups
File #bkps Name
---- ----- -----------------------------------------------------
4    0     /u01/oracle/oradata/db01/users01.dbf

RMAN> list backupset of tablespace users;


List of Backup Sets
===================

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
12      Full    7.46M      DISK        00:00:01     02-FEB-15      
        BP Key: 12   Status: EXPIRED  Compressed: NO  Tag: TAG20150202T225623
        Piece Name: /u01/oracle/11G/dbs/0cpua34n_1_1
  List of Datafiles in backup set 12
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  4       Full 1351974    02-FEB-15 /u01/oracle/oradata/db01/users01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
29      Full    7.46M      DISK        00:00:00     02-FEB-15      
        BP Key: 29   Status: EXPIRED  Compressed: NO  Tag: TAG20150202T233146
        Piece Name: /u01/oracle/11G/dbs/0tpua572_1_1
  List of Datafiles in backup set 29
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  4       Full 1353085    02-FEB-15 /u01/oracle/oradata/db01/users01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
30      Full    7.46M      DISK        00:00:01     03-FEB-15      
        BP Key: 30   Status: EXPIRED  Compressed: NO  Tag: TAG20150203T000835
        Piece Name: /u01/oracle/11G/dbs/0upua7c3_1_1
  List of Datafiles in backup set 30
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  4       Full 1354181    03-FEB-15 /u01/oracle/oradata/db01/users01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
31      Full    7.46M      DISK        00:00:01     03-FEB-15      
        BP Key: 31   Status: EXPIRED  Compressed: NO  Tag: TAG20150203T001015
        Piece Name: /u01/oracle/11G/dbs/0vpua7f7_1_1
  List of Datafiles in backup set 31
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  4       Full 1354253    03-FEB-15 /u01/oracle/oradata/db01/users01.dbf

RMAN> 
4个过期的备份文件。

RMAN> crosscheck backupset of tablespace users;

using channel ORA_DISK_1
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u01/oracle/11G/dbs/0cpua34n_1_1 recid=12 stamp=870648983
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u01/oracle/11G/dbs/0tpua572_1_1 recid=29 stamp=870651106
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u01/oracle/11G/dbs/0upua7c3_1_1 recid=30 stamp=870653315
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u01/oracle/11G/dbs/0vpua7f7_1_1 recid=31 stamp=870653415
Crosschecked 4 objects


RMAN> delete noprompt expired backup; 

using channel ORA_DISK_1

List of Backup Pieces
BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
12      12      1   1   EXPIRED     DISK        /u01/oracle/11G/dbs/0cpua34n_1_1
13      13      1   1   EXPIRED     DISK        /u01/oracle/11G/dbs/0epua3na_1_1
14      14      1   1   EXPIRED     DISK        /u01/oracle/11G/dbs/0dpua3na_1_1
15      15      1   1   EXPIRED     DISK        /u01/oracle/11G/dbs/0fpua3ne_1_1
16      16      1   1   EXPIRED     DISK        /u01/oracle/11G/dbs/0gpua3nr_1_1
17      17      1   1   EXPIRED     DISK        /u01/oracle/11G/dbs/0hpua3nr_1_1
18      18      1   1   EXPIRED     DISK        /u01/oracle/11G/dbs/0ipua3o2_1_1
19      19      1   1   EXPIRED     DISK        /u01/oracle/11G/dbs/0jpua3u1_1_1
20      20      1   1   EXPIRED     DISK        /u01/oracle/11G/dbs/0kpua3u1_1_1
21      21      1   1   EXPIRED     DISK        /u01/oracle/11G/dbs/0lpua3u3_1_1
22      22      1   1   EXPIRED     DISK        /u01/oracle/11G/dbs/0npua47r_1_1
23      23      1   1   EXPIRED     DISK        /u01/oracle/11G/dbs/0mpua47r_1_1
24      24      1   1   EXPIRED     DISK        /u01/oracle/11G/dbs/0opua47v_1_1
25      25      1   1   EXPIRED     DISK        /u01/oracle/11G/dbs/0ppua4fs_1_1
26      26      1   1   EXPIRED     DISK        /u01/oracle/11G/dbs/0qpua4fu_1_1
27      27      1   1   EXPIRED     DISK        /u01/oracle/11G/dbs/0rpua4g1_1_1
28      28      1   1   EXPIRED     DISK        /u01/oracle/11G/dbs/0spua4g3_1_1
29      29      1   1   EXPIRED     DISK        /u01/oracle/11G/dbs/0tpua572_1_1
30      30      1   1   EXPIRED     DISK        /u01/oracle/11G/dbs/0upua7c3_1_1
31      31      1   1   EXPIRED     DISK        /u01/oracle/11G/dbs/0vpua7f7_1_1
deleted backup piece
backup piece handle=/u01/oracle/11G/dbs/0cpua34n_1_1 recid=12 stamp=870648983
deleted backup piece
backup piece handle=/u01/oracle/11G/dbs/0epua3na_1_1 recid=13 stamp=870649579
deleted backup piece
backup piece handle=/u01/oracle/11G/dbs/0dpua3na_1_1 recid=14 stamp=870649579
deleted backup piece
backup piece handle=/u01/oracle/11G/dbs/0fpua3ne_1_1 recid=15 stamp=870649583
deleted backup piece
backup piece handle=/u01/oracle/11G/dbs/0gpua3nr_1_1 recid=16 stamp=870649595
deleted backup piece
backup piece handle=/u01/oracle/11G/dbs/0hpua3nr_1_1 recid=17 stamp=870649595
deleted backup piece
backup piece handle=/u01/oracle/11G/dbs/0ipua3o2_1_1 recid=18 stamp=870649603
deleted backup piece
backup piece handle=/u01/oracle/11G/dbs/0jpua3u1_1_1 recid=19 stamp=870649794
deleted backup piece
backup piece handle=/u01/oracle/11G/dbs/0kpua3u1_1_1 recid=20 stamp=870649794
deleted backup piece
backup piece handle=/u01/oracle/11G/dbs/0lpua3u3_1_1 recid=21 stamp=870649795
deleted backup piece
backup piece handle=/u01/oracle/11G/dbs/0npua47r_1_1 recid=22 stamp=870650108
deleted backup piece
backup piece handle=/u01/oracle/11G/dbs/0mpua47r_1_1 recid=23 stamp=870650108
deleted backup piece
backup piece handle=/u01/oracle/11G/dbs/0opua47v_1_1 recid=24 stamp=870650112
deleted backup piece
backup piece handle=/u01/oracle/11G/dbs/0ppua4fs_1_1 recid=25 stamp=870650365
deleted backup piece
backup piece handle=/u01/oracle/11G/dbs/0qpua4fu_1_1 recid=26 stamp=870650367
deleted backup piece
backup piece handle=/u01/oracle/11G/dbs/0rpua4g1_1_1 recid=27 stamp=870650370
deleted backup piece
backup piece handle=/u01/oracle/11G/dbs/0spua4g3_1_1 recid=28 stamp=870650372
deleted backup piece
backup piece handle=/u01/oracle/11G/dbs/0tpua572_1_1 recid=29 stamp=870651106
deleted backup piece
backup piece handle=/u01/oracle/11G/dbs/0upua7c3_1_1 recid=30 stamp=870653315
deleted backup piece
backup piece handle=/u01/oracle/11G/dbs/0vpua7f7_1_1 recid=31 stamp=870653415
Deleted 20 EXPIRED objects


RMAN> crosscheck backupset of tablespace users;

using channel ORA_DISK_1

RMAN> 
再次演示:
RMAN> 

RMAN> 

RMAN> 

RMAN> backup tablespace users;

Starting backup at 03-FEB-15
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00004 name=/u01/oracle/oradata/db01/users01.dbf
channel ORA_DISK_1: starting piece 1 at 03-FEB-15
channel ORA_DISK_1: finished piece 1 at 03-FEB-15
piece handle=/u01/oracle/11G/dbs/10pua8b8_1_1 tag=TAG20150203T002512 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 03-FEB-15

RMAN> list backup of tablespace users;


List of Backup Sets
===================

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
32      Full    7.46M      DISK        00:00:01     03-FEB-15      
        BP Key: 32   Status: AVAILABLE  Compressed: NO  Tag: TAG20150203T002512
        Piece Name: /u01/oracle/11G/dbs/10pua8b8_1_1
  List of Datafiles in backup set 32
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  4       Full 1354709    03-FEB-15 /u01/oracle/oradata/db01/users01.dbf

RMAN> exit


Recovery Manager complete.
[oracle@Slave1Hadoop51 ~]$ ls -ltr /u01/oracle/11G/dbs/10pua8b8_1_1
ls: /u01/oracle/11G/dbs/10pua8b8_1_1: No such file or directory
[oracle@Slave1Hadoop51 ~]$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Tue Feb 3 00:26:17 2015

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

connected to target database: DB01 (DBID=1467107934)

RMAN> report need backup redundancy 1 tablespace users;

using target database control file instead of recovery catalog
Report of files with less than 1 redundant backups
File #bkps Name
---- ----- -----------------------------------------------------

RMAN> crosscheck backupset of tablespace users;

allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=126 devtype=DISK
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u01/oracle/11G/dbs/10pua8b8_1_1 recid=32 stamp=870654312
Crosschecked 1 objects


RMAN> report need backup redundancy 1 tablespace users;

Report of files with less than 1 redundant backups
File #bkps Name
---- ----- -----------------------------------------------------
4    0     /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
------- ---- -- ---------- ----------- ------------ ---------------
32      Full    7.46M      DISK        00:00:01     03-FEB-15      
        BP Key: 32   Status: EXPIRED  Compressed: NO  Tag: TAG20150203T002512
        Piece Name: /u01/oracle/11G/dbs/10pua8b8_1_1
  List of Datafiles in backup set 32
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  4       Full 1354709    03-FEB-15 /u01/oracle/oradata/db01/users01.dbf

RMAN> delete noprompt expired backup of  tablespace users;

using channel ORA_DISK_1

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


RMAN> list backup of tablespace users;


RMAN> 



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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

5icode.top

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值