DOYENSYS Knowledge Portal




We Welcome you to visit our DOYENSYS KNOWLEDGE PORTAL : Doyensys Knowledge Portal




Thursday, June 26, 2014

Export APEX Application Backup Using Application ID from BACKEND

Shell Script :

#BASH
export APEX_UTIL_HOME=/u01/Soft/apex/utilities
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
export CLASSPATH=.:${ORACLE_HOME}/oui/jlib/classes12.jar
export JAVA_HOME=/usr/java/jdk1.7.0_60/jre
export PATH=/usr/java/jdk1.7.0_60/bin:$PATH
export BACKUP_LOC=/u02/${ORACLE_SID}/APEX/backups
export CURRDATE=`date '+%Y''%m''%d''%H''%M'`

if [[ ! -e $BACKUP_LOC ]]; then
    mkdir -p $BACKUP_LOC
elif [[ ! -d $dir ]]; then
    echo "$dir Checking Backup Directory OK " 1>&2
fi

echo ===========================================
echo Start APEX applications export at `date`
echo ===========================================
read -p "Enter your DB HOSTNAME : " name
echo "DBHOSTNAME $name"
read -p "Enter your DB SID : " SID
echo "DBSID $SID"
read -p "Enter your DB PORT : " PORT
echo "DBPORT $PORT"
read -p "Enter Application ID for Backup : " ID
cd ${APEX_UTIL_HOME}
USER="APEX_040200"
PASSWD="oracle"

echo ===========================================
echo "READY FOR BACKUP"
echo ===========================================
java oracle/apex/APEXExport -db $name:$PORT:$SID -user $USER -password $PASSWD -applicationid $ID
echo Compressing all .sql files to ${BACKUP_LOC}/${CURRDATE}.tar.gz
cd ${APEX_UTIL_HOME}
tar cvf - ./*.sql | gzip -c > ${BACKUP_LOC}/${CURRDATE}.tar.gz

# Remove all fxxx.sql files
rm -rf ${APEX_UTIL_HOME}/*.sql

echo End APEX applications export at `date`

# Save this file as EXP_APEX_APP_BACKUP.sh
========================================================================



Execution:
----------







1 comment:

Sridevi K said...

Regards
Sridevi Koduru (Senior Oracle Apps Trainer Oracleappstechnical.com)
LinkedIn profile - https://in.linkedin.com/in/sridevi-koduru-9b876a8b
Please Contact for One to One Online Training on Oracle Apps Technical, Financials, SCM, SQL, PL/SQL, D2K at training@oracleappstechnical.com | +91 - 9581017828.