Monday, March 25, 2013

RMAN delete disk image copy

Objective: to delete disk image copy so as to reclaim some space.

It is a so simple command. I have been tried few backupset backup, but it is not reported as obsolete, because I "CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET PARALLELISM 1;"

1. before delete image copy

orarac2poc:DGLOGI:/u01/oradata/DG/FRA/DGS> ls -l datafile/
total 2182276
-rw-r----- 1 oracle asmadmin  629153792 Mar 25 15:45 o1_mf_sysaux_8o0043xc_.dbf
-rw-r----- 1 oracle asmadmin 1073750016 Mar 25 15:45 o1_mf_system_8o002zs2_.dbf
-rw-r----- 1 oracle asmadmin  524296192 Mar 25 15:45 o1_mf_undotbs1_8o00574r_.dbf
-rw-r----- 1 oracle asmadmin    5251072 Mar 25 15:46 o1_mf_users_8o0060og_.dbf
orarac2poc:DGLOGI:/u01/oradata/DG/FRA/DGS> df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      16220072  10954196   4428656  72% /
/dev/sda1               101086     21079     74788  22% /boot
tmpfs                  2097152    195784   1901368  10% /dev/shm
/dev/sdb1             36116556  32558140   1723796  95% /u01


RMAN> report obsolete;

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           159    25-MAR-13
  Backup Piece       159    25-MAR-13          /u01/oradata/DG/FRA/DGS/autobackup/2013_03_25/o1_mf_s_810991505_8o00rbw0_.bkp
Backup Set           160    25-MAR-13
  Backup Piece       160    25-MAR-13          /u01/oradata/DG/FRA/DGS/backupset/2013_03_25/o1_mf_nnndf_TAG20130325T155650_8o00t2th_.bkp

2. Now delete it.

RMAN> delete copy;
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=151 device type=DISK
specification does not match any control file copy in the repository
RMAN-08120: WARNING: archived log not deleted, not yet applied by standby
archived log file name=/u01/oradata/DG/FRA/DGS/archivelog/2013_03_25/o1_mf_1_1143_8nzjy92k_.arc thread=1 sequence=1143
List of Datafile Copies
=======================

Key     File S Completion Time Ckp SCN    Ckp Time
------- ---- - --------------- ---------- ---------------
26      1    A 25-MAR-13       12407337   25-MAR-13
        Name: /u01/oradata/DG/FRA/DGS/datafile/o1_mf_system_8o002zs2_.dbf
        Tag: TAG20130325T154431

27      2    A 25-MAR-13       12407337   25-MAR-13
        Name: /u01/oradata/DG/FRA/DGS/datafile/o1_mf_sysaux_8o0043xc_.dbf
        Tag: TAG20130325T154431

28      3    A 25-MAR-13       12407337   25-MAR-13
        Name: /u01/oradata/DG/FRA/DGS/datafile/o1_mf_undotbs1_8o00574r_.dbf
        Tag: TAG20130325T154431

29      4    A 25-MAR-13       12407337   25-MAR-13
        Name: /u01/oradata/DG/FRA/DGS/datafile/o1_mf_users_8o0060og_.dbf
        Tag: TAG20130325T154431

List of Archived Log Copies for database with db_unique_name DGS
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - ---------
1129    1    1136    A 25-MAR-13
        Name: /u01/oradata/DG/FRA/DGS/archivelog/2013_03_25/o1_mf_1_1136_8nzgzowt_.arc

1130    1    1137    A 25-MAR-13
        Name: /u01/oradata/DG/FRA/DGS/archivelog/2013_03_25/o1_mf_1_1137_8nzgzvpk_.arc

1131    1    1138    A 25-MAR-13
        Name: /u01/oradata/DG/FRA/DGS/archivelog/2013_03_25/o1_mf_1_1138_8nzhcxbb_.arc

1132    1    1139    A 25-MAR-13
        Name: /u01/oradata/DG/FRA/DGS/archivelog/2013_03_25/o1_mf_1_1139_8nzjrh6x_.arc

1133    1    1140    A 25-MAR-13
        Name: /u01/oradata/DG/FRA/DGS/archivelog/2013_03_25/o1_mf_1_1140_8nzjrljk_.arc

1134    1    1141    A 25-MAR-13
        Name: /u01/oradata/DG/FRA/DGS/archivelog/2013_03_25/o1_mf_1_1141_8nzjwn68_.arc

1135    1    1142    A 25-MAR-13
        Name: /u01/oradata/DG/FRA/DGS/archivelog/2013_03_25/o1_mf_1_1142_8nzjwnt8_.arc


Do you really want to delete the above objects (enter YES or NO)? yes
deleted datafile copy
datafile copy file name=/u01/oradata/DG/FRA/DGS/datafile/o1_mf_system_8o002zs2_.dbf RECID=26 STAMP=811007105
deleted datafile copy
datafile copy file name=/u01/oradata/DG/FRA/DGS/datafile/o1_mf_sysaux_8o0043xc_.dbf RECID=27 STAMP=811007134
deleted datafile copy
datafile copy file name=/u01/oradata/DG/FRA/DGS/datafile/o1_mf_undotbs1_8o00574r_.dbf RECID=28 STAMP=811007157
deleted datafile copy
datafile copy file name=/u01/oradata/DG/FRA/DGS/datafile/o1_mf_users_8o0060og_.dbf RECID=29 STAMP=811007168
deleted archived log
archived log file name=/u01/oradata/DG/FRA/DGS/archivelog/2013_03_25/o1_mf_1_1136_8nzgzowt_.arc RECID=1129 STAMP=810989558
deleted archived log
archived log file name=/u01/oradata/DG/FRA/DGS/archivelog/2013_03_25/o1_mf_1_1137_8nzgzvpk_.arc RECID=1130 STAMP=810989563
deleted archived log
archived log file name=/u01/oradata/DG/FRA/DGS/archivelog/2013_03_25/o1_mf_1_1138_8nzhcxbb_.arc RECID=1131 STAMP=810989949
deleted archived log
archived log file name=/u01/oradata/DG/FRA/DGS/archivelog/2013_03_25/o1_mf_1_1139_8nzjrh6x_.arc RECID=1132 STAMP=810991375
deleted archived log
archived log file name=/u01/oradata/DG/FRA/DGS/archivelog/2013_03_25/o1_mf_1_1140_8nzjrljk_.arc RECID=1133 STAMP=810991378
deleted archived log
archived log file name=/u01/oradata/DG/FRA/DGS/archivelog/2013_03_25/o1_mf_1_1141_8nzjwn68_.arc RECID=1134 STAMP=810991508
deleted archived log
archived log file name=/u01/oradata/DG/FRA/DGS/archivelog/2013_03_25/o1_mf_1_1142_8nzjwnt8_.arc RECID=1135 STAMP=810991508
Deleted 11 objects

3. Verification.

orarac2poc:DGLOGI:/u01/oradata/DG/FRA/DGS> ls -l datafile/
total 0
orarac2poc:DGLOGI:/u01/oradata/DG/FRA/DGS> df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      16220072  10954196   4428656  72% /
/dev/sda1               101086     21079     74788  22% /boot
tmpfs                  2097152    195784   1901368  10% /dev/shm
/dev/sdb1             36116556  30346860   3935076  89% /u01