Home » RDBMS Server » Backup & Recovery » RMAN backup multiple retention (11G, Linux RHEL)
RMAN backup multiple retention [message #548358] Wed, 21 March 2012 09:41 Go to next message
qzplx
Messages: 2
Registered: March 2012
Location: UK
Junior Member

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 Go to previous messageGo to next message
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

Re: RMAN backup multiple retention [message #548528 is a reply to message #548522] Thu, 22 March 2012 12:16 Go to previous message
qzplx
Messages: 2
Registered: March 2012
Location: UK
Junior Member

Thanks LKBrwn_DBA for the guide
Previous Topic: database backup & recovery issue
Next Topic: Running Oracle Secure Backup using SAS interface on IBM autoloader model TS-2900
Goto Forum:
  


Current Time: Thu Oct 18 21:15:33 CDT 2018