5.3 Installing APEX into Different PDBs

You can install different versions of Oracle APEX into different PDBs.

If APEX is not installed in the container database, you can install a local APEX within each PDB as required. When APEX is installed locally there are no APEX metadata linked objects and all packages, views, and tables are created within the APEX_220200 schema, within each PDB where APEX is installed.

5.3.1 Uninstalling APEX from a CDB

Learn how to uninstall Oracle APEX from a CDB.

To uninstall APEX from a CDB:

Note:

 Installing or removing APEX from a CDB requires a local connection to the database.

This section describes removing APEX from a CDB. If you wish to remove APEX from the CDB that shipped with Oracle Database 12.1, you must use apxremov_con.sql from either $ORACLE_HOME/apex or from a 4.2.6 APEX distribution.

  1. Change to the apex directory in the location where you unzipped the distribution.
  2. 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
  3. Run apxremov.sql.

    For example:

    @apxremov.sql

    Note:

    If you run apexremov.sql after PDBs have been added to the CDB, then APEX uninstalls from all of the PDBs, as well as CDB$ROOT and PDB$SEED. Any applications defined in any of the PDBs will be removed.

5.3.2 Installing APEX Locally in a PDB

Learn how to install Oracle APEX locally in a PDB.

Once you have removed APEX from the container database by following the instructions in Uninstalling APEX from a CDB, you can install APEX locally in a PDB.

To install APEX locally in a PDB:

  1. Change the apex directory in the location where you unzipped the distribution.
  2. 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
  3. Set the container to the PDB you want to install APEX locally:
    ALTER SESSION SET CONTAINER = <PDB_name>;
  4. Select the appropriate installation option.

    Full development environment provides complete access to the App Builder environment to develop applications. A Runtime environment enables users to run applications that cannot be modified.

    Available installation options include:

    • Full development environment - Run apexins.sql passing the following four arguments in the order shown:

      @apexins.sql tablespace_apex tablespace_files tablespace_temp images

      Where:

      • tablespace_apex is the name of the tablespace for the APEX application user.
      • tablespace_files is the name of the tablespace for the APEX files user.
      • tablespace_temp is the name of the temporary tablespace or tablespace group.
      • images is the virtual directory for APEX images. To support future APEX upgrades, define the virtual image directory as /i/.

      For example:

      @apexins.sql SYSAUX SYSAUX TEMP /i/
    • Runtime environment - Run apxrtins.sql passing the following four arguments in the order shown:

      @apxrtins.sql tablespace_apex tablespace_files tablespace_temp images

      Where:

      • tablespace_apex is the name of the tablespace for the APEX application user.
      • tablespace_files is the name of the tablespace for the APEX files user.
      • tablespace_temp is the name of the temporary tablespace or tablespace group.
      • images is the virtual directory for APEX images. To support future APEX upgrades, define the virtual image directory as /i/.

      For example:

      @apxrtins.sql SYSAUX SYSAUX TEMP /i/
  5. Complete the appropriate steps in Installing and Configuring APEX and Oracle REST Data Services.

When APEX installs, it creates the following database accounts:

  • APEX_220200 - This account owns the APEX schema and metadata.
  • FLOWS_FILES - This account owns the APEX uploaded files.
  • APEX_PUBLIC_USER - This minimally privileged account is used for APEX configuration with Oracle REST Data Services or Oracle HTTP Server and mod_plsql.

If you configured RESTful Web services, then these additional accounts are created:

  • APEX_REST_PUBLIC_USER - The account used when invoking RESTful Services definitions stored in APEX.
  • APEX_LISTENER - The account used to query RESTful Services definitions stored in APEX.

5.3.3 Installing APEX into a CDB

To install Oracle APEX into a CDB:

Note:

Installing or removing APEX from a CDB requires a local connection to the database.

  1. Change your working directory to the apex directory in the location where you unzipped the distribution.
  2. Start SQL*Plus and connect to CDB$ROOT of 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
  3. Select the appropriate installation option.

    Full development environment provides complete access to the App Builder environment to develop applications. A Runtime environment enables users to run applications that cannot be modified.

    Available installation options include:

    • Full development environment. Run apexins.sql passing the following four arguments in the order shown:

      @apexins.sql tablespace_apex tablespace_files tablespace_temp images

      Where:

      • tablespace_apex is the name of the tablespace for the APEX application user.
      • tablespace_files is the name of the tablespace for the APEX files user.
      • tablespace_temp is the name of the temporary tablespace or tablespace group.
      • images is the virtual directory for APEX images. To support future APEX upgrades, define the virtual image directory as /i/.

      Example:

      @apexins.sql SYSAUX SYSAUX TEMP /i/
    • Runtime environment. Run apxrtins.sql passing the following arguments in the order shown:

      @apxrtins.sql tablespace_apex tablespace_files tablespace_temp images

      Where:

      • tablespace_apex is the name of the tablespace for the APEX application user.
      • tablespace_files is the name of the tablespace for the APEX files user.
      • tablespace_temp is the name of the temporary tablespace or tablespace group.
      • images is the virtual directory for APEX images. To support future APEX upgrades, define the virtual image directory as /i/.

      Example:

      @apxrtins.sql SYSAUX SYSAUX TEMP /i/
  4. Complete appropriate steps in Installing and Configuring APEX and Oracle REST Data Services.

When APEX installs, it creates the following database accounts:

  • APEX_220200 - This account owns the APEX schema and metadata.
  • FLOWS_FILES - This account owns the APEX uploaded files.
  • APEX_PUBLIC_USER - This minimally privileged account is used for APEX configuration with Oracle REST Data Services or Oracle HTTP Server and mod_plsql.

If you configured RESTful Web services, then these additional accounts are created:

  • APEX_REST_PUBLIC_USER - The account used when invoking RESTful Services definitions stored in APEX.
  • APEX_LISTENER - The account used to query RESTful Services definitions stored in APEX.