Monday, September 24, 2018

ASR RMAN HIST

[oASR@ASRb004 rman_scripts]$ cat ASR_rman.sh

set -x

. ~/.bash_profile

export NLS_DATE_FORMAT='DD-MON-YYYY HH24:MI:SS'

LOG=/ASRB004_BACKUP/ASR/LOGS/rman`date +%d.%m.%Y_%T`.log

find /ASRB004_BACKUP/ASR/DB -mtime +1 -type f -exec rm {} \;

rman target / LOG = $LOG <<EOF

run {

#delete noprompt obsolete redundancy 3 device type disk;

#delete noprompt obsolete device type disk;

allocate channel c1 device type disk;

allocate channel c2 device type disk;

allocate channel c3 device type disk;

allocate channel c4 device type disk;

backup as COMPRESSED BACKUPSET

format '/ASRB004_BACKUP/ASR/DB/%d_%t_%s_%p'

tag 'ASR_full_backup' database;

SQL 'alter system archive log current';

crosscheck archivelog all;

backup AS COMPRESSED BACKUPSET archivelog all format '/ASRB004_BACKUP/ASR/DB/%d_Arch_Log%t_%s_%p';

backup

tag = cf1

format '/ASRB004_BACKUP/ASR/DB/%d_Control_file%t_%s_%p' current controlfile;

release channel c1;

release channel c2;

release channel c3;

release channel c4;

#allocate channel for maintenance type disk;

#delete obsolete noprompt device type disk;

}

EOF

CAP=`echo $ORACLE_SID|tr '[a-z]' '[A-Z]'`

#MAIL_ID="alert@.in,alert@.in"

MAIL_ID="alert@.in"

 

#if [ $? -eq 0 ];then

tail -30 $LOG | grep ^"RMAN-"

 

if [ $? -ne 0 ]

then

mail -s "Rman Backup Successful of $CAP on `date`" $MAIL_ID -- -f alert@.in< $LOG

else

mail -s "Rman Backup Unsuccessful of $CAP on `date`" $MAIL_ID -- -f alert@.in<$LOG

fi

 

No comments:

Post a Comment

[ERROR]: The value of s_patch_service_name is not set correctly in atleast one of the context files.

[ERROR]: The value of s_patch_service_name is not set correctly in atleast one of the context files. I got the issue below wh...