Setup APEX and ORDS

Important
The installation of APEX and ORDS with ansible-oracle is currently experimental.

1. Requirements

1.1. APEX

  • RDBMS 19c or newer

  • APEX 20.x or newer is mandatory for RDBMS 19c

  • Tested with APEX 23.2, 24.1 - may work with older versions as well

  • Installation is tested with PDB only.

  • CDB and nonCDB is not supported at the moment.

  • Download ZIP from Oracle with Playbook patch_download.yml supported for Version 22.1 or newer

  • APEX only with ORDS - no old APEX Listener

Important Notes:

  • Primary Note for Oracle APEX Upgrades (Doc ID 1088970.1)

Known Issues:

  • ADMIN password of INTERNAL Workspace is wrong after APEX upgrade Silent script to reset ADMIN password depends on APEX Release.
    There was no reliable solution found for the moment…​

1.2. ORDS

  • OracleLinux 8 or 9 only

  • Installation with ords.rpm from the Oracle Linux oracle/software repository on yum.oracle.com

  • Limited database configuration - see documentation

2. APEX Configuration

Important
Install APEX before ORDS - otherwise, the ORDS will not detect and configure APEX.
ORDS is only tested with existing APEX installation.

2.1. Mandatory variables

The following global variables are needed for an APEX installation.

Table 1. Mandatory variables
Value Description

oraapex_default_admin_password

The parameter is mandatory, because it is the only way to configure a password for the admin user at the moment.

Table 2. Optional variables
Value Description

oraapex_base

Default: {{ oracle_base }}/product
The unzip is done into {{ oraapex_base }}/apex_<APEX Version>

oraapex_default_tablespace

Default: SYSAUX
Could be set in each PDB.

oraapex_default_files_tablespace

Default: SYSAUX
Could be set in each PDB.

oraapex_default_temp_tablespace

Default: TEMP
Could be set in each PDB.

oraapex_image_path

Default: /i/
Image path for apxsilentins.sql.
Could be set in each PDB.

2.2. APEX in PDB

APEX can be installed in each PDB.

Table 3. mandatory Variables in oracle_pdbs
Value Description

state

Must be present.
APEX is only installed in PDBs with state: present.

apex_state

State for APEX installation.
Only present supported at the moment.

apex_version

Version of APEX.
Is used to download the Archive from Oracle.

Table 4. optional Variables in oracle_pdbs
Value Description

oraapex_tablespace

Custom APEX Tablespace.

oraapex_files_tablespace

Custom APEX Tablespace for files.

oraapex_temp_tablespace

Custom APEX temporary Tablespace.

oraapex_image_path

Custom image path for apxsilentins.sql.

apex_use_cdn

Default: true
Set the APEX IMAGE_PREFIX to the Oracle CDN https://static.oracle.com/cdn/apex/<APEX Version>/.
The images are not loaded from ORDS when the CDN is used.

apex_patchid

Patchid for PSE BUNDLE FOR APEX

Important
The example shows the minimum attributes for an APEX installation.
That’s not the minimum needed to create a PDB.
Example oracle_pdbs
oracle_pdbs:
  - cdb: CDB1
    pdb_name: PDB1
    state: present
    apex_state: present
    apex_version: 24.1
    apex_patchid: 36695709
Important
oraapex does not use the default passwords from ansible-oracle.
You have to define them in dbpasswords.

oraapex needs the passwords for APEX_PUBLIC_USER and APEX_REST_PUBLIC_USER.
The keys could be written in lower or upper case.
ords_public_user is not used by oraapex, but could be referenced in oraords_db_pools_password (see ORDS Configuration).

The password of APEX_LISTENER is generated with the password lookup into /tmp/passwordfile on the Ansible controller.

Example dbpasswords for APEX in a PDB
dbpasswords:
  CDB1:
    PDB1:
      apex_public_user: ords123
      apex_rest_public_user: ords123
      ords_public_user: ords123
Important
Do not forget to download the APEX Patch when apex_patchid is set in oracle_pdbs.
The patch is not applied with OPatch. oraapex copies the patch into the APEX software directory and executes catpatch.sql in the PDB.

oraapex expects the archive p<apex_patchid>_<apex_version without dots>0_Generic.zip in oracle_sw_source_local, e.g. p36695709_2410_Generic.zip for APEX 24.1.

Example oracle_sw_patches
oracle_sw_patches:
  - filename: p36695709_2410_Generic.zip
    patchid: 36695709
    version: 24.1
    description: PSE BUNDLE FOR APEX 24.1

2.3. Playbook execution

The installation of APEX is part of playbooks/manage_db.yml.
This allows the creation of custom Tablespaces, Profiles etc. for APEX, without the need to use a dedicated Playbook.

3. ORDS Configuration

Important
The configuration of ORDS is limited to the following variables at the moment.
Table 5. Mandatory variables in oraords_db_pools
Value Description

db_pool

Database Pool.
default is the default pool of ORDS, all other names are created with --db-pool.

service

Database Service Name

Table 6. Optional variables in oraords_db_pools
Value Description

host

Database Hostname
Default: {{ inventory_hostname }}

port

Listener Port
Default: oraords_default_port (1521)

admin_user

Admin user for the ORDS installation
Default: oraords_default_admin_user (sys)

feature_db_api

true / false (Default)

feature_rest_enabled_sql

true / false (Default)

feature_sdw

true / false (Default)

Table 7. Optional global variables for ORDS
Value Description

oraords_apex_image_path

Directory with the APEX images on the ORDS host (standalone.static.path).
The role fails, when <oraords_apex_image_path>/css/apex.css does not exist.
Not needed when APEX uses the CDN (apex_use_cdn).

oraords_apex_image_context

Context path for the APEX images (standalone.static.context.path)

oraords_java_rpm

Default: java-21-openjdk

oraords_ords_bin

Default: /opt/oracle/ords/bin

oraords_ords_config

Default: /etc/ords/config

oraords_ords_logs

Default: /etc/ords/logs

oraords_db_pools:
  - db_pool: default
    admin_user: sys
    service: pdb1
    port: 1521
    host: "{{ inventory_hostname }}"
    feature_db_api: true
    feature_rest_enabled_sql: true
    feature_sdw: true

The passwords for Admin- and ORDS-User are defined in oraords_db_pools_password.
They are set in a dedicated variable to prevent no_log=true in loops over oraords_db_pools.
Referencing dbpasswords helps to reduce redundancy for passwords.

oraords_db_pools_password:
  default:
    admin_password: "{{ dbpasswords['CDB1']['sys'] }}"
    ords_password: "{{ dbpasswords['CDB1']['PDB1']['ords_public_user'] }}"

3.1. Playbook execution

The Playbook playbooks/manage_ords.yml is used to install ORDS.

Note
ords install is executed for each pool and the ORDS service is reloaded on every execution of the Playbook.