Skip to content

rman backup script

RMAN Backup script :

Older backup will delete from previous folder

current backup will be moved to previous folder

Taking full database backup

Output will send to users by email


[orauat@dbs-XXX-xx ~]$ cat /u01/UAT/scripts/
ORACLE_HOME=/u01/UAT/db/tech_st/12c export ORACLE_HOME
cd /ebsbackup/UAT/previous
rm -rf UAT*
rm -rf db_hot_current*
cd /ebsbackup/UAT
mv UAT* /ebsbackup/UAT/previous
mv db_hot_current* /ebsbackup/UAT/previous

export log=/ebsbackup/log/bak-$(date +%Y-%m-%d).log
rman target sys/xxxxxxx cmdfile=/u01/UAT/scripts/DBbackup.rcv msglog=/ebsbackup/log/bak-$(date +%Y-%m-%d).log
mailx -s “UAT Backup log” — -f < $log


[orauat@dbs-xxx-xx ~]$ cat /u01/UAT/scripts/DBbackup.rcv
{ allocate channel d1 type disk;
backup format ‘/ebsbackup/UAT/UAT%U’ database plus archivelog delete input;
backup current controlfile format ‘/ebsbackup/UAT/db_hot_current_controlfile_%s_%p_%t’;
release channel d1;

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: