APEX Application Export: Supporting Objects and Static File Parity
0 reputation · 05 Jan 2022, 18:07 UTC
0 reputation · 05 Jan 2022, 18:07 UTC
Oracle APEX application exports provide the primary mechanism for migrating page definitions, shared components, and Supporting Objects scripts between environments. However, maintaining parity across workspace and schema boundaries involves several non-deterministic behaviors regarding object installation and asset capture.
Static Application Files are embedded as BLOBs within the export, which limits version control visibility. Furthermore, Static Workspace Files are not included in individual application exports, requiring separate workspace-level actions to ensure full environment synchronization.
The execution of Supporting Objects scripts during import depends on the "Install Supporting Objects" setting and the current state of the target schema. This can lead to inconsistent results if the target already contains partial objects. Additionally, metadata such as security group IDs and owner references are baked into the export, and major version upgrades may reset internal component identifiers.
What is the supported method for ensuring deterministic execution of Supporting Objects when the target schema contains existing objects? Which configuration or API flags reliably include Static Workspace Files to achieve full workspace parity? Does alias-based import prevent the reset of internal component identifiers during major version migrations?
34775 reputation · 06 Jan 2022, 05:37 UTC
Use the APEX_APPLICATION_INSTALL API (or the import wizard) with the flags p_install_supporting_objects => TRUE and p_overwrite_existing => TRUE before importing the application export. This forces the Supporting Objects script to run even when the target schema already contains those objects.
p_install_supporting_objects => TRUE and p_overwrite_existing => TRUE (or choosing “Install Supporting Objects = Yes” and “Overwrite Existing = Yes” in the wizard) is the documented way to force execution.APEX_EXPORT.WORKSPACE (or Utilities → Export → Workspace) and imported with the corresponding workspace import.When p_overwrite_existing => TRUE is set, the import process drops any existing Supporting Objects before recreating them, removing dependence on the pre‑existing schema state and making the import repeatable.
Workspace‑level files are treated as separate metadata; the application export mechanism has no option to include them without promoting them to Shared Components or recreating them as Static Application Files.
Alias‑based import only changes the logical identifier; the internal ID generation is tied to the APEX version’s metadata, so a major upgrade will still reset those IDs.
BEGIN
APEX_EXPORT.WORKSPACE(
p_workspace => 'YOUR_WORKSPACE',
p_file_name => 'workspace_export.sql');
END;
/BEGIN
APEX_APPLICATION_INSTALL.SET_APPLICATION_ID(p_application_id => NULL);
APEX_APPLICATION_INSTALL.SET_OFFSET(p_offset => 0);
APEX_APPLICATION_INSTALL.SET_SCHEMA(p_schema => 'TARGET_SCHEMA');
APEX_APPLICATION_INSTALL.SET_WORKSPACE(p_workspace => 'TARGET_WORKSPACE');
APEX_APPLICATION_INSTALL.SET_INSTALL_SUPPORTING_OBJECTS(p_install_supporting_objects => TRUE);
APEX_APPLICATION_INSTALL.SET_OVERWRITE_EXISTING(p_overwrite_existing => TRUE);
END;
/SELECT OBJECT_NAME, CREATED
FROM USER_OBJECTS
WHERE OBJECT_TYPE IN ('TABLE','VIEW','PROCEDURE','PACKAGE')
AND CREATED >= (SELECT TIMESTAMP FROM APEX_APPLICATION_INSTALL WHERE APPLICATION_ID = :app_id);
SELECT *
FROM APEX_APPLICATION_STATIC_FILES
WHERE WORKSPACE = 'TARGET_WORKSPACE'
AND FILE_NAME = 'expected_file_name';
If the existing Supporting Objects contain data or customizations that must be preserved, using p_overwrite_existing => TRUE will cause data loss. In that case, you need to back up those objects or adjust the script to avoid dropping them. Please confirm whether you need to retain any existing Supporting Objects data before proceeding.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.