5.5 Plugging in a PDB When APEX Is Not in the Root Container of the Target CDB

The scenarios in this section describe when Oracle APEX is not installed in the root container, CDB$ROOT, by explicitly removing it as described in "Uninstalling APEX from a CDB."

In such cases, you can optionally install a APEX into each PDB independently. If APEX is installed into a PDB it is considered to be installed locally and has no metadata linked objects. There are multiple scenarios related to where the database being plugged in originated from and how APEX was configured in the originating database.

5.5.1 Scenario 1: Plug-in a Non-CDB or PDB with Locally Installed APEX

Plug-in a Non-CDB or PDB with locally installed Oracle APEX.

As described in the Oracle Database Installation Guide for your operating system, when plugging in a standalone database you need to run the $ORACLE_HOME/rdbms/admin/noncdb_to_pdb.sql script. This script creates the necessary metadata linked objects (instead of local objects) and recompiles the database objects for all common database options. However, because APEX has been removed from the root container, the script will not create any metadata links for any of the APEX objects. The script does not change the APEX installation from the originating database and no additional steps are needed other than configuring the web server.

5.5.2 Scenario 2: Plug-in PDB with Common APEX from Another CDB

Plug-in a PDB with Oracle APEX from another CDB.

If you are copying or moving a PDB from an existing Oracle Database where the originating CDB had APEX installed in the root container, then an error is raised whenever you try to open the PDB. The error is due to the originating PDB included metadata links to objects in the originating root container which cannot be recompiled because the target root container does not include APEX. You will not be able to open the PDB unless you remove APEX from the PDB or if APEX is already installed in the target root container. Oracle does not support installing APEX in the root container if it contains PDBs with locally installed APEX.

5.5.3 Scenario 3: Plug-in PDB with a Local APEX from Another CDB

Plug-in a PDB with local Oracle APEX from another CDB.

If you are copying or moving a PDB from an existing Oracle Database where the originating PDB had a local APEX installed (not in the CDB) then you do not need to perform any additional steps, other than configuring the web server in the PDB.

This scenario assumes APEX release 24.1 is installed and the APEX_240100 schema within the PDB being plugged in, already has all of the APEX objects defined locally and no metadata links.

5.5.4 Scenario 4: Plug-in a Non-CDB or PDB with No APEX

Plug-in a Non-CDB or PDB if Oracle APEX is not installed.

If you are plugging in a non-CDB, or copying or moving a PDB from another CDB, where APEX was not installed in the originating database or PDB then you do not need to perform any additional steps. There will be no APEX engine schema, such as APEX_240100, within the PDB, and the PDB can be started without error.