24.12.2012 Views

Backing Up Oracle - Computing at Cornell

Backing Up Oracle - Computing at Cornell

Backing Up Oracle - Computing at Cornell

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

col handle for a30<br />

set echo off<br />

set verify off<br />

set feedback off<br />

set heading off<br />

set pagesize 0<br />

spool c:\oracle\admin\scripts\delete_backup.rman;<br />

select 'alloc<strong>at</strong>e channel for delete type ''SBT_TAPE'' ;' from dual;<br />

select 'change backuppiece '''||handle||''' delete;'<br />

from v$backup_piece where completion_time < SYSDATE - 3 and deleted = 'NO' ;<br />

select 'release channel;' from dual;<br />

spool off;<br />

exit;<br />

Figure 57. c:\oracle\admin\scripts\delete.sql<br />

11.4.2 Using tags to help with deletion<br />

Tags can be used to help autom<strong>at</strong>e the deletion of backups. In this example<br />

we are doing weekly backups on Sunday, and daily backups during the week.<br />

For the daily backups, we set the tag to be ‘Beach Daily’.<br />

run {<br />

}<br />

alloc<strong>at</strong>e channel t1 type 'sbt_tape' parms<br />

'ENV=( DSMO_AVG_SIZE=256)';<br />

alloc<strong>at</strong>e channel t2 type 'sbt_tape' parms<br />

'ENV=( DSMO_AVG_SIZE=256)';<br />

set maxcorrupt for d<strong>at</strong>afile 1 to 0 ;<br />

backup<br />

full<br />

filesperset 3<br />

form<strong>at</strong> '%d/%t/%s/%p'<br />

tag 'Beach Daily'<br />

(d<strong>at</strong>abase);<br />

release channel t1 ;<br />

release channel t2 ;<br />

186 <strong>Backing</strong> <strong>Up</strong> <strong>Oracle</strong> using Tivoli Storage Management

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!