8i | 9i | 10g | 11g | 12c | 13c | 18c | 19c | Misc | PL/SQL | SQL | RAC | WebLogic | Linux

Home » Articles » Misc » Here

APEXExport : Export APEX Applications and Workspaces From the Command Line

Transferring APEX applications and workspaces between environments is done using SQL scripts containing calls to the WWV_FLOW_API package. These can be checked into source control, and ultimately used as the source for deployments to other environments. Rather than manually exporting applications and workspaces, which risks accidentally picking incorrect options, you may decide to script the export using the APEXExport utility. This article describes how to use the APEXExport utility to export applications and workspaces.

Related articles.

Software

You will need the APEX software and a copy of the "ojdbc8.jar" file. You can download ojdbc8.jar, or copy it from an existing product such as SQL Developer.

Windows Example

Place the software into a directory of your choice. In this example we will use the "C:\temp" directory.

Unzip the APEX software.

cd c:\temp
unzip apex_19.1_en.zip

Set the environment variables to allow the APEXExport utility to function, and the settings to tell it how to connect to the relevant database to capture the application or workspace of interest.

set JAVA_HOME="C:\Program Files\Java\jdk1.8.0_211"
set APEX_BASE=C:\temp\apex
set CLASSPATH=.\ojdbc8.jar;%APEX_BASE%\utilities

set DB_HOST="ol7_19.localdomain"
set DB_PORT=1521
set DB_SERVICE=pdb1
set DB_USERNAME=MY_APEX_DB_USER
set DB_PASSWORD="MyPassword1"
set APEX_APP_ID=101
set WORKSPACE_ID=1480741738915267

Run the APEXExport utility to extract the SQL representation of the applications or workspace.

Rem Application

%JAVA_HOME%\bin\java oracle.apex.APEXExport ^
  -db %DB_HOST%:%DB_PORT%/%DB_SERVICE% ^
  -user %DB_USERNAME% ^
  -password %DB_PASSWORD% ^
  -applicationid %APEX_APP_ID% ^
  -expOriginalIds 

Rem All Apps in Workspace

%JAVA_HOME%\bin\java oracle.apex.APEXExport ^
  -db %DB_HOST%:%DB_PORT%/%DB_SERVICE% ^
  -user %DB_USERNAME% ^
  -password %DB_PASSWORD% ^
  -workspaceid %WORKSPACE_ID% ^
  -expOriginalIds 

Rem Workspace

%JAVA_HOME%\bin\java oracle.apex.APEXExport ^
  -db %DB_HOST%:%DB_PORT%/%DB_SERVICE% ^
  -user %DB_USERNAME% ^
  -password %DB_PASSWORD% ^
  -expWorkspace ^
  -expOriginalIds 

Linux Example

Place the software into a directory of your choice. In this example we will use the "/tmp" directory.

Unzip the APEX software.

cd /tmp
unzip apex_19.1_en.zip

Set the environment variables to allow the APEXExport utility to function, and the settings to tell it how to connect to the relevant database to capture the application or workspace of interest.

JAVA_HOME=/u01/java/latest
APEX_BASE=/tmp/apex
export CLASSPATH=./ojdbc8.jar:${APEX_BASE}/utilities

DB_HOST="ol7_19.localdomain"
DB_PORT=1521
DB_SERVICE=pdb1
DB_USERNAME=MY_APEX_DB_USER
DB_PASSWORD="MyPassword1"
APEX_APP_ID=101
WORKSPACE_ID=1480741738915267

Run the APEXExport utility to extract the SQL representation of the applications or workspace.

# Application

${JAVA_HOME}/bin/java oracle.apex.APEXExport \
  -db ${DB_HOST}:${DB_PORT}/${DB_SERVICE} \
  -user ${DB_USERNAME} \
  -password ${DB_PASSWORD} \
  -applicationid ${APEX_APP_ID} \
  -expOriginalIds 

# All Apps in Workspace

${JAVA_HOME}/bin/java oracle.apex.APEXExport \
  -db ${DB_HOST}:${DB_PORT}/${DB_SERVICE} \
  -user ${DB_USERNAME} \
  -password ${DB_PASSWORD} \
  -workspaceid ${WORKSPACE_ID} \
  -expOriginalIds 

# Workspace

${JAVA_HOME}/bin/java oracle.apex.APEXExport \
  -db ${DB_HOST}:${DB_PORT}/${DB_SERVICE} \
  -user ${DB_USERNAME} \
  -password ${DB_PASSWORD} \
  -expWorkspace \
  -expOriginalIds

Full Usage Information

The following usage is displayed when the APEXExport utility that ships with version 19.1 is called without parameters.

c:\temp>%JAVA_HOME%\bin\java oracle.apex.APEXExport
Usage java oracle.apex.APEXExport [option]...
Available options:
    -db:                   Database connect url in JDBC format
    -user:                 Database username
    -password:             Database password
    -applicationid:        ID for application to be exported
    -workspaceid:          Workspace ID for which all applications to be exported or the workspace to be exported
    -instance:             Export all applications
    -expWorkspace:         Export workspace identified by -workspaceid or all workspaces if -workspaceid not specified
    -expMinimal:           Only export workspace definition, users, and groups
    -expFiles:             Export all workspace files identified by -workspaceid
    -skipExportDate:       Exclude export date from application export files
    -expPubReports:        Export all user saved public interactive reports
    -expSavedReports:      Export all user saved interactive reports
    -expIRNotif:           Export all interactive report notifications
    -expTranslations:      Export the translation mappings and all text from the translation repository
    -expFeedback:          Export team development feedback for all workspaces or identified by -workspaceid to development or deployment
    -expTeamdevdata:       Export team development data for all workspaces or identified by -workspaceid
    -deploymentSystem:     Deployment system for exported feedback
    -expFeedbackSince:     Export team development feedback since date in the format YYYYMMDD
    -expOriginalIds:       If specified, the application export will emit ids as they were when the application was imported
    -expNoSubscriptions:   Do not export references to subscribed components
    -expComments:          Export developer comments
    -expSupportingObjects: Pass (Y)es, (N)o or (I)nstall to override the default
    -expACLAssignments:    Export ACL User Role Assignments.
    -debug:                Print debug output
    -nochecksum:           Overwrite existing files even if the contents have not changed
    -split:                Split applications into multiple files

    Application Example:
       APEXExport -db localhost:1521:ORCL -user scott -password scotts_password -applicationid 31500
    Workspace  Example:
       APEXExport -db localhost:1521:ORCL -user scott -password scotts_password -workspaceid 9999
    Instance Example:
       APEXExport -db localhost:1521:ORCL -user system -password systems_password -instance
    Export All Workspaces Example:
       APEXExport -db localhost:1521:ORCL -user system -password systems_password -expWorkspace
    Export Feedback to development environment:
       APEXExport -db localhost:1521:ORCL -user scott -password scotts_password -workspaceid 9999 -expFeedback
    Export Feedback to deployment environment EA2 since 20100308:
       APEXExport -db localhost:1521:ORCL -user scott -password scotts_password -workspaceid 9999 -expFeedback -deploymentSystem EA2 -expFeedbackSince 20100308

c:\temp>

For more information see:

Hope this helps. Regards Tim...

Back to the Top.