A Setting-up a PL/SQL Gateway User

This section describes how to configure:
  • PL/SQL gateway user for APEX
  • PL/SQL gateway user to serve PL/SQL gateway requests directly

A.1 Configuring a PL/SQL Gateway User for APEX

This section explains how to configure the PL/SQL gateway user for APEX.

If you have installed ORDS and APEX, and the APEX PL/SQL gateway user needs to be configured, then perform the following:

  1. Repair ORDS.
  2. Verify if the configuration setting in the database pool is set correctly.
    ords --config <config path> config --db-pool <pool name> list

    Note:

    If you have only a single database pool (For example: Pool named default), then omit the --db-pool option.
    If the setting plsql.gateway.mode does not exist or is not set to proxied, then run the following command:
    ords --config <config path> config --db-pool <pool name> set plsql.gateway.mode
        proxied

A.2 Configuring a PL/SQL Gateway User to Serve PL/SQL Gateway Requests Directly

If you want the database pool to serve the PL/SQL gateway requests directly, then specify the options --gateway-user <database user> and --gateway-mode direct to configure the PL/SQL gateway user.

A.2.1 Installing/Upgrading the PL/SQL Gateway User

This section explains how to configure the PL/SQL gateway user while installing or upgrading ORDS.

To configure the PL/SQL gateway to install or upgrade ORDS, you can use one of the following ways:

  • Install/upgrade ORDS and configure PL/SQL gateway in interactive mode
  • Install/upgrade ORDS and configure PL/SQL gateway in non-interactive (silent) mode

Install/upgrade ORDS and configure PL/SQL gateway in interactive mode

To install using the interactive mode, use the interactive ords install -i command and specify the --gateway-user and --gateway-mode options.

ords --config <config path> install -i --gateway-user <database user> --gateway-mode direct
 
ords --config /path/to/config install -i --gateway-user EXAMPLE_USER1 --gateway-mode direct
This command prompts for the connection information and the password of the gateway user. The password of the gateway user must match with the existing password of the database user. The following options are displayed and enables you to make changes:
...
 
Oracle REST Data Services - Interactive Install
 
  Enter a number to select the database connection type to use
    [1] Basic (host name, port, service name)
    [2] TNS (TNS alias, TNS directory)
    [3] Custom database URL
  Choose [1]: 
  Enter the database host name [localhost]: 
  Enter the database listen port [1521]: 
  Enter the database service name [orcl]: pdb1
  Enter the PL/SQL Gateway database password for EXAMPLE_USER1: 
Confirm password: 
Connecting to database user: EXAMPLE_USER1 url: jdbc:oracle:thin:@//localhost:1521/pdb1
  Provide database user name with administrator privileges.
    Enter the administrator username: sys
  Enter the database password for SYS AS SYSDBA: 
 
Retrieving information.
ORDS is not installed in the database. ORDS installation is required.
 
  Enter a number to update the value or select option A to Accept and Continue
    [1] Connection Type: Basic
    [2] Basic Connection: HOST=localhost PORT=1521 SERVICE_NAME=pdb1
           Administrator User: SYS AS SYSDBA
    [3] Database password for ORDS runtime user (ORDS_PUBLIC_USER): <generate>
    [4] Database password for ORDS gateway user (EXAMPLE_USER1): *****
    [5] ORDS runtime user and schema tablespaces:  Default: SYSAUX Temporary TEMP
    [6] Configure and start ORDS in Standalone Mode: Yes
    [7]    Protocol: HTTP
    [8]       HTTP Port: 8080
    [9]   APEX static resources location: 
    [A] Accept and Continue - Create configuration and Install ORDS in the database
    [Q] Quit - Do not proceed. No changes
  Choose [A]:

Install/upgrade ORDS and configure PL/SQL gateway in non-interactive (silent) mode

To install using the non-interactive mode, use ords install command and specify --gateway-user and --gateway-mode options to configure the PL/SQL gateway user. Additional connection information options and the administrator user is required for the installation and configuration.

ords --config <path> install --db-pool <pool name> --admin-user <administrator user> 
--db-hostname <hostname> --db-port <port> --db-servicename <database servicename> 
--gateway-user <username> --gateway-mode direct --password-stdin < secret.txt
 
ords --config /path/to/config install --db-pool db1 --admin-user SYS  
--db-hostname localhost --db-port 1521 --db-servicename pdb1 --gateway-user EXAMPLE_USER1 
--gateway-mode direct --password-stdin < secret.txt

A.2.2 Configuring the PL/SQL Gateway User

You can configure the PL/SQL gateway using either of the following modes :
  • Running in interactive mode
  • Running in non-interactive (silent) mode

Running in Interactive Mode

To configure the PL/SQL gateway user, use the ords install -i --config-only interactive command, specifying --gateway-user and --gateway-mode options.

ords install -i --config-only --gateway-user <username> --gateway-mode direct

Running in Non-Interactive (Silent) Mode

To configure the PL/SQL gateway user, use the ords install --config-only silent command, specifying --gateway-user and --gateway-mode options.

ords --config <path> install --config-only --db-pool <pool name> --admin-user <administrator user> 
--db-hostname <hostname> --db-port <port> --db-servicename <database servicename> 
--gateway-user <username> --gateway-mode direct --password-stdin < secret.txt
 
For example:
ords --config /path/to/config install --config-only --db-pool db1 --admin-user SYS  --db-hostname localhost 
--db-port 1521 --db-servicename pdb1 --gateway-user EXAMPLE_USER1 --gateway-mode direct --password-stdin < secret.txt