Previous Next JavaScript must be enabled to correctly display this content

## 5.2 Installing APEX into an Application Container

Learn about the Application Container that stores data and metadata for Oracle APEX application back ends.

- About Application Containers
  An application container is a CDB component that stores data and metadata for application backends.
- Creating an Application Container
  To create a PDB within a CDB as an application container, you use the `AS APPLICATION CONTAINER` clause of the create PDB command.
- Installing or Upgrading APEX in an Application Container
- Verifying the Application Container Installation
  Verify the application container by inpsecting the log file for `ORA-` or `PLS-` errors and compiling invalid objects.
- Creating an Application Seed
  An application seed is used to provision application PDBs with the Oracle APEX application root's applications pre-installed.
- Creating an Application PDB from the Application Root Seed
  An application PDB is created by issuing the `CREATE PLUGGABLE DATABASE` statement from the application root.
- Configure HTTP Access to the Application PDB
  Configure a new application PDB for HTTP access.

Parent topic: Utilizing Multitenant Architecture

### 5.2.1 About Application Containers

An application container is a CDB component that stores data and metadata for application backends.

Oracle APEX can be installed into an application container using the `apxappcon.sql` script. An application container consists of an application root where the application is defined and one or more PDBs that share data and metadata about the application from the application root. You can have multiple application containers within a CDB and each container can have a different version of Oracle APEX.

Patching or upgrading Oracle APEX in an application container is simplified, because these actions are done against the application root. When an application PDB wishes to uptake the patch or upgraded version, it simply syncs with the application root. Oracle APEX continues to run in the application PDB at the existing version until the application PDB syncs with the application root.

Parent topic: Installing APEX into an Application Container

### 5.2.2 Creating an Application Container

To create a PDB within a CDB as an application container, you use the `AS APPLICATION CONTAINER` clause of the create PDB command.

To create Application Container:

1. Use the `AS APPLICATION CONTAINER` clause of the `CREATE PLUGGABLE DATABASE` statement to create an application container.
2. Open the application container.

   For Example:

       CREATE PLUGGABLE DATABASE apex_approot1 AS APPLICATION CONTAINER admin user admin IDENTIFIED
             BY <admin_password> FILE_NAME_CONVERT=('pdbseed','apex_approot1');
       ALTER PLUGGABLE DATABASE apex_approot1 open;

Note:

`apex_approot1` and the `admin user` in the previous example can be any valid ORACLE identifier.

Parent topic: Installing APEX into an Application Container

### 5.2.3 Installing or Upgrading APEX in an Application Container

To install or upgrade Oracle APEX in an Application Container:

1. Connect to Application Container.
2. Run `apxappcon.sql`.

   `apxappcon.sql` installs APEX as an application named `APEX` into the application root.

   The script takes the exact same first four arguments as the `apexins.sql script`, with the addition of a fifth parameter which is the password to use for the `APEX_PUBLIC_USER` password. In an upgrade installation, the fifth argument is ignored because the `APEX_PUBLIC_USER` database user will already exist.

   For example:

       ALTER SESSION SET CONTAINER = apex_approot1;

        @apxappcon.sql SYSAUX SYSAUX TEMP /i/ P@ssw0rd!

Parent topic: Installing APEX into an Application Container

### 5.2.4 Verifying the Application Container Installation

Verify the application container by inpsecting the log file for `ORA-` or `PLS-` errors and compiling invalid objects.

To verify the Application Container installation:

1. Manually inspect the installation log file for `ORA-` or `PLS-` errors.
2. Compile invalid objects by running the following command:

   For example:

       ALTER SESSION SET CONTAINER=apex_approot1;

       begin
           sys.dbms_utility.compile_schema( 'APEX_260100', false );
           sys.dbms_utility.compile_schema( 'FLOWS_FILES', false );
       end;
       /

3. Query `dba_applications` and `dba_app_errors`.

       SQL> select app_name, app_version, app_status from dba_applications where app_name = 'APEX';

       APP_NAME                       APP_VERSION                    APP_STATUS

       ------------------------------ ------------------------------ ------------

       APEX                           26.1                           NORMAL

       SQL> select app_name, app_statement, errornum, errormsg from dba_app_errors where app_name = 'APEX';

       no rows selected

Parent topic: Installing APEX into an Application Container

### 5.2.5 Creating an Application Seed

An application seed is used to provision application PDBs with the Oracle APEX application root's applications pre-installed.

To create an Application Seed:

1. Connect to `CDB$ROOT` as `sysdba`.
2. Alter session and set container to the application root.
3. Use the `AS SEED` clause of the `CREATE PLUGGABLE DATABASE` statement to create an application seed.
4. Sync the APEX application with the application seed.
5. Compile invalid objects.
6. Open the application seed in read only mode.

   For example:

       ALTER SESSION SET CONTAINER=apex_approot1;

       CREATE PLUGGABLE DATABASE as seed admin user admin identified by <admin_password> file_name_convert=('pdbseed','apex_approot1_seed');

       ALTER PLUGGABLE DATABASE apex_approot1$seed open;

       ALTER SESSION SET CONTAINER=apex_approot1$seed;

       ALTER PLUGGABLE DATABASE application APEX sync;

       begin
           sys.dbms_utility.compile_schema( 'APEX_260100', false );
           sys.dbms_utility.compile_schema( 'FLOWS_FILES', false );
       end;
       /

       ALTER PLUGGABLE DATABASE close immediate;

       ALTER PLUGGABLE DATABASE open read only;

   Note:

   `apex_approot1` and the `admin user` in the previous example can be any valid ORACLE identifier.

Parent topic: Installing APEX into an Application Container

### 5.2.6 Creating an Application PDB from the Application Root Seed

An application PDB is created by issuing the `CREATE PLUGGABLE DATABASE` statement from the application root.

The `PLUGGABLE DATABASE` is created from the application container seed so the APEX application is already installed and ready for configuration.

To create an Application PDB from the Application Root Seed:

1. Connect to `CDB$ROOT` as `sysdba`.
2. Alter session and set container to the application root.
3. Use the `CREATE PLUGGABLE DATABASE` command to create a PDB from the application seed.

   For example:

       ALTER SESSION SET CONTAINER=apex_approot1;

       CREATE PLUGGABLE DATABASE apex_pdb1 admin user admin identified by <admin password> file_name_convert=('apex_approot1_seed','apex_pdb1');

       ALTER PLUGGABLE DATABASE apex_pdb1 open;

       ALTER SESSION SET CONTAINER=apex_pdb1;

       SQL> select app_name, app_version, app_status from dba_applications where app_name = 'APEX';

       APP_NAME                       APP_VERSION                    APP_STATUS

       ------------------------------ ------------------------------ ------------

       APEX                           26.1                           NORMAL

   Note:

   `apex_approot1` and the `admin user` in the previous example can be any valid ORACLE identifier.

Parent topic: Installing APEX into an Application Container

### 5.2.7 Configure HTTP Access to the Application PDB

Configure a new application PDB for HTTP access.

Configure the new application PDB for HTTP access by following the instructions starting with the section Downloading and Installing Oracle REST Data Services.

See Also:

Setting Up ORDS in an Application Container

Parent topic: Installing APEX into an Application Container