Oracle Application Express

Deployment

Deploying Applications


You should review the Oracle Application Express Builder User's Guide, Deploying an Application documentation. The following sections cover additional considerations when deploying Oracle Application Express applications:

Environments

When developing with Oracle Application Express you should follow standard system development lifecycle practices in so far as having different environments for development, testing and production. Developers should only be allowed to make changes to applications and related database objects in the development environment. To further enforce this policy it is recommended that you install "Runtime Only" Application Express in the test and production environments. This will prohibit developers from accessing the Application Builder and SQL Workshop in these environments. Database Administrators (DBAs) should be the only ones with permission to update the test and production environments.

Database Objects

Often developers will need to create, modify / replace, or delete various database objects such as tables, packages, grants, etc. as part of a unit of work. Sometimes data will also need to be inserted, updated or deleted from one or more tables. Developers should create data definition language (DDL) and data manipulation language (DML) scripts as required so that any changes to database objects or data is reproducible. These scripts should be tested and checked into source control. Alternatively, developers can utilize Supporting Objects to define installation, upgrade and removal scripts. Supporting Objects is most valuable when developing applications that will be installed by third parties, such as the Packaged Applications. For other development activities having the DDL and DML scripts outside of specific applications, and not using Supporting Objects, provides more flexibility and control for the DBAs.

Creating a Build

Exporting an application from Application Express is very straightforward and produces a readable script file with a .SQL extension. This SQL script can be run in any Oracle Application Express environment which is the same release or higher of Application Express from where it was exported. For example, an application exported from Application Express 4.0 can be imported into an environment running Application Express 4.0, 4.1, or 4.2. However, an application exported from Application Express 4.2 cannot be imported into an environment running Application Express 4.1 or earlier. An application export includes the application definition, supporting objects, and shared components, including plug-ins. However, an export does not include images, CSS files, JavaScript files, etc. which must be managed independently.

Instead of exporting complete applications you can also choose to export specific components, such as a page. This also creates a SQL script file. There are limitations with importing components into a different environment from which it was exported. As a best practice, it is better to export complete applications rather than components.

If you wish to export an application and there are components, such as pages, that are not yet ready for testing then you can utilize "Build Options" to include or exclude various application components. Review Oracle Application Express Builder User's Guide, Using Build Options to Control Configuration to learn about the mechanics of using build options to customize an application export. The Application Express development team uses this capability extensively, especially when building Early Adopter releases where certain components may not be functionally complete.

Moving to Test / Production

Once developers have completed a suitable unit of work they should export the application(s) from the Application Builder and check them into a source control system. To make it easier to identify the unit of work it is often best to define a version by editing the Application Properties for the required application(s). Other required components such as images, CSS files, JavaScript files, etc., together with DDL and DML scripts should also be checked into source control. Developers should fill-out a build sheet, with all the required components and their locations in source control, so that the DBAs can build the release into the Test / QA environment. Once testing has been completed then the DBAs should be given a build sheet for the production environment.

Versioning / Application Backups

The Application Express installation includes two Java programs that enable you to perform either complete application exports or component exports. More details on these Java programs are available in the utilities / readme.txt file included within the installation. These programs are best utilized as part of a CRON job, or similar, that runs nightly and places the exports directly into a source control system. The exported files should be used as backups in case of a database corruption, etc. It is still best to manually export applications and check them into source control for deploying the applications.