RMAN backup multiple retention [message #548358] |
Wed, 21 March 2012 09:41 |
|
Hi All,
First of all, allow me to introduce myself as I'm new in this forum and also new in RMAN scripting. My name is Raffaell, just call me Raff.
I need some advise in terms of designing the scripts for RMAN backup.
Currently we have 14 days retention policy for daily and weekly backup. but we will have 186days retention for monthly backup, that's mean its should be recoverable around that 3 month (for monthly).
My question is, What should I put the scripts for monthly backup ?
I saw some example its for offline backup:
BACKUP DATABASE UNTIL 'SYSDATE+365' NOLOGS;
But I want the backup should be online ?
Currently our weekly backup like this
#!/bin/bash
# SID= env | grep ORACLE_SID | cut -c12-15
export ORACLE_HOME=/oracle/BWD/112_64
export ORACLE_SID=BWD
LOGFILE=/tmp/BWD-weekly-`date +%y%m%d%H%M`.out
echo>> $LOGFILE
chmod 666 $LOGFILE
echo Script $0>> $LOGFILE
echo ==== started on `date` ====>> $LOGFILE
echo>> $LOGFILE
rman target / << !EOF >> $LOGFILE
allocate channel for maintenance type 'sbt_tape' parms
'ENV=(tdpo_optfile=/opt/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
crosscheck archivelog all;
release channel;
run
{
allocate channel t1 type 'sbt_tape' parms
'ENV=(tdpo_optfile=/opt/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
backup as compressed backupset
incremental level 0 cumulative
TAG SMQ_LEVEL0_WEEKLY_BACKUP
format 'weekly_%d_set%s_piece%p_%T_%U'
filesperset 5
database plus archivelog delete input;
sql 'alter system archive log current';
crosscheck backup;
release channel t1;
}
And Daily backup:
#!/bin/bash
SID=EPD
export ORACLE_HOME=/oracle/$SID/112_64
export ORACLE_SID=$SID
#LOGFILE=/tmp/EPD-weekly-`date +%y%m%d%H%M`.out
LOGFILE=/tmp/$SID-daily-`date +%y%m%d%H%M`.out
echo>> $LOGFILE
chmod 666 $LOGFILE
echo Script $0>> $LOGFILE
echo ==== started on `date` ====>> $LOGFILE
echo>> $LOGFILE
rman target / << !EOF >> $LOGFILE
allocate channel for maintenance type 'sbt_tape' parms
'ENV=(tdpo_optfile=/opt/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
crosscheck archivelog all;
release channel;
run
{
allocate channel t1 type 'sbt_tape' parms
'ENV=(tdpo_optfile=/opt/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
backup as compressed backupset
incremental level 1 cumulative
TAG EPD_LEVEL1_DAILY_BACKUP
format 'daily_%d_set%s_piece%p_%T_%U'
filesperset 5
database plus archivelog delete input;
sql 'alter system archive log current';
crosscheck backup;
release channel t1;
}
Appreciate if anyone has more experience to share with me the best aproach for this.
|
|
|
Re: RMAN backup multiple retention [message #548522 is a reply to message #548358] |
Thu, 22 March 2012 11:01 |
|
LKBrwn_DBA
Messages: 487 Registered: July 2003 Location: WPB, FL
|
Senior Member |
|
|
Just add "keep until" to one of your weekly backups:
# ... Etc ...
run
{
allocate channel t1 type 'sbt_tape' parms
'ENV=(tdpo_optfile=/opt/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
backup as compressed backupset
incremental level 0 cumulative
TAG SMQ_LEVEL0_WEEKLY_BACKUP
format 'weekly_%d_set%s_piece%p_%T_%U'
filesperset 5 keep until 'sysdate+365'
database plus archivelog delete input;
sql 'alter system archive log current';
crosscheck backup;
release channel t1;
}
[Updated on: Thu, 22 March 2012 12:37] by Moderator Report message to a moderator
|
|
|
|