Saturday , November 25 2017
Home / Oracle DBA / DELETE EXPIRE BACKUP

DELETE EXPIRE BACKUP

for  example we take any one datafile backup, after then we delete to the  that backup of datafile .

RMAN; backup datafile 4;

Starting backup at 03-JUL-17
using channel ORA_DISK_1
using channel ORA_DISK_2
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=/u01/app/oracle/cheysar/users01.dbf
channel ORA_DISK_1: starting piece 1 at 03-JUL-17
channel ORA_DISK_1: finished piece 1 at 03-JUL-17
piece handle=/u03/rmanbkp/0as8ehpc_1_1 tag=TAG20170703T173436 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 03-JUL-17

Starting Control File and SPFILE Autobackup at 03-JUL-17
piece handle=/u03/rmanbkp/c-1251988537-20170703-04 comment=NONE
Finished Control File and SPFILE Autobackup at 03-JUL-17

[root@ssss4 ~]# su – oracle
[oracle@ssss4 ~]$ cd /u03/rmanbkp/
[oracle@ssss4 rmanbkp]$ ls
09s89aog_1_1 0as8ehpc_1_1 0cs89apb_1_1 c-1251988537-20170703-04
0as89aog_1_1 0bs89apb_1_1 0ds89atl_1_1 c-2493892778-20170701-04
[oracle@ssss4 rmanbkp]$ rm*
-bash: rm*: command not found
[oracle@ssss4 rmanbkp]$ rm *
[oracle@ssss4 rmanbkp]$ ls
[oracle@ssss4 rmanbkp]$ ls
[oracle@ssss4 rmanbkp]$ cd

RMAN> list backup;

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

BS Key Type LV Size Device Type Elapsed Time Completion Time
——- —- — ———- ———– ———— —————
9 Full 1.30M DISK 00:00:00 03-JUL-17
BP Key: 9 Status: AVAILABLE Compressed: NO Tag: TAG20170703T173436
Piece Name: /u03/rmanbkp/0as8ehpc_1_1
List of Datafiles in backup set 9
File LV Type Ckp SCN Ckp Time Name
—- — —- ———- ——— —-
4 Full 876737 03-JUL-17 /u01/app/oracle/cheysar/users01.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time
——- —- — ———- ———– ———— ————- —
10 Full 9.36M DISK 00:00:01 03-JUL-17
BP Key: 10  Status: AVAILABLE Compressed: NO Tag: TAG20170703T173437
Piece Name: /u03/rmanbkp/c-1251988537-20170703-04
SPFILE Included: Modification time: 03-JUL-17
SPFILE db_unique_name: CHEYSAR
Control File Included: Ckp SCN: 876744 Ckp time: 03-JUL-17

NOTE : here  we are observe to the  STATUS IS AVAILABLE

RMAN>
RMAN> crosscheck backup;

using channel ORA_DISK_1
using channel ORA_DISK_2
crosschecked backup piece: found to be ‘EXPIRED’
backup piece handle=/u03/rmanbkp/0as8ehpc_1_1 RECID=9 STAMP=948389676
crosschecked backup piece: found to be ‘EXPIRED’
backup piece handle=/u03/rmanbkp/c-1251988537-20170703-04 RECID=10 STAMP=948389678
Crosschecked 2 objects

RMAN> list backup;

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

BS Key Type LV Size Device Type Elapsed Time Completion Time
——- —- — ———- ———– ———— —————
9 Full 1.30M DISK 00:00:00 03-JUL-17
BP Key: 9 Status: EXPIRED Compressed: NO Tag: TAG20170703T173436
Piece Name: /u03/rmanbkp/0as8ehpc_1_1
List of Datafiles in backup set 9
File LV Type Ckp SCN Ckp Time Name
—- — —- ———- ——— —-
4 Full 876737 03-JUL-17 /u01/app/oracle/cheysar/users01.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time
——- —- — ———- ———– ———— —————
10 Full 9.36M DISK 00:00:01 03-JUL-17
BP Key: 10 Status: EXPIRED Compressed: NO Tag: TAG20170703T173437
Piece Name: /u03/rmanbkp/c-1251988537-20170703-04
SPFILE Included: Modification time: 03-JUL-17
SPFILE db_unique_name: CHEYSAR
Control File Included: Ckp SCN: 876744 Ckp time: 03-JUL-17

NOTE : here we are observe to the STATUS IS EXPIRED ,

RMAN> delete expired backup;

using channel ORA_DISK_1
using channel ORA_DISK_2

List of Backup Pieces
BP Key BS Key Pc# Cp# Status Device Type Piece Name
——- ——- — — ———– ———– ———-
9 9 1 1 EXPIRED DISK /u03/rmanbkp/0as8ehpc_1_1
10 10 1 1 EXPIRED DISK /u03/rmanbkp/c-1251988537-20170703-04

Do you really want to delete the above objects (enter YES or NO)? yes
deleted backup piece
backup piece handle=/u03/rmanbkp/0as8ehpc_1_1 RECID=9 STAMP=948389676
deleted backup piece
backup piece handle=/u03/rmanbkp/c-1251988537-20170703-04 RECID=10 STAMP=948389678
Deleted 2 EXPIRED objects

RMAN> list backup;

specification does not match any backup in the repository

RMAN> backup database plus archivelog;

Starting backup at 03-JUL-17
current log archived
using channel ORA_DISK_1
using channel ORA_DISK_2
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=2 RECID=1 STAMP=948040227
input archived log thread=1 sequence=3 RECID=2 STAMP=948205903
input archived log thread=1 sequence=4 RECID=3 STAMP=948206730
channel ORA_DISK_1: starting piece 1 at 03-JUL-17
channel ORA_DISK_2: starting archived log backup set
channel ORA_DISK_2: specifying archived log(s) in backup set
input archived log thread=1 sequence=5 RECID=4 STAMP=948217583
input archived log thread=1 sequence=6 RECID=5 STAMP=948381165
channel ORA_DISK_2: starting piece 1 at 03-JUL-17

 

 

Comments

comments

Check Also

How to perform RMAN cloning (Easy process to clone a database on different server)

Cloning is a process of making a separate copy from one database to another. Cloning …

Leave a Reply

Your email address will not be published. Required fields are marked *