DBA Hub

📋Steps in this guide1/8

Oracle REST Data Services (ORDS) : Installation on Tomcat (ORDS Version 22.1 Onward)

Install Oracle REST Data Services (ORDS) version 22.1 onward on Tomcat.

oracle miscconfigurationintermediate
by OracleDba
19 views
1

Assumptions

- You have a server with Tomcat 9 installed on it. In this case I used a server with Oracle Linux 8 and Tomcat 9 . - You have a database with APEX installed. APEX is not actually necessary, but there is some useful stuff in there, so I would always recommend it.
2

Multitenant : CDB or PDB Installation

When using the multitenant architecture there are several options for how to install ORDS. For this article we are going to install ORDS into the PDB. This is preferable for Lone-PDB installations (a CDB with one PDB), or for CDBs with small numbers of PDBs If you are using many PDBs per CDB, you may prefer to install ORDS into the CDB. You can read more about the CDB installation options here .
3

Downloads

Download the following software. Always use the latest version available. - Oracle REST Data Services (ORDS) The latest version can always be downloaded from this URL. It doesn't include the version number in the file name, which means you have to unzip it to check the version, so I rarely use this. - https://download.oracle.com/otn_software/java/ords/ords-latest.zip
4

ORDS Installation

Check the SYS user (or an alternative SYSDBA user) and common public users are unlocked and you know their passwords. Remember to lock the SYS user when the installation is complete. Unzip the ORDS distribution. In this case we are doing this as the "tomcat" user on the server. Make a directory to hold the configuration, with a subdirectory for logs. Unlike previous versions, from ORDS 22.1 onward we no longer run the "ords.war" file directly. Instead we use the "ords" script in the "bin" directory. For a silent installation we use command line arguments. The example below uses environment variables to supply argument values, as it's clearer when reading the ORDS command. Notice the passwords are sent in as a file redirect. If this were missing, we would be prompted for them. If the environment variable is set, we don't have to use the argument, but it's good to show it explicitly. The full list of command line arguments, and their meanings, can be found here . Lock the SYS user. You may find it useful to include the following change to your variable, so you can runs the command without needing to explicitly include the path.

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
conn / as sysdba
alter user sys identified by SysPassword1 account unlock;
--alter user sys identified by SysPassword1 account unlock container=all;

--alter session set container = pdb1;
alter user apex_listener identified by OraPassword1 account unlock;
alter user apex_public_user identified by OraPassword1 account unlock;
alter user apex_rest_public_user identified by OraPassword1 account unlock;

-- The next one will fail if you've never installed ORDS before. Ignore errors.
alter user ords_public_user identified by OraPassword1 account unlock;

# su - tomcat
$ mkdir /u01/ords
$ cd /u01/ords
$ unzip /tmp/ords-22.1.0.105.1723.zip

$ mkdir -p /u01/config/ords/logs

export ORDS_HOME=/u01/ords
export ORDS_CONFIG=/u01/config/ords
export ORDS_LOGS=${ORDS_CONFIG}/logs
export DB_PORT=1521
export DB_SERVICE=pdb1
export SYSDBA_USER=SYS
export SYSDBA_PASSWORD=SysPassword1
export ORDS_PASSWORD=OraPassword1


${ORDS_HOME}/bin/ords --config ${ORDS_CONFIG} install \
     --log-folder ${ORDS_LOGS} \
     --admin-user ${SYSDBA_USER} \
     --db-hostname ${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

conn / as sysdba
alter user sys account lock;
--alter user sys account lock container=all;

export PATH=${ORDS_HOME}/bin:$PATH
5

Tomcat Deployment

Copy the APEX images to the Tomcat "webapps" directory. Copy the "ords.war" file to the Tomcat "webapps" directory. The environment variable must include a reference to the "-Dconfig.url" flag, to tell ORDS where to find the ORDS configuration. We can also set the Java heap size here. On Windows you may need to use the environment variable instead of environment variable. After restarting Tomcat (see below) ORDS should now be accessible using the following type of URL.

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
$ mkdir $CATALINA_BASE/webapps/i/
$ cp -R /tmp/apex/images/* $CATALINA_BASE/webapps/i/

$ cd /u01/ords
$ cp ords.war $CATALINA_BASE/webapps/

export JAVA_OPTS="-Dconfig.url=${ORDS_CONFIG} -Xms1024M -Xmx1024M"

http://<server-name>:<port>/ords/

http://ol7.localdomain:8080/ords/
6

Starting/Stopping ORDS Under Tomcat

ORDS is started or stopped by starting or stopping the Tomcat instance it is deployed to. Assuming you have the environment variable set correctly, the following commands should be used.

Code/Command (click line numbers to comment):

1
2
3
4
5
export CATALINA_OPTS="$CATALINA_OPTS -Duser.timezone=UTC"
export JAVA_OPTS="-Dconfig.url=${ORDS_CONFIG} -Xms1024M -Xmx1024M"

$CATALINA_HOME/bin/startup.sh
$CATALINA_HOME/bin/shutdown.sh
7

ORDS Repair

You can repair the current ORDS installation using the following command.

Code/Command (click line numbers to comment):

1
2
3
4
5
export ORDS_HOME=/u01/ords
export ORDS_CONFIG=/u01/config/ords
export ORDS_LOGS=${ORDS_CONFIG}/logs

${ORDS_HOME}/bin/ords --config ${ORDS_CONFIG} install repair --interactive --log-folder ${ORDS_LOGS}
8

ORDS Uninstall

ORDS is uninstalled using the following command. For more information see: - Oracle REST Data Services : Installation and Configuration Guide - Oracle REST Data Services Documentation Release - Oracle REST Data Services (ORDS) Articles - Oracle REST Data Services (ORDS) : Standalone Mode (ORDS Version 22.1 Onward) - Oracle Application Express (APEX) Installation - Apache Tomcat 9 Installation on Linux (RHEL and clones) Hope this helps. Regards Tim...

Code/Command (click line numbers to comment):

1
2
3
4
export ORDS_HOME=/u01/ords
export ORDS_CONFIG=/u01/config/ords

${ORDS_HOME}/bin/ords --config ${ORDS_CONFIG} uninstall --interactive

Comments (0)

Please to add comments

No comments yet. Be the first to comment!