Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Monday, May 20, 2019

rman full back script

#!/bin/bash
#set -x
#####################################################################
# Script name   : rman_script.bash
# Verison       : 1.0
# Created By    : mmr
# Created Date  : 1st Feb 2018
# Modified By   :
# Modified Date :
# Description   : Script used for take rman backups
#####################################################################
. /u01/PRD/oracle/product/12.1.0.2/PRD_hostname.env

my_sid=$ORACLE_SID
date=`/bin/date +%d%B%Y%H%M`
localv="${my_sid}"_"FULLBKP_"`date +%d%b%Y`
rmanlog="RMAN_"FULL"_"${my_sid}"_"`date +%d%b%Y`".log"
mkdir -p /u01/PRD/backup/$localv

echo "" >> /u01/PRD/backup/$localv/rmanbackup_time.log
echo "" >> /u01/PRD/backup/$localv/rmanbackup_time.log
echo "RMAN Backup started  on `date`" >> /u01/PRD/backup/$localv/rmanbackup_time.log

export NLS_DATE_FORMAT='DD-MON-YYYY HH24:MI:SS'
rman log=/u01/PRD/backup/$localv/$rmanlog target / <<EOF
RUN
{
ALLOCATE CHANNEL ch00 TYPE DISK
ALLOCATE CHANNEL ch01 TYPE DISK;
ALLOCATE CHANNEL ch02 TYPE DISK;
ALLOCATE CHANNEL ch03 TYPE DISK;
ALLOCATE CHANNEL ch04 TYPE DISK;
ALLOCATE CHANNEL ch05 TYPE DISK;
ALLOCATE CHANNEL ch06 TYPE DISK;
ALLOCATE CHANNEL ch07 TYPE DISK;
ALLOCATE CHANNEL ch08 TYPE DISK;
ALLOCATE CHANNEL ch09 TYPE DISK;
BACKUP AS COMPRESSED BACKUPSET
TAG PRDu01_FULL_BKP
FILESPERSET 10
FORMAT '/u01/PRD/backup/$localv/%d_db_u%u_s%s_p%p_t%t_db'
DATABASE plus archivelog;
RELEASE CHANNEL ch00;
RELEASE CHANNEL ch01;
RELEASE CHANNEL ch02;
RELEASE CHANNEL ch03;
RELEASE CHANNEL ch04;
RELEASE CHANNEL ch05;
RELEASE CHANNEL ch06;
RELEASE CHANNEL ch07;
RELEASE CHANNEL ch08;
RELEASE CHANNEL ch09;
}
sql 'alter system archive log current';
run{
ALLOCATE CHANNEL ch00 TYPE DISK;
BACKUP FORMAT '/u01/PRD/backup/$localv/%d_db_u%u_s%s_p%p_t%t_db'  CURRENT CONTROLFILE;
RELEASE CHANNEL ch00;
}
EOF

echo "RMAN BACKUP  ends at `date`" >> /u01/PRD/backup/$localv/rmanbackup_time.log
echo -e "\n"
echo "RMAN logfile: /u01/PRD/backup/$localv/$rmanlog"
echo -e "\n"
echo "******* Exiting script sucessfully !!!! **************"
echo -e "\n"
exit 0;

No comments:

Post a Comment