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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

#!/bin/ksh<br />

# Initialize variables:<br />

target='target system/manager@paris'<br />

c<strong>at</strong>alog='c<strong>at</strong>alog rman/rman@rio'<br />

parms="parms 'ENV=(DSMO_NODE=sol_oracle,DSMO_AVG_SIZE=256,<br />

DSMI_ORC_CONFIG=/opt/tivoli/tsm/client/oracle/bin/dsm.opt,<br />

DSMI_LOG=/usr/local/oracle/log)'"<br />

obsolete_tape=/tmp/ob_tape.log # list of obsolete tape backups<br />

cmdfile=/tmp/delete.cmd # the gener<strong>at</strong>ed RMAN command script<br />

delete_log=/tmp/deleted.log # execution log from gener<strong>at</strong>ed script<br />

rm $obsolete_tape<br />

rm $cmdfile<br />

rm $delete_log<br />

# Get a list of obsolete tape files:<br />

rman msgno $target $c<strong>at</strong>alog msglog $obsolete_tape /dev/null<br />

report obsolete redundancy 3 until 'sysd<strong>at</strong>e-3' device type 'sbt_tape';<br />

exit;<br />

EOF<br />

# sed actions:<br />

del_bpiece="-e /RMAN-06285/ s/\(.* \)\(.*\)$/change backuppiece '\2' delete;/"<br />

# Cre<strong>at</strong>e the RMAN command file to delete the obsolete files:<br />

echo "alloc<strong>at</strong>e channel for delete type 'sbt_tape' $parms ;" >> $cmdfile<br />

grep RMAN-06285 $obsolete_tape | sed "$del_bpiece" >> $cmdfile<br />

echo "release channel;" >> $cmdfile<br />

# Execute the RMAN command file to delete the obsolete files:<br />

rman msgno $target $c<strong>at</strong>alog msglog $delete_log cmdfile $cmdfile<br />

exit<br />

7.4 List objects in the TSM d<strong>at</strong>abase<br />

To display objects in the TSM c<strong>at</strong>alog stored by TDP for <strong>Oracle</strong>, you can use<br />

standard SQL SELECT st<strong>at</strong>ements from the command line from an<br />

administr<strong>at</strong>ive client console.<br />

To help you find wh<strong>at</strong> inform<strong>at</strong>ion is available in the d<strong>at</strong>abase, TSM provides<br />

three system c<strong>at</strong>alog tables:<br />

SYSCAT.TABLES contains inform<strong>at</strong>ion about all tables th<strong>at</strong> can be<br />

queried.<br />

SYSCAT.COLUMNS describes the columns of each table.<br />

SYSCAT.ENUMTYPES defines the valid values for each enumer<strong>at</strong>ed type<br />

and the order of the values for each type.<br />

102 <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!