Exporting an Apex Application Via Command LineJuly 15, 2011 at 2:43 pm | Posted in Oracle Developement | 1 Comment
You can quickly export Apex applications through the command line, avoiding the Apex UI completely. To do this, Oracle has provided two java classes, which are included in the Apex download:
These classes are located in the apex/utilities/oracle/apex directory.
Before using these classes, you have to make sure that the following environment variables are set up correctly:
ORACLE_HOME should point to just that. Something like:
APEX_HOME should point to the directory where you unzipped the Apex download. For example
PATH needs to include $ORACLE_HOME/jdk/bin
CLASSPATH needs to include:
Note: You may also have to include the . path.
To execute the export use
$ java oracle.apex.APEXExport <list of arguments>
You can get a list of the available arguments by executing the above command without arguments. For a basic application export use:
$ java oracle.apex.APEXExport -db localhost:1521:db1 -user scott -password tiger -applicationid 100
You’ll get a message saying: Exporting application 100.
Once the export is done you’ll see an *sql file in your current directory (e.g. f100.sql).
You can now take the export file and split it up into its various components. This is handy if, for example, you want to examine the SQL of an application page or two.
$ java oracle.apex.APEXExportSplitter f100.sql
This program creates a directory named after your application (e.g. f100) and multiple sub directories which contain the various components of the application.
Thanks to the Oracle Apex Community for the info.