Exporting an Apex Application Via Command Line

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:

  • APEXExport.class
  • APEXExportSplitter.class

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:

/u01/app/oracle11g/product/11.2.0/db1

APEX_HOME should point to the directory where you unzipped the Apex download. For example

/u01/downloads/apex

PATH needs to include $ORACLE_HOME/jdk/bin

CLASSPATH needs to include:

  • $ORACLE_HOME/jdbc/lib/ojdbc5.jar
  • $APEX_HOME/utilities

Note: You may also have to include the . path.

APEXExport

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).

APEXExportSplitter

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.

One thought on “Exporting an Apex Application Via Command Line

  • August 23, 2011 at 6:38 am
    Permalink

    Excelente Muchas gracias!!!!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *