ORDS Tomcat Install (21.2)
Assumptions
Oracle Database 11.1 or later
ORDS 19.2 or later, up to 21.2 (i.e. NOT 22.1 and later)
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
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
mkdir /tomcat/ords
unzip /tomcat/ords*.zip -d /tomcat/ords
mkdir -p /tomcat/ords/conf
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...
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
Parameter File
Edit the parameter file...
/tomcat/ords/params/ords_params.properties
In the sections below, non-default parameters have values in bold italicDatabase Connection
db.connectionType=basic
db.hostname=databaseserver
db.port=1521
db.servicename=ORCL1
db.sid=ORCL1
You must specify either db.sid or db.servicename (but not both)basic uses service:hostname:port JDBC connect format
hostname
port
service
SID
For connection to a PDB you must specify db.servicenameREST Data Services
rest.services.ords.add=true
user.public.password=PUBpassword
schema.tablespace.default=SYSAUX
schema.tablespace.temp=TEMP
user.tablespace.default=SYSAUX
user.tablespace.temp=TEMP
bequeath.connect=false
Install the ORDS schema
Specifies password for ORDS_PUBLIC_USER
ORDS_METADATA default tablespace (must exist)
ORDS_METADATA temp tablespace (must exist)
ORDS_PUBLIC_USER default tablespace (must exist)
ORDS_PUBLIC_USER temp tablespace (must exist)
Only set to true if db is on same server as app server
REST-Enabled SQL
restEnabledSql.active=false
Enable REST-Enabled SQL
Database API
database.api.enabled=false
Enable Database API
SQL Developer Web
- Available in ORDS 19.4+
- Needs REST-Enabled SQL and Database API
feature.sdw=false
Enable SQL Developer Web
Multi-Tenant
- Options for installing into CDB and all of its PDBs.
- Leave at defaults for single-tenant architecture.
cdb.common.schema=false
db.serviceNameSuffix=.your_db_domain
Application Express
plsql.gateway.add=true
db.username=APEX_PUBLIC_USER
db.password=APUpassword
rest.services.apex.add=true
user.apex.listener.password=ALpassword
user.apex.restpublic.password=ARPUpassword
security.externalSessionTrustedOrigins
Configure ORDS for APEX.
PL/SQL gateway username. For APEX must be APEX_PUBLIC_USER
Password for APEX_PUBLIC_USER
Configure ORDS for APEX RESTful Services.
Specifies password for APEX_LISTENER
Specifies password for APEX_REST_PUBLIC_USER.
origins trusted for CORS reqs for PL/SQL Gateway or APEX
Miscellaneous
migrate.apex.rest=false
standalone_mode=false
Copy 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/
cp -R ${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.
Set Configuration Directory
cd /tomcat/ords
java -jar ords.war configdir /tomcat/ords/conf
Install
java -jar ords.war install
Validate
cd /tomcat/ords
java -jar ords.war validate
If you see an "Incompatible versions." error then do this to upgrade the schema...java -jar ords.war schema
Test Standalone (Optional)
java -jar ords.war standalone
Use Ctrl-C to terminate the ORDS process when you are done.In a browser, test that ORDS is working, e.g.
http://tomcatserver:8181
Where tomcatserver is your Tomcat/ORDS server and databaseserver is your database server and 8181 is the port.Deploy ords.war to Tomcat
cd /tomcat/ords
cp ords.war /tomcat/latest/webapps/
The following URL should work..
http://tomcatserver:8080/ords
ORDS should also show up as an application in Tomcat Web Application Manager...
http://tomcatserver:8080/manager/html
Next Steps
Bibliography
https://oracle-base.com/articles/misc/oracle-rest-data-services-ords-installation-on-tomcathttps://mikesmithers.wordpress.com/2019/03/01/installing-apex-and-ords-on-oracle-18cxe-on-centos/#more-7855 https://oracle-base.com/articles/misc/oracle-rest-data-services-ords-configure-multiple-databases https://www.oracle-and-apex.com/deploy-ords-on-tomcat-in-a-subdirectory/https://oracle-base.com/blog/2022/04/22/oracle-rest-data-services-ords-22-1-all-change/https://linecode-notes.com/2021/10/24/oracle-rest-data-services-21-3-installation-2/
https://docs.oracle.com/cd/E59726_01/install.50/e39144/listener.htm#HTMIG29158
Oracle REST Data Services (ORDS) / APEX Listener General FAQ (Doc ID 1536052.1)How to Configure ORDS to Run APEX and MOD_PLSQL URLs (Doc ID 2228856.1)How to Install, Upgrade, Validate & Uninstall ORDS Without Using <SYS AS SYSDBA> (Doc ID 2597045.1)
ORDS Installation, Configuration, and Development Guidehttps://docs.oracle.com/en/database/oracle/oracle-rest-data-services/21.3/aelig/installing-REST-data-services.html (21.3)https://docs.oracle.com/en/database/oracle/oracle-rest-data-services/19.4/aelig/installing-REST-data-services.html (19.4)
Reverse Proxyhttps://www.oracle-and-apex.com/the-oracle-apex-reverse-proxy-guide-using-nginx/https://www.oracle-and-apex.com/tomcat-with-ords-running-apex-behind-a-reverse-proxy/