Search This Blog

Showing posts with label HOW DO I Export an APEX Application Manually in ORACLE APEX. Show all posts
Showing posts with label HOW DO I Export an APEX Application Manually in ORACLE APEX. Show all posts

Sunday, July 13, 2025

HOW DO I Export an APEX Application Manually in ORACLE APEX

Exporting an Oracle APEX application manually is a straightforward and essential task for developers who want to create backups, move applications between environments, or share their work. Oracle APEX provides an easy-to-use interface that allows you to export the full application definition, including pages, components, and supporting objects, into a single SQL script file. This manual export process ensures you can safely preserve your application and deploy it elsewhere whenever needed. In this blog, we explain the step-by-step procedure for manually exporting your APEX application.How to Export an APEX Application Manually

  1. Log in to Oracle APEX
    Access your APEX workspace through the web interface using your credentials.

  2. Navigate to App Builder
    Click on the App Builder icon to list your applications.

  3. Select Your Application
    Click the application you want to export to open its management page.

  4. Open Export / Import Menu
    In the left sidebar, click Export / Import.

  5. Choose Export
    Select the Export option to start the export wizard.

  6. Set Export Options

    • File Format: Choose between SQL (default) or JSON format.

    • Include Supporting Objects: Enable this if your app uses custom tables, packages, or seed data you want to export along with the application.

    • Skip Application Export Date: Optional, to make the export file reusable without changing export timestamps.

  7. Export the Application
    Click Export to generate the SQL file. The browser will download the .sql file automatically.

  8. Save and Store Safely
    Keep the exported file in a secure location, ideally under version control.

Best Practices for Manual Export

  • Export regularly, especially before making major changes or upgrades.

  • Use descriptive file names that include application ID, version, and date.

  • Always include supporting objects unless you are sure they exist in the target environment.

  • Test importing the exported file in a development workspace to verify completeness.

  • Use version control systems like Git to track changes to exported files.

  • Document your export and import procedures for team consistency.

 Notes:

  1. Go to APEX App Builder and open your application.

  2. Navigate to Utilities > Export/Import > Export.

  3. Choose Export Application Definition.

  4. Select Export Supporting Objects (if applicable).

  5. Click Export, then download and store the .sql file securely.

 For scheduling backups via SQL, use:

BEGIN

    APEX_EXPORT.GET_APPLICATION (

        p_application_id => 100, 

        p_filename       => 'app_100_backup.sql'

    );

END;

This can be automated using Oracle Scheduler.

 Backing up the Entire APEX Workspace

Best Practice: Backup Everything, Not Just the App

While application backups include pages and logic, a full workspace backup includes:

  • Users & Authentication Settings

  • RESTful Web Services

  • Workspace-Level Configurations

How to Export an APEX Workspace

  1. Go to APEX Administration.

  2. Navigate to Manage Workspaces > Export Workspace.

  3. Select the workspace and click Export.

  4. Download the .sql file.

Backing up the Underlying Database

Best Practice: Full Database Backup

Since APEX apps rely on Oracle Database objects (tables, views, packages, etc.), always back up the APEX schema and associated database objects.

Methods to Backup the Database

  1. Using Oracle Data Pump (Preferred)

  2. expdp username/password@db schemas=APEX_SCHEMA dumpfile=apex_backup.dmp logfile=apex_backup.log

This method captures all APEX-related tables, PL/SQL, and configurations.

  1. Using RMAN (For Full Database Backup)

  2. RMAN> BACKUP DATABASE FORMAT '/backup/apex_full_%U.bak';

This ensures a full database recovery in case of failure.


Storing Backups Securely

Best Practice: Keep Backups in Multiple Locations

  • On-Premise Storage: Save local copies for quick restores.

  • Cloud Storage: Store backups on Oracle Cloud, AWS S3, or Google Drive.

  • Version Control (GitHub, GitLab, Bitbucket): Store exported .sql backups under version control.

Example backup folder structure:

/backups/

  ├── daily/

  │   ├── app_100_backup_20240310.sql

  │   ├── db_apex_schema_20240310.dmp

  ├── weekly/

  ├── monthly/



Enabling Flashback and Undo for Data Recovery

Best Practice: Use Oracle Flashback to Restore Data

Enable Flashback Query to retrieve previous states of tables without requiring a backup restore.

SELECT * FROM USCG_DATA AS OF TIMESTAMP (SYSTIMESTAMP - INTERVAL '1' DAY);

This can be a lifesaver for quick data recovery.


Testing Restores Regularly

Best Practice: Verify That Your Backups Work

  • Regularly import backups into a test APEX instance.

  • Validate that all pages, components, and database objects work correctly.

To restore an application:

  1. Go to App Builder > Import.

  2. Select the backup .sql file.

  3. Choose Install Application.

For database recovery:

impdp username/password@db schemas=APEX_SCHEMA dumpfile=apex_backup.dmp logfile=restore.log



 

Official Oracle APEX Documentation

Conclusion

Manually exporting your Oracle APEX application is a simple but critical step in application lifecycle management. This process ensures you have a reliable backup and a portable version of your app that can be shared or migrated to different environments. By following the step-by-step method and adhering to best practices such as regular exports, including supporting objects, and version control, you can safeguard your development efforts and maintain smooth deployment workflows.

How Do I Make a Faceted Search Map Page in Oracle APEX

Combining faceted search with a map region in Oracle APEX enables users to filter data visually and spatially at the same time. This design ...