5.5 Plugging in a PDB When Oracle 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 Oracle APEX from a CDB."

In such cases, you can optionally install a Oracle APEX into each PDB independently. If Oracle 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 Oracle APEX was configured in the originating database.

5.5.1 Scenario 1: Plug-in a Non-CDB with Oracle APEX

Plug-in a Non-CDB with Oracle APEX.

If you are upgrading from a previous Oracle Database release then you need to upgrade to Oracle Database 12c or later non-CDB (or standalone database) and then plug the database into your CDB. Alternatively you may have configured a non-CDB Oracle Database 12c or later that you now want to plug into a CDB. In both cases, the originating database had Oracle APEX installed and was not formerly a PDB.

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 Oracle APEX has been removed from the root container, the script will not create any metadata links for any of the Oracle APEX objects. The script does not change the Oracle APEX installation from the originating database and no additional steps are needed other than configuring the Web listener depending on the type of Web listener you are using.

5.5.2 Scenario 2: Plug-in PDB with Common Oracle 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 12c where the originating CDB had Oracle 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 Oracle 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 Oracle APEX.

5.5.3 Scenario 3: Plug-in PDB with a Local Oracle 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 12c or later where the originating PDB had a local Oracle APEX installed (not in the CDB) then you do not need to perform any additional steps, other than configuring the Web listener in the PDB depending on the type of Web listener you are using.

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

5.5.4 Scenario 4: Plug-in a Non-CDB or PDB with No Oracle 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 Oracle APEX was not installed in the originating database or PDB then you do not need to perform any additional steps. There will be no Oracle APEX engine schema, such as APEX_210200, within the PDB, and the PDB can be started without error.