A few basic notes on Oracle Database Administration.

Thursday, July 31, 2008

Make it go away! (rman delete)

So much documentation tells you how to set up things for Oracle. It is harder to find information on how to get rid of it once you have it.

I am doing perfectly lovely incremental compressed backupsets of my database. Then one day, playing with EM, I in experimented with the 'Oracle recommended backup stategy'. I may have missed something in my set up, but I ended up with an un needed image copy backup of my database. Help! This thing is devouring my flashback area. So what is the proper way to remove it.

First step, of course, is to kill the Oracle job, so it doesn't do that again!

Then in rman:
RMAN> list copy;

gives me a nice long list - one line of which was:
List of Datafile Copies
Key File S Completion Time Ckp SCN Ckp Time Name

30428 4 A 29-JUL-08 224478 29-JUL-08 /bkup/flashbk/datafile/o1_mf_users_44y8x123_.dbf

I double check on the file system:
$> ls o1_mf_users_48y8x123_.dbf
o1_mf_users_44y8x123_.dbf
Yes, the copy is there.

To delete it in RMAN I enter
RMAN> delete datafilecopy 30428;

and get:


List of Datafile Copies
Key File S Completion Time Ckp SCN Ckp Time Name

30428 4 A 29-JUL-08 224478 29-JUL-08 /bkup/flashbk/datafile/o1_mf_users_44y8x123_.dbf


Do you really want to delete the above objects (enter YES or NO)? y
deleted datafile copy
datafile copy filename=/bkup/flashbk//datafile/o1_mf_users_44y8x123_.dbf recid=30428 stamp=1334123
Deleted 1 objects

I check in the file system and this time my ls returns
ls: 0653-341 The file
o1_mf_users_44y8x123_.dbf does not exist.

Good bye, nusance.

No comments: