8i | 9i | 10g | 11g | 12c | 13c | 18c | 19c | 21c | Misc | PL/SQL | SQL | RAC | WebLogic | Linux

Home » Articles » Misc » Here

Oracle REST Data Services (ORDS) : Installation on Tomcat (Windows)

Oracle REST Data Services (ORDS), formerly known as the APEX Listener, allows APEX applications to be deployed without the use of Oracle HTTP Server (OHS) and mod_plsql or the Embedded PL/SQL Gateway. ORDS version 3.0 onward also includes JSON API support to work in conjunction with the JSON support in the database. ORDS can be deployed on WebLogic, Tomcat or run in standalone mode. This article describes the installation of ORDS on Tomcat 9 running on Windows.

Related articles.


We need the Java and Tomcat software installed on the server before we can proceed.



We will also need the ORDS and APEX software. This article will assume it is in our "%USERPROFILE%\Downloads" directory.

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.

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. All commands are run with the command prompt unless otherwise stated.

Make a directory for the ORDS software.

mkdir c:\app\ords

Unzip the ORDS software into the directory.

powershell -command "Expand-Archive -LiteralPath %USERPROFILE%\Downloads\ords-latest.zip -DestinationPath c:\app\ords"

Make a config directory for ORDS, with a logs subdirectory.

mkdir c:\app\config\ords\logs

Install ORDS. Amend the environment variables as required, and enter the SYSDBA and ORDS_PUBLIC_USER passwords when prompted.

set ORDS_HOME=c:\app\ords
set ORDS_CONFIG=c:\app\config\ords
set DB_HOSTNAME=localhost
set DB_PORT=1521
set DB_SERVICE=pdb1

c:\app\ords\bin\ords.exe ^
  --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 ^

Add the ORDS "bin" directory to your path permanently, and in the current session.

setx PATH "%PATH%;c:\app\ords\bin"
set PATH="%PATH%;c:\app\ords\bin"

Tomcat Deployment

Unzip the APEX software.

powershell -command "Expand-Archive -LiteralPath %USERPROFILE%\Downloads\apex-latest.zip -DestinationPath %USERPROFILE%\Downloads"

Copy the APEX images to the Tomcat "webapps\i" directory.

set CATALINA_HOME="c:\Program Files\Apache Software Foundation\Tomcat 9.0"

mkdir %CATALINA_HOME%\webapps\i
xcopy /s %USERPROFILE%\Downloads\apex\images %CATALINA_HOME%\webapps\i\

Copy the "ords.war" file to the Tomcat "webapps" directory.

copy C:\app\ords\ords.war %CATALINA_HOME%\webapps\

The JAVA_OPTS 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. Some references suggest you may need to use the JAVA_TOOL_OPTIONS environment variable instead of JAVA_OPTS environment variable, but JAVA_OPTS worked fine for this installation.

Create a file called "setenv.bat" under the "%CATALINA_HOME%\bin" directory with the following contents.

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

After restarting Tomcat (see below) ORDS should now be accessible using the following type of URL.



Starting/Stopping ORDS Under Tomcat

ORDS is started or stopped using the Windows service. We must be running the command prompt as the administrator.

net stop "Apache Tomcat 9.0 Tomcat9"
net start "Apache Tomcat 9.0 Tomcat9"

ORDS Repair

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

export ORDS_HOME=/u01/ords
export ORDS_CONFIG=/u01/config/ords
export ORDS_LOGS=${ORDS_CONFIG}/logs

c:\app\ords\bin\ords.exe --config %ORDS_CONFIG% install repair --interactive --log-folder %ORDS_LOGS%

ORDS Uninstall

ORDS is uninstalled using the following command.

export ORDS_HOME=/u01/ords
export ORDS_CONFIG=/u01/config/ords

c:\app\ords\bin\ords.exe --config %ORDS_CONFIG% uninstall --interactive

For more information see:

Hope this helps. Regards Tim...

Back to the Top.