6.4 Configuring Oracle REST Data Services

Configuring Oracle REST Data Services requires that you copy the images directory, if you are using an older release validate the Oracle REST Data Services installation, configure static files support, and secure Oracle REST Data Services.

Note:

Oracle APEX requires PL/SQL Gateway access to ORDS. Before following the topics in this section, see Configuring PL/SQL Gateway Mode in ORDS Configuration.

6.4.1 Configuring PL/SQL Gateway Mode in ORDS Configuration

Configure ORDS to execute APEX code.

ORDS needs to be configured to execute APEX code. PL/SQL gateway mode should be configured as proxied as indicated below

To configure ORDS to execute APEX code:

  1. Validate if the configuration is set by running the following command:
    ords config get plsql.gateway.enabled

    It should return:

    proxied

  2. If configuration is not set run, run the following command:
    ords config set plsql.gateway.mode    proxied

    If the pool is different than the default pool, or you need to specify the configuration, you can also run the following command:

    ords --config <config path> config --db-pool <pool name> set plsql.gateway.mode
        proxied

See Also:

Setting-up a PL/SQL Gateway User in Oracle REST Data Services Installation and Configuration Guide

6.4.2 Managing Static Resources (Images)

Manage images and static resources used by an Oracle APEX installation.

The images and static resources used by an Oracle APEX installation can either be stored on the local file system accessible by Oracle REST Data Services, or referenced to the Oracle APEX static resources Content Delivery Network (CDN).

6.4.2.1 Copying the Images Directory

Store images and static resources used by an Oracle APEX installation on a local filesystem accessible by Oracle REST Data Services.

Note:

Skip this step if you choose to use the Oracle APEX static resources CDN as described in Using a Static Resources CDN.

Perform this task whether you are loading a new installation or upgrading from a previous version. To host the images and static resources on a local file system, you must copy the images directory from the top level of the apex\images directory, for example C:\TEMP, to the location used by your Oracle REST Data Services installation.

During an upgrade, you overwrite your existing images directory. Before you begin the upgrade, to ensure that you can revert to the previous version, Oracle recommends that you create a copy of your existing images directory for APEX, indicating the release number of the images (for example, images_24_2).

6.4.2.2 Using a Static Resources CDN

Reference images and static resources used by an Oracle APEX instance by referencing a static resources Content Delivery Network (CDN).

Using the CDN may improve performance of APEX and your applications by distributing the static resources from a server that is physically located near the end user. Enabling the CDN for your APEX instance is a one-time configuration step. The CDN reference is automatically updated during patches and upgrades to point to the appropriate CDN for that version.

To use the APEX static resources CDN, connect to the database as a user with the APEX_ADMINISTRATOR_ROLE role and run the following code:

begin
    for c1 in (select version_no from APEX_RELEASE)
    loop
        APEX_INSTANCE_ADMIN.set_parameter(
            p_parameter => 'IMAGE_PREFIX',
            p_value => 'https://static.oracle.com/cdn/apex/' ||
                            c1.version_no || '/');
    end loop;

    commit;
end;

6.4.3 Validating the Oracle REST Data Services Installation

In a new installation or upgrade of Oracle APEX and if you are using Oracle REST Data Services 21.2.1 or older, you must validate the Oracle REST Data Services installation.

For validating the Oracle REST Data Services installation in a new installation or upgrade of Oracle APEX, run the following command:

ords validate [--database <dbname>]

See Also:

Repairing the Oracle REST Data Services Installation in Oracle REST Data Services Installation and Configuration Guide

6.4.4 Configuring Static File Support

For configuring static files, you must run apex_rest_config.sql after a new installation of Oracle APEX.

Oracle APEX enables application developers to include static files with their applications. Static files can be associated with a workspace, an application, a plug-in, or an application theme. When using Oracle REST Data Services as your web server, static files are served using RESTful service module built into Oracle APEX. Therefore, you must run apex_rest_config.sql after a new installation of Oracle APEX.

6.4.5 Securing Oracle REST Data Service

In a configuration for Oracle APEX, Oracle recommends setting the parameter security.requestValidationFunction to ords_util.authorize_plsql_gateway.

Setting parameter security.requestValidationFunction to ords_util.authorize_plsql_gateway activates the allowed list of callable procedures which ships with Oracle APEX and prohibits calls to other procedures.

See Also:

Procedure Allow List in Oracle REST Data Services Developer's Guide