How to take RMAN Backup using Shell Script

Create directory structure to keep rman backup

mkdir -p /oracle/stage/rman

Create RMAN backup script file

RMAN backup script to take  DB FULL backup

vi /home/oracle/


. /home/oracle/.bash_profile


export ORACLE_HOME=/u01/app/oracle/product/11.2.0

export DATE=$(date +%y-%m-%d_%H%M%S)

rman target / log=/home/oracle/prod_${DATE}.log << EOF



allocate channel ch1 device type disk format '/oracle/stage/rman/prod_full_bkp_%u';

allocate channel ch2 device type disk format '/oracle/stage/rman/prod_full_bkp_%u';

delete noprompt obsolete;

backup database;

backup archivelog all delete input;

release channel ch1;

release channel ch2;



Schedule Backup Under Crontab

Give execute permissions on the shell script

chmod 775 /home/oracle/

crontab -e

Schedule to run at 11 PM Daily

00,23 * * * /home/oracle/

If you like please follow and comment