Experience: is what you get soon after you need it.

Experience: is what you get soon after you need it.

Rasul Allah (sal Allahu alaihi wa sallam) said: "Restore the trusts of those who trust you, and deal not falsely with him who deals falsely with you." [Abu Dawud, Tirmidhi]

Search This Blog

Tuesday, August 11, 2015

rman report/delete obsolete

Rman report/delete obsolete:

 

[oracle@collabn1 sshaik]$ rman target / catalog rcuser/rcuser@prod1

Recovery Manager: Release 11.2.0.1.0 - Production on Wed Aug 5 14:37:37 2015

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ORCL (DBID=1414564590)
connected to recovery catalog database

RMAN> report obsolete;

new incarnation of database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
Report of obsolete backups and copies
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set           69     04-AUG-15       
 Backup Piece       72     04-AUG-15          +DATA2/orcl/backupset/2015_08_04/nnndf0_tag20150804t152113_0.282.886864875
Backup Set           70     04-AUG-15       
 Backup Piece       73     04-AUG-15          +DATA2/orcl/autobackup/2015_08_04/s_886864881.283.886864881
Backup Set           105    04-AUG-15       
 Backup Piece       109    04-AUG-15          /home/oracle/sshaik/backup/orcl-backup-05qdovfo_1_1.bak
Backup Set           140    04-AUG-15       
 Backup Piece       142    04-AUG-15          +DATA2/orcl/autobackup/2015_08_04/s_886865409.287.886865409
Backup Set           174    04-AUG-15       
 Backup Piece       177    04-AUG-15          +DATA2/orcl/autobackup/2015_08_04/s_886868088.263.886868089
Backup Set           232    05-AUG-15       
 Backup Piece       233    05-AUG-15          +DATA2/orcl/autobackup/2015_08_05/s_886923509.295.886923509
Backup Set           296    05-AUG-15       
 Backup Piece       298    05-AUG-15          +DATA2/orcl/autobackup/2015_08_05/s_886923900.298.886923901
Backup Set           376    05-AUG-15       
 Backup Piece       384    05-AUG-15          +DATA2/orcl/autobackup/2015_08_05/s_886948165.300.886948167

RMAN> delete obsolete;

RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=53 device type=DISK
Deleting the following obsolete backups and copies:
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set           69     04-AUG-15       
 Backup Piece       72     04-AUG-15          +DATA2/orcl/backupset/2015_08_04/nnndf0_tag20150804t152113_0.282.886864875
Backup Set           70     04-AUG-15       
 Backup Piece       73     04-AUG-15          +DATA2/orcl/autobackup/2015_08_04/s_886864881.283.886864881
Backup Set           105    04-AUG-15       
 Backup Piece       109    04-AUG-15          /home/oracle/sshaik/backup/orcl-backup-05qdovfo_1_1.bak
Backup Set           140    04-AUG-15       
 Backup Piece       142    04-AUG-15          +DATA2/orcl/autobackup/2015_08_04/s_886865409.287.886865409
Backup Set           174    04-AUG-15       
 Backup Piece       177    04-AUG-15          +DATA2/orcl/autobackup/2015_08_04/s_886868088.263.886868089
Backup Set           232    05-AUG-15       
 Backup Piece       233    05-AUG-15          +DATA2/orcl/autobackup/2015_08_05/s_886923509.295.886923509
Backup Set           296    05-AUG-15       
 Backup Piece       298    05-AUG-15          +DATA2/orcl/autobackup/2015_08_05/s_886923900.298.886923901
Backup Set           376    05-AUG-15       
 Backup Piece       384    05-AUG-15          +DATA2/orcl/autobackup/2015_08_05/s_886948165.300.886948167

Do you really want to delete the above objects (enter YES or NO)? yes
deleted backup piece
backup piece handle=+DATA2/orcl/backupset/2015_08_04/nnndf0_tag20150804t152113_0.282.886864875 RECID=1 STAMP=886864874
deleted backup piece
backup piece handle=+DATA2/orcl/autobackup/2015_08_04/s_886864881.283.886864881 RECID=2 STAMP=886864881
deleted backup piece
backup piece handle=+DATA2/orcl/autobackup/2015_08_04/s_886865409.287.886865409 RECID=6 STAMP=886865409
deleted backup piece
backup piece handle=+DATA2/orcl/autobackup/2015_08_04/s_886868088.263.886868089 RECID=7 STAMP=886868088
deleted backup piece
backup piece handle=+DATA2/orcl/autobackup/2015_08_05/s_886923509.295.886923509 RECID=7 STAMP=886923509
deleted backup piece
backup piece handle=+DATA2/orcl/autobackup/2015_08_05/s_886923900.298.886923901 RECID=12 STAMP=886923901
deleted backup piece
backup piece handle=+DATA2/orcl/autobackup/2015_08_05/s_886948165.300.886948167 RECID=13 STAMP=886948166
Deleted 7 objects

RMAN-06207: WARNING: 1 objects could not be deleted for DISK channel(s) due
RMAN-06208:          to mismatched status.  Use CROSSCHECK command to fix status
RMAN-06210: List of Mismatched objects
RMAN-06211: ==========================
RMAN-06212:   Object Type   Filename/Handle
RMAN-06213: --------------- ---------------------------------------------------
RMAN-06214: Backup Piece    /home/oracle/sshaik/backup/orcl-backup-05qdovfo_1_1.bak


RMAN> crosscheck backup;

using channel ORA_DISK_1
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/home/oracle/sshaik/backup/orcl-backup-04qdovfm_1_1.bak RECID=3 STAMP=886865398
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/home/oracle/sshaik/backup/orcl-backup-05qdovfo_1_1.bak RECID=4 STAMP=886865400
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/home/oracle/sshaik/backup/orcl-backup-06qdovg0_1_1.bak RECID=5 STAMP=886865408
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/home/oracle/sshaik/backup/orcl_backup_0bqdqojh_1_1.bak RECID=8 STAMP=886923889
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/home/oracle/sshaik/backup/orcl_backup_0cqdqoji_1_1.bak RECID=9 STAMP=886923890
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/home/oracle/sshaik/backup/orcl_backup_0dqdqojj_1_1.bak RECID=10 STAMP=886923891
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/home/oracle/sshaik/backup/orcl_backup_0eqdqojr_1_1.bak RECID=11 STAMP=886923899
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+DATA2/orcl/autobackup/2015_08_05/s_886948447.304.886948447 RECID=14 STAMP=886948447
Crosschecked 8 objects


RMAN> delete obsolete;

RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
using channel ORA_DISK_1
Deleting the following obsolete backups and copies:
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set           105    04-AUG-15       
 Backup Piece       109    04-AUG-15          /home/oracle/sshaik/backup/orcl-backup-05qdovfo_1_1.bak

Do you really want to delete the above objects (enter YES or NO)? yes
deleted backup piece
backup piece handle=/home/oracle/sshaik/backup/orcl-backup-05qdovfo_1_1.bak RECID=4 STAMP=886865400
Deleted 1 objects


RMAN>

No comments: