ORDS Tomcat Install (22.2+)

Assumptions


NOTE: These instructions were tested in an environment with Tomcat installed on a dedicated application server and an Oracle database installed on a dedicated database server.
NOTE: These instructions use a silent installation method. See the Oracle documentation if you wish to use the "advanced" interactive installation method.
NOTE: The examples in these instructions assume you are installing ORDS for use with APEX. Links are provided in case you wish to enable optional features.

Pre-Requisites

Not required for "Standalone" installation.Use Tomcat 8.5.x through 9.0.x. ORDS cannot run on Tomcat 10.
Tomcat 8.5 needs Java 7 or later. Tomcat 9 needs Java 8 or later. ORDS needs Java 11 or 17.
These instructions assume APEX is already installed in your target database.
For the Embedded PL/SQL gateway it is recommended that the HTTP Port is set to 0. However, as long as the port is not the same as the port used by Apache Tomcat then it can, technically, run alongside Tomcat.
  • V1032368.zip (22.3..3.311.1929)

On the target database instances...

For users returned by the following query, make sure the account is unlocked and you know the passwords

SELECT username,

       account_status

  FROM dba_users

 WHERE username IN ('SYS','APEX_LISTENER','APEX_PUBLIC_USER','APEX_REST_PUBLIC_USER','ORDS_PUBLIC_USER')

/

Install

Unzip

On Tomcat server...


mkdir /tomcat/ords

unzip /tomcat/ords*.zip -d /tomcat/ords

mkdir -p /tomcat/conf/ords/logs



NOTE: These steps assume you have downloaded the ORDS installation zip file to /tomcatNOTE: The steps below should be performed as 'root'.NOTE: If you have attempted to install ORDS before then you should clear down /tomcat/conf (rm -rf /tomcat/conf) to avoid issues...

echo -e 'export PATH="$PATH:/tomcat/ords/bin"' >> ~/.bash_profile

Multi-Tenant

If you are installing to a single-tenant architecure or to a CDB, ignore this step. If you are installing to a PDB you can create a user (e.g. ORDS_OWNER) to use for ORDS installation. After creating this user you need to run a script to grant the correct privileges. The script can be found here (copy it to your db server if necessary):

/tomcat/ords/installer/ords_installer_privileges.sql

Silent Install

On Tomcat server...

export ORDS_HOME=/tomcat/ords

export ORDS_CONFIG=/tomcat/conf/ords

export ORDS_LOGS=${ORDS_CONFIG}/logs

export DB_HOSTNAME=mydbhost

export DB_PORT=1521

export DB_SERVICE=myservice

export SYSDBA_USER=SYS

export SYSDBA_PASSWORD=mysyspassword

export ORDS_PASSWORD=myordspassword


${ORDS_HOME}/bin/ords --config ${ORDS_CONFIG} install \

     --log-folder ${ORDS_LOGS} \

     --admin-user ${SYSDBA_USER} \

     --db-hostname ${DB_HOSTNAME} \

     --db-port ${DB_PORT} \

     --db-servicename ${DB_SERVICE} \

     --feature-db-api true \

     --feature-rest-enabled-sql true \

     --feature-sdw true \

     --gateway-mode proxied \

     --gateway-user APEX_PUBLIC_USER \

     --proxy-user \

     --password-stdin <<EOF

${SYSDBA_PASSWORD}

${ORDS_PASSWORD}

EOF

rsync -iv --stats /tomcat/ords/ords.war /tomcat/latest/webapps

Secure SYS Account

On the target database instances...

sqlplus / as sysdba

ALTER USER sys ACCOUNT LOCK;

Mutli-Tenant

ALTER USER sys ACCOUNT LOCK CONTAINER=ALL;

Copy APEX Images

Copy the APEX images (${APXDIR}/images) to the Tomcat "webapps" directory.

If the Tomcat server and database server are separate hosts (recommended) then you will need to scp the files across.

su - root

mkdir /tomcat/latest/webapps/i/ 

rsync -riv --stats ${APXDIR}/images/* /tomcat/latest/webapps/i/

chown -R tomcat:tomcat /tomcat/latest/webapps/i/

NOTE:
This step needs to be repeated each time you install a new version of APEX or a new version of Tomcat.

Bibliography