My Blog

January 5, 2009

Using RMAN to delete the backups of database and archivelog

Filed under: Oracle — by enotebook @ 4:30 pm
Tags: ,

This is a simple test by using RMAN to delete the backups of database and archivelog.

RMAN> backup database tag ‘dbfull0812’;

Starting backup at 04-JAN-09
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=00001 name=/u01/app/oracle/oradata/orcl/system01.dbf
input datafile fno=00003 name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
.
.
.
input datafile fno=00004 name=/u01/app/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: starting piece 1 at 04-JAN-09
channel ORA_DISK_1: finished piece 1 at 04-JAN-09
piece handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/2009_01_04/o1_mf_nnndf_DBFULL0812_4p0cb35n_.bkp comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:03:36
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current controlfile in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 04-JAN-09
channel ORA_DISK_1: finished piece 1 at 04-JAN-09
piece handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/2009_01_04/o1_mf_ncsnf_DBFULL0812_4p0cjwr6_.bkp comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04
Finished backup at 04-JAN-09

RMAN> list backup of database;

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

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
——- —- — ———- ———– ———— —————
318     Full    1G         DISK        00:04:01     01-DEC-08
BP Key: 318   Status: AVAILABLE  Compressed: NO  Tag: DBFULL
Piece Name: /u01/app/orabackup/data/dbfull_a7k15m6q_327_1
List of Datafiles in backup set 318
File LV Type Ckp SCN    Ckp Time  Name
—- — —- ———- ——— —-
1       Full 51602730   01-DEC-08 /u01/app/oracle/oradata/orcl/system01.dbf
2       Full 51602730   01-DEC-08 /u01/app/oracle/oradata/orcl/undotbs01.dbf
.
.
.

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
——- —- — ———- ———– ———— —————
418     Full    1G         DISK        00:03:30     04-JAN-09
BP Key: 418   Status: AVAILABLE  Compressed: NO  Tag: DBFULL0812
Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/backupset/2009_01_04/o1_mf_nnndf_DBFULL0812_4p0cb35n_.bkp
List of Datafiles in backup set 418
File LV Type Ckp SCN    Ckp Time  Name
—- — —- ———- ——— —-
1       Full 53779751   29-DEC-08 /u01/app/oracle/oradata/orcl/system01.dbf
2       Full 53779751   29-DEC-08 /u01/app/oracle/oradata/orcl/undotbs01.dbf
.
.
.

RMAN> delete backup of database tag ‘dbfull0812’;

using channel ORA_DISK_1

List of Backup Pieces
BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
——- ——- — — ———– ———– ———-
418     418     1   1   AVAILABLE   DISK        /u01/app/oracle/flash_recovery_area/ORCL/backupset/2009_01_04/o1_mf_nnndf_DBFULL0812_4p0cb35n_.bkp

Do you really want to delete the above objects (enter YES or NO)? yes
deleted backup piece
backup piece handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/2009_01_04/o1_mf_nnndf_DBFULL0812_4p0cb35n_.bkp recid=418 stamp=675257411
Deleted 1 objects

RMAN> list backup of database;

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

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
——- —- — ———- ———– ———— —————
318     Full    1G         DISK        00:04:01     01-DEC-08
BP Key: 318   Status: AVAILABLE  Compressed: NO  Tag: DBFULL
Piece Name: /u01/app/orabackup/data/dbfull_a7k15m6q_327_1
List of Datafiles in backup set 318
File LV Type Ckp SCN    Ckp Time  Name
—- — —- ———- ——— —-
1       Full 51602730   01-DEC-08 /u01/app/oracle/oradata/orcl/system01.dbf
2       Full 51602730   01-DEC-08 /u01/app/oracle/oradata/orcl/undotbs01.dbf
.
.
.

RMAN> list backup;

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

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
——- —- — ———- ———– ———— —————
318     Full    1G         DISK        00:04:01     01-DEC-08
BP Key: 318   Status: AVAILABLE  Compressed: NO  Tag: DBFULL
Piece Name: /u01/app/orabackup/data/dbfull_a7k15m6q_327_1
List of Datafiles in backup set 318
File LV Type Ckp SCN    Ckp Time  Name
—- — —- ———- ——— —-
1       Full 51602730   01-DEC-08 /u01/app/oracle/oradata/orcl/system01.dbf
2       Full 51602730   01-DEC-08 /u01/app/oracle/oradata/orcl/undotbs01.dbf
.
.
.

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
——- —- — ———- ———– ———— —————
319     Full    4M         DISK        00:00:02     01-DEC-08
BP Key: 319   Status: AVAILABLE  Compressed: NO  Tag: DBFULL
Piece Name: /u01/app/orabackup/data/dbfull_a8k15meh_328_1
Controlfile Included: Ckp SCN: 51602878     Ckp time: 01-DEC-08
SPFILE Included: Modification time: 03-NOV-08

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
——- —- — ———- ———– ———— —————
320     Full    4M         DISK        00:00:00     01-DEC-08
BP Key: 320   Status: AVAILABLE  Compressed: NO  Tag: CTL
Piece Name: /u01/app/orabackup/data/ctl_329_1_672324058
Controlfile Included: Ckp SCN: 51602889     Ckp time: 01-DEC-08

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
——- —- — ———- ———– ———— —————
419     Full    4M         DISK        00:00:02     04-JAN-09
BP Key: 419   Status: AVAILABLE  Compressed: NO  Tag: DBFULL0812
Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/backupset/2009_01_04/o1_mf_ncsnf_DBFULL0812_4p0cjwr6_.bkp
Controlfile Included: Ckp SCN: 53780052     Ckp time: 29-DEC-08
SPFILE Included: Modification time: 04-JAN-09

RMAN> delete noprompt backup of archivelog;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01005: syntax error: found “;”: expecting one of: “all, from, high, like, logseq, low, scn, sequence, time, until”
RMAN-01007: at line 1 column 37 file: standard input

RMAN>

RMAN> delete noprompt backup of archivelog from logseq 3000;

using channel ORA_DISK_1

List of Backup Pieces
BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
——- ——- — — ———– ———– ———-
321     321     1   1   AVAILABLE   DISK        /u01/app/orabackup/data/arch_aak15mf4_330_1
323     323     1   1   AVAILABLE   DISK        /u01/app/orabackup/data/arch_ack15mfc_332_1
.
.
.
backup piece handle=/u01/app/orabackup/data/arch_aak15mf4_330_1 recid=321 stamp=672324069
deleted backup piece
backup piece handle=/u01/app/orabackup/data/arch_ack15mfc_332_1 recid=323 stamp=672324077
deleted backup piece
.
.
.
Deleted 59 objects

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: