Shell Script to Run RMAN Backup in Background with nohup

advertisements

_____________________________________________________________________________________________________________________

The Eucharistic Miracles of the World
Step 1. Prepare a RMAN command file

vi bkup.cmd
run
{
allocate channel ch1 device type disk;
allocate channel ch2 device type disk;
sql 'ALTER SYSTEM ARCHIVE LOG CURRENT';

configure retention policy to recovery window of 7 days;
CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET PARALLELISM 4;
CONFIGURE COMPRESSION ALGORITHM 'MEDIUM';

CROSSCHECK BACKUP DEVICE TYPE DISK;
CROSSCHECK ARCHIVELOG ALL;
delete noprompt archivelog all backed up 1 times to device type disk;
backup incremental level 0 as compressed backupset  database archivelog all   tag level0_weekly_ backup delete input;
DELETE NOPROMPT OBSOLETE;
DELETE NOPROMPT EXPIRED BACKUP;
release channel ch1;
release channel ch2;
}

Step 2. Create a shell script to invoke RMAN
vi bkup.ksh
#!/bin/ksh
export ORACLE_SID=ORCL1
export ORACLE_HOME=/u01/oracle/product/database/11.2.0/db_ORCL
export PATH=$PATH1:$ORACLE_HOME/bin
rman catalog rman/rmanPWD@rmancat target rmanbkup/RMANBKUP@mxcrm1e msglog /home/oracle/rman/rman_bkup.log cmdfile=/home/oracle/rman/bkup.cmd

Step 3. Invoke the script using nohup
          Change the permission of the shell script.
chmod 744 bkup.ksh
nohup ./bkup.ksh &

_____________________________________________________________________________________________________________________

Website Stats

0 comments:

Post a Comment

Labels

Oracle (629) Script (86) General (77) Unix (47) Blog (23) Technology (19) gadget (6) games (6) Business (3) OCI (3) SQL* Loader (3) Datapump (2)
 

acehints.com Copyright 2011-23 All Rights Reserved | Site Map | Contact | Disclaimer