TSM和Oracle rman备份的shell脚本 增量 全备 归档日志
归档日志
run {
allocate channel c1 type 'sbt_tape' parms
'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
allocate channel c2 type 'sbt_tape' parms
'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
crosscheck archivelog all;
backup archivelog all format 'arch_%U_%s.bak';
release channel c1;
release channel c2;
}
exit
exit
增量备份
su - oracle -c "date >> /oracle/rmanlog/bak0.log"
su - oracle -c "rman target sys/oracle cmdfile /oracle/rmanlog/oraaddbackup.scr >> /oracle/rmanlog/bak0.log"
run {
allocate channel c1 type 'sbt_tape' parms
'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
allocate channel c2 type 'sbt_tape' parms
'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
backup
incremental level 1
filesperset 5
format 'db_%t_%s_%p'
(database);
}
全备份
su - oracle -c "date >> /oracle/rmanlog/bak0.log"
su - oracle -c "rman target sys/oracle cmdfile /oracle/rmanlog/orafullbackup.scr >> /oracle/rmanlog/bak0.log"
run {
allocate channel c1 type 'sbt_tape' parms
'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
allocate channel c2 type 'sbt_tape' parms
'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
backup
incremental level 0
filesperset 5
format 'db_%t_%s_%p'
(database);
}