Archive for November, 2013

Windows Batch Script for Datapump Backup

Following is the content Batch Script for taking datapump backup in Windows OS.


set mydate=%date:~-7,2%%date:~-10,2%%date:~-4,4%%time:~-11,2%%time:~-8,2%%time:~-5,2%%time:~-2,2% 
expdp system/system schemas=orbhrm directory=BACKUP_DIR dumpfile=orbhrm%mydate%.dmp logfile=orbhrm%mydate%.log exclude=TABLE:\"IN \(\'RCAPPDTL\'\)\" 

Thanks
A Rahim Khan

Advertisements

rman backup on disk script oracle database

Following is the content of offshore_rman.sh for taking rman level 0 backup on sever disk.


mkdir -p /software/rmantemp/offshore_`date +%d-%m-%y`
chmod g+w /software/rmantemp/offshore_`date +%d-%m-%y`

export ORACLE_HOME=/oracle/app/product/11.2.0/db_1
export ORACLE_SID=offshore

$ORACLE_HOME/bin/rman target / <<!

CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/software/rmantemp/offshore_`date +%d-%m-%y`/OFFSHORE_DB_CTL_%F'; 
RUN { 
SQL 'ALTER SYSTEM SWITCH LOGFILE'; 
BACKUP INCREMENTAL LEVEL 0 DATABASE FORMAT '/software/rmantemp/offshore_`date +%d-%m-%y`/OFFSHORE_DB_DATAFILE_%u_%s_%p.DBF' TAG 'DATAFILE_BACKUP'; 
BACKUP ARCHIVELOG ALL FORMAT '/software/rmantemp/offshore_`date +%d-%m-%y`/OFFSHORE_DB_ARCHIVELOG_%u_%s_%p.DBF' TAG 'ARCHIVELOG_BACKUP'; 
DELETE NOPROMPT ARCHIVELOG UNTIL TIME 'SYSDATE -5'; 
} 
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK CLEAR;


Thanks
A Rahim Khan