DOYENSYS Knowledge Portal




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




Thursday, January 8, 2015

Script for Apex application Backup on Windows

                  This is the script for taking the apex application backup 

REM ***** START MODIFICATIONS ******

REM ***** Parameters ******
REM Oracle information
REM To find SID name: select * from v$instance;
set oracleSID=PROD
set oracleSystemPass=xxxxx
set oraclePort=1521
set oracleHost=DHI-APP01.domain1.xxxxx.com
REM Root directory where oracle\apex\*class files are stored
REM These is a sub directory from the extracted APEX install zip file
set apexExportJavaDir=C:\app\oracle\admin\apex_4.2.4_en\apex\utilities\utilities
REM File that contains names of applications and workspaces
set apexHtmlFileName=apex_info.html
REM Directory where backups will be stored
set backupLocation=C:\backup

REM ****** PATHS *********
REM Note: You may not need to explicitly define these as they may already be set in OS.
set ORACLE_HOME=C:\app\oracle\product\11.2.0\dbhome_1
set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_55\bin
set CLASSPATH=%CLASSPATH%;.\;%ORACLE_HOME%\jdbc\lib\ojdbc5.jar;%apexExportJavaDir%
set PATH=%PATH%;.\;C:\Program Files\Java\jdk1.7.0_55\bin

REM ***** END MODIFICATIONS ******

REM ****** Other *********
set startRunLocation=%CD%

REM ****** Directory Setup ******
REM Create temp bacpkup location
mkdir %backupLocation%

REM ****** APEX BACKUP *******
REM Go to backup location to run backups in
cd %backupLocation%

set CurrentDate=%date%

mkdir %CurrentDate%

cd %CurrentDate% 


REM Export all applications
java oracle.apex.APEXExport -db DHI-APP01.domain1.xxxxx.com:1521:PROD -user xxxxx -password xxxxx$5832 -instance


 REM Generate listing of Workspaces and Applications

sqlplus xxxxx/xxxxx$5832@PROD @%startRunLocation%\apex_backup_info.sql %apexHtmlFileName%

No comments: