We often have this requirement where in table FND_CONCURRENT_REQUESTS table requires frequent purging and due to constant purging of this table, sometimes information of a critical concurrent request also gets purged. To avoid this, a shell script was created to take dump backup of FND_CONCURRENT_REQUESTS tables.
This was scheduled prior to execution of program - Purge Concurrent Request and/or Manager Data
Please note that this will randomly create par file and store dump file with time stamp details for future references.
Please note that this will randomly create par file and store dump file with time stamp details for future references.
#!/bin/csh
#### *** ####
# Script : create_bkp_fnd_conc
# Desc. : Creating monthly backup of fnd_concurrent_requests
# Created : 03/1/2018 - created by Maaz Khan
#### *** ####
# Check if both arguments have been passed.
#if ($#argv != 1) then
# echo 'Error : Improper Usage'
# echo 'Usage : full_export_no_rows <sid> '
# exit(1)
#endif
source $HOME/.bash_profile
export LOGDIR=/home/nas_data/backups/dump/logs
export CYCDIR=/home/oraprod/maaz
#set pass_wd=`cat ~oracle/.passwd`
#set pass_wd=`cat ~oracle/.passwd_dev`
sqlplus "/as sysdba" <<EO_STR3
whenever sqlerror exit failure;
set echo off head off feed off
select 'DUMP_DIR='||DIRECTORY_PATH from dba_directories where directory_name='DUMP_DIR';
spool $LOGDIR/dump_dir.lst
/
spool off
spool $LOGDIR/log_dir.lst
select 'LOG_DIR='||DIRECTORY_PATH from dba_directories where directory_name='LOG_DIR';
spool off
EO_STR3
export EXP_LOGDIR=`grep LOG_DIR $LOGDIR/log_dir.lst | cut -d'=' -f2`
export DMPDIR=`grep DUMP_DIR $LOGDIR/dump_dir.lst | cut -d'=' -f2`
#if ( -r $LOGDIR/$1_full_export_no_rows_restart.log ) then
#set RESTART_STEP=`cat $LOGDIR/$1_full_export_no_rows_restart.log`
# echo ' '
# echo "RESTARTING FROM STEP $RESTART_STEP "
# goto $RESTART_STEP
#endif
# echo "step 001"
echo ' '
echo ' '
# /*************************************************************************
# * This code will create a par file dynamically for table export
# /*************************************************************************
echo 'Creating par file for table export of fnd_concurrent_Requests for ${ORACLE_SID} '`date`
echo userid=system/master10 > $CYCDIR/full_export_no_rows_$ORACLE_SID.par
echo dumpfile=full_export_no_rows_`date +%d%h%y%H_%M_%S`.dmp >> $CYCDIR/full_export_no_rows_$ORACLE_SID.par
echo logfile=full_export_no_rows_`date +%d%h%y%H_%M_%S`.log >> $CYCDIR/full_export_no_rows_$ORACLE_SID.par
echo directory=DUMP_DIR >> $CYCDIR/full_export_no_rows_$ORACLE_SID.par
echo tables='applsys.FND_CONCURRENT_REQUESTS' >> $CYCDIR/full_export_no_rows_$ORACLE_SID.par
echo compression=ALL >> $CYCDIR/full_export_no_rows_$ORACLE_SID.par
echo ' '
# Run export
echo `date`
echo -n "**** Export of table ****"
# Remove previous export dump and log files
#echo "Removing the previous export dump and log files"
#ls -lart $DMPDIR/full_export_no_rows*.dmp
#rm -f $DMPDIR/full_export_no_rows*.dmp
#ls -lart $DMPDIR/full_export_no_rows.log
#rm ${DMPDIR}/full_export_no_rows.log
echo `date`
echo "Starting the export"
echo ' '
expdp parfile=${CYCDIR}/full_export_no_rows_$ORACLE_SID.par
#########################################################################
No comments:
Post a Comment