Monday, September 24, 2018

dialy asrfullbkp



DAILY
set trimspool on
set feedback off
set term off
set verify off
spool /orahome/shell_scripts/shell/PROD/LOGS/Daily_run.txt
rem start /orahome/shell_scripts/shell/PROD/cnt_requests.sql
start /orahome/shell_scripts/shell/PROD/cnt_req_users.sql
start /orahome/shell_scripts/shell/PROD/max_run_programs.sql
start /orahome/shell_scripts/shell/PROD/top_running_jobs.sql
#start /orahome/shell_scripts/shell/PROD/conc_req_error_rpt.sql
start /orahome/shell_scripts/shell/PROD/pend_dtl.sql &&1
exit


asrfullbkp
set -x
. ~/.bash_profile
export NLS_DATE_FORMAT='DD-MON-YYYY HH24:MI:SS'
LOG=/TJPSB004_BACKUP/ASR1213/LOGS/rman`date +%d.%m.%Y_%T`.log
#cd /backup/ASR1213/DB
find /TJPSB004_BACKUP/ASR1213/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 '/TJPSB004_BACKUP/ASR1213/DB/%d_%t_%s_%p'
      tag 'ASR_full_backup' database;
SQL 'alter system switch logfile';
SQL 'alter system checkpoint';
crosscheck archivelog all;
backup  AS COMPRESSED BACKUPSET archivelog all format '/TJPSB004_BACKUP/ASR1213/DB/%d_Arch_Log%t_%s_%p';
 backup
    tag = cf1
   format '/TJPSB004_BACKUP/ASR1213/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="dba@gmail.in"
MAIL_ID="dba@gmail.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 ebsalert@gmail.com< $LOG
else
mail -s "Rman Backup Unsuccessful of $CAP on `date`" $MAIL_ID -- -f ebsalert@gmail.com<$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...