5.4 Plugging in a PDB When 21.2 Oracle APEX Is Installed in the Root Container
Learn about scenarios in which the target database has Oracle APEX installed into the root container, CDB$ROOT
- the default installation
option.
This section describes scenarios in which the target database has Oracle APEX installed into the root container, CDB$ROOT
- the default
installation option. Note there are multiple scenarios related to where the database
being plugged in originated from and how Oracle APEX was configured in the originating database.
- Scenario 1: Plug-in Non-CDB with Oracle APEX
Plug-in a Non-CDB with Oracle APEX. - Scenario 2: Plug-in PDB with a Common APEX from Another CDB
Plug-in a PDB with APEX from another CDB. - Scenario 3: Plug-in PDB with a Local Oracle APEX from Another CDB
Plug-in a PDB with a local Oracle APEX from another CDB. - Scenario 4: Plug-in Non-CDB or PDB with No Oracle APEX
Plug-in a Non-CDB or PDB if Oracle APEX is not installed. - Working with Incompatible Oracle APEX Versions
Learn how to work with the incompatible versions of Oracle APEX.
5.4.1 Scenario 1: Plug-in 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 first need to upgrade to a Oracle Database 12c non-CDB (or standalone database) or later and then plug the database into your CDB. Alternatively, if you have configured a non-CDB Oracle Database 12c or later , you may now want to plug this database into a CDB. In both cases, the originating database has 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, including APEX.
After installing Oracle APEX, you need to configure the Web listener for the PDB.
If the version of Oracle APEX installed in the originating database (which is now a PDB) is different from what is installed into the root container of the target, an error will be raised when trying to open the PDB.
5.4.2 Scenario 2: Plug-in PDB with a Common APEX from Another CDB
Plug-in a PDB with APEX from another CDB.
If you are copying or moving a PDB from an existing Oracle Database 12c or later where the originating CDB had APEX installed in the root container, you will not need to perform any additional steps, other than configuring the Web listener for the PDB.
This scenario assumes APEX release 21.1 is installed and the APEX_210200
schema within the
PDB being plugged in already has the metadata linked objects defined and will
compile without error against the metadata linked objects within the target CDB.
If the version of APEX installed in the originating database is different from what is installed in the root container of the target an error is raised when trying to open the PDB.
5.4.3 Scenario 3: Plug-in PDB with a Local Oracle APEX from Another CDB
Plug-in a PDB with a local Oracle APEX from another CDB.
If you are copying or moving a PDB from an existing Oracle Database 12c or later where APEX was not installed in the root container but is installed locally, then you need to perform additional steps before the PDB can be opened without errors.
This scenario assumes APEX release 21.2 is installed and the APEX_210200
schema within the
PDB being plugged in contains all of the APEX database objects and has no metadata linked objects. Therefore, you need to run
$ORACLE_HOME/rdbms/admin/apex_to_common.sql
to remove the
common objects and create the metadata links for the packages, views and so
forth.
To replace local objects with metadata links in the PDB:
-
Change your working directory to
$ORACLE_HOME/rdbms/admin
. -
Start SQL*Plus and connect to the database where APEX is installed as SYS specifying the SYSDBA role. For example:
-
On Windows:
SYSTEM_DRIVE:\ sqlplus /nolog SQL> CONNECT SYS as SYSDBA Enter password:
SYS_password
-
On UNIX and Linux:
$ sqlplus /nolog SQL> CONNECT SYS as SYSDBA Enter password: SYS_password
-
-
Set the container to the PDB to be configured:
ALTER SESSION SET CONTAINER = <
PDB_name
>; -
Run
apex_to_common.sql
. For example:@apex_to_common.sql
If the version of Oracle APEX installed in the originating database is different from what is installed in the root container of the target an error is raised when trying to open the PDB.
5.4.4 Scenario 4: Plug-in 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, and Oracle APEX is not installed in the originating database or PDB then a warning is raised in the alert log when opening the PDB in the target database.
In this scenario, the APEX schema, such as APEX_210200
for Oracle APEX release 21.2, will not be present in the originating database or the PDB being
plugged in. In order to open the PDB without issue and be able to run APEX within the new PDB, you must install APEX into the originating database or PDB before attempting to plug in to the target
database. You should install the same version of Oracle APEX into the originating database or PDB as the version installed into the target
database.
5.4.5 Working with Incompatible Oracle APEX Versions
Learn how to work with the incompatible versions of Oracle APEX.
If the version of Oracle APEX in the root container, CDB$ROOT
, is not the same as the Oracle APEX version in the PDB then an error is raised every time the PDB is opened preventing
normal database operations within the PDB. The PDB can only be opened in restricted mode
by users with RESTRICTED SESSION privilege, until the versions are compatible.
- Patching or Upgrading Oracle APEX in a CDB
Learn how to patch or upgrade Oracle APEX in the root container. - Patching or Upgrading Oracle APEX in a PDB
Learn how to patch or upgrade Oracle APEX in a PDB.
5.4.5.1 Patching or Upgrading Oracle APEX in a CDB
Learn how to patch or upgrade Oracle APEX in the root container.
If the version of Oracle APEX in the PDB is a later minor release version than the version of Oracle APEX in the root container (for example, the PDB contains Oracle APEX release 5.1.4 and the CDB contains Oracle APEX release 5.1.3) then you must patch the version of Oracle APEX in the root container to be able to open the PDB without error. If the major version of Oracle APEX in the PDB is higher than the version in the CDB (for example the PDB has Oracle APEX release 19.2 and the CDB has Oracle APEX release 18.1) then you must upgrade the version of Oracle APEX in the CDB to be able to open the PDB without error.
To patch Oracle APEX in the root container:
See Also:
Installing Oracle APEX into a CDBParent topic: Working with Incompatible Oracle APEX Versions
5.4.5.2 Patching or Upgrading Oracle APEX in a PDB
Learn how to patch or upgrade Oracle APEX in a PDB.
If the minor version of Oracle APEX in the PDB is lower than the version of Oracle APEX in the root container (for example the PDB has APEX release 4.2.0 and the CDB has APEX release 4.2.6) then it will be necessary to patch the version of APEX in the PDB. If the major version of Oracle APEX in the PDB is lower than the version in the root container (for example, the PDB has APEX release 4.2 and the CDB has APEX release 19.2) then the version of APEX in the PDB will need to be upgraded.
- Patching Oracle APEX in a PDB
Learn how to patch Oracle APEX in a PDB. - Upgrading Oracle APEX in a PDB
Learn how to upgrade Oracle APEX in a PDB.
Parent topic: Working with Incompatible Oracle APEX Versions
5.4.5.2.1 Patching Oracle APEX in a PDB
Learn how to patch Oracle APEX in a PDB.
To patch Oracle APEX in a PDB:
Parent topic: Patching or Upgrading Oracle APEX in a PDB
5.4.5.2.2 Upgrading Oracle APEX in a PDB
Learn how to upgrade Oracle APEX in a PDB.
To upgrade Oracle APEX in a PDB:
Parent topic: Patching or Upgrading Oracle APEX in a PDB