Posts

Showing posts from October, 2010

EXPDP automation in shell scripts

This script is created for SUN Solaris (no change requried) and RHEL (a small change will be required). it will do 1. create dump file of full db only metadata. 2. create dump of some particular tables. 3. tar and zip that file 4. ftp the files in some other safe places 5. finally delete old dump files from both servers. ORACLE_BASE=/oracle/orabase; export ORACLE_BASE ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME ORACLE_SID=SHAONDB; export ORACLE_SID PATH=$ORACLE_HOME/bin:$PATH; export PATH CURR_MONTH=`date +"%b_%Y"|tr "[:lower:]" "[:upper:]"` CURR_DATE=`date +"%d_%b_%Y"|tr "[:lower:]" "[:upper:]"` ## 7days means 168 hour ### DAYAGO=`TZ=GMT+168 date +"%d_%b_%Y"|tr "[:lower:]" "[:upper:]"` ## in rhel it will be DAYAGO=`date -d '7 day ago' +"%d_%b_%Y"|tr "[:lower:]" "[:upper:]"` ## BASE_DIR="/backup/DUMP_ORACLE/DUMP_

RMAN Script Scheduling in Windows Server

First Create your scirpts in suppose D:\orascripts\rman location like below 1. rman_full_bkp_SHAONDB.bat the content of this file will be set ORACLE_HOME=D:\app\orabase\product\11.2.0\dbhome_1 set ORACLE_SID=DBSHAON %ORACLE_HOME%\bin\rman target / cmdfile='D:\orascripts\rman\rman_full_bkp.bat' log='D:\orascripts\rman\rman_archive_full_bkp_cronout.txt' 2. rman_full_bkp.bat run { backup database plus archivelog; delete obsolete; } exit Finally you just open windows task scheduler Control Panel-->All Control Panel Items-->Administrative Tools-->task scheduler create a new task where the action will be batchfile#1. That's it.