Home » RDBMS Server » Backup & Recovery » Delete objects in RMAN
Delete objects in RMAN [message #73245] Mon, 08 March 2004 04:54 Go to next message
W.Boyer
Messages: 2
Registered: March 2004
Junior Member
Oracle 8i on Windows 2000.

The output of the REPORT OBSOLETE lists backupsets and backuppieces. Now I'm not a DBA..actually I'm a Tivoli Storage Manager specialist, but I need to implement backups using RMAN for a client. Aren't the pieces a part of the backupset? If I change/delete the backupset, does it also remove all the pieces, or do I need to change/delete each backuppiece and backupset individually? All this client will be doing is a daily full with hourly archivelog backups. If this was 9i I could just configure a retention policy and DELETE OBSOLETE;

 

Bill
Re: Delete objects in RMAN [message #73252 is a reply to message #73245] Tue, 09 March 2004 06:34 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
You need to generate the list of files to be deleted from catalog.
Make them unvavailable in RMAN
delete from OS!.
--
--- generate the file
--

spool bp_tobe_deleted.sql
select 'change backupset '||bs_key||' unavailable;' 
from rc_backup_set a, rc_database b 
where 	a.db_key=b.db_key and status = 'A' and 
	trunc(completion_time) < trunc(SYSDATE-4); --- based on your retenetion period
select 'resync catalog;' from dual;
spool off

--
--- a sample output from bp_tobe_deleted.sql
--
change backupset 92799 unavailable;
change backupset 92802 unavailable;
change backupset 92879 unavailable;
resync catalog;

--
--- make them unavailable in rman
--
rman << EOF
connect target /
connect rcvcat rmanprod/rmanprod@rcatdb
run {
@bp_tobe_deleted.sql
}
exit;
EOF

--
--- delete from the OS.
--- depending on YOUR SCRIPTING tool..use whatever u wnat...
--- idea is to delete the files that are created a certain "time" before   
find . -atime +3 -name "*.bak" -exec /bin/rm {} ;
Re: Delete objects in RMAN [message #73256 is a reply to message #73252] Tue, 09 March 2004 16:16 Go to previous message
W.Boyer
Messages: 2
Registered: March 2004
Junior Member
I'm using the Tivoli Oracle agent to backup the data. Device type sbt_tape. The sample rman1.sh script generates a list of obsolete objects (report obsolete until....) parses this, generates the change ... delete; commands. The question I had was can I safely just change/delete the backupset and all the backup pieces contained within will be deleted, too? Or do I need to change/delete each individual backup piece within the backupset and then delete the backupset.

Keeping in mind this is Oracle8i. Would be sooo much easier in 9i.

Bill
Previous Topic: Emergency! Help! Full rman backup restore problem
Next Topic: duplicate prod db w/RMAN
Goto Forum:
  


Current Time: Thu Mar 28 07:37:05 CDT 2024