How can I install Oracle REST Data Services? Well, it starts with downloading the media. And, if you’re a fan of the open source package management system for Linux known as ‘yum’, then installing ORDS just got that much easier.

Adding the Oracle Repo to your yum config

This is assuming you’re on Linux 7…there’s also one for version 8!

You need to use this command to tell yum to include the Oracle Repos for software packages:

[oracle@localhost ~]$ sudo  yum-config-manager --add-repo=http://yum.oracle.com/repo/OracleLinux/OL7/oracle/software/x86_64
[sudo] password for oracle: 
Loaded plugins: langpacks
adding repo from: http://yum.oracle.com/repo/OracleLinux/OL7/oracle/software/x86_64

[yum.oracle.com_repo_OracleLinux_OL7_oracle_software_x86_64]
name=added from: http://yum.oracle.com/repo/OracleLinux/OL7/oracle/software/x86_64
baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/oracle/software/x86_64
enabled=1

Finding ORDS and Installing it

You can use the ‘yum info’ command to see if the archive is available, and what version it is, etc.

[oracle@localhost ~]$ yum info ords
Loaded plugins: langpacks, ulninfo
Available Packages
Name        : ords
Arch        : noarch
Version     : 21.2.0
Release     : 4.el7
Size        : 68 M
Repo        : yum.oracle.com_repo_OracleLinux_OL7_oracle_software_x86_64
Summary     : Oracle REST Data Services
URL         : https://www.oracle.com/database/technologies/appdev/rest.html
License     : Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
Description : Oracle REST Data Services (ORDS) makes it easy to develop modern REST
            : interfaces for relational data in the Oracle Database

And to now do the install…

[oracle@localhost ~]$ sudo yum install ords
Loaded plugins: langpacks, ulninfo
Resolving Dependencies
–> Running transaction check
—> Package ords.noarch 0:21.2.0-4.el7 will be installed
–> Processing Dependency: jre for package: ords-21.2.0-4.el7.noarch
–> Running transaction check
—> Package java-1.8.0-openjdk.x86_64 1:1.8.0.302.b08-0.el7_9 will be installed
–> Processing Dependency: java-1.8.0-openjdk-headless(x86-64) = 1:1.8.0.302.b08-0.el7_9 for package: 1:java-1.8.0-openjdk-1.8.0.302.b08-0.el7_9.x86_64
–> Processing Dependency: libjava.so(SUNWprivate_1.1)(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.302.b08-0.el7_9.x86_64
–> Processing Dependency: libjvm.so(SUNWprivate_1.1)(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.302.b08-0.el7_9.x86_64
–> Processing Dependency: libjava.so()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.302.b08-0.el7_9.x86_64
–> Processing Dependency: libjvm.so()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.302.b08-0.el7_9.x86_64
–> Running transaction check
—> Package java-1.8.0-openjdk-headless.x86_64 1:1.8.0.302.b08-0.el7_9 will be installed
–> Processing Dependency: tzdata-java >= 2021a for package: 1:java-1.8.0-openjdk-headless-1.8.0.302.b08-0.el7_9.x86_64
–> Running transaction check
—> Package tzdata-java.noarch 0:2019a-1.el7 will be updated
—> Package tzdata-java.noarch 0:2021a-1.el7 will be an update
–> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================================

Package Arch Version Repository Size

Installing:
ords noarch 21.2.0-4.el7 yum.oracle.com_repo_OracleLinux_OL7_oracle_software_x86_64 68 M
Installing for dependencies:
java-1.8.0-openjdk x86_64 1:1.8.0.302.b08-0.el7_9 ol7_latest 311 k
java-1.8.0-openjdk-headless x86_64 1:1.8.0.302.b08-0.el7_9 ol7_latest 33 M
Updating for dependencies:
tzdata-java noarch 2021a-1.el7 ol7_latest 190 k

Transaction Summary

Install 1 Package (+2 Dependent packages)
Upgrade ( 1 Dependent package)

Total download size: 102 M
Is this ok [y/d/N]: y
Downloading packages:
No Presto metadata available for ol7_latest
(1/4): java-1.8.0-openjdk-1.8.0.302.b08-0.el7_9.x86_64.rpm | 311 kB 00:00:00
(2/4): tzdata-java-2021a-1.el7.noarch.rpm | 190 kB 00:00:00
(3/4): java-1.8.0-openjdk-headless-1.8.0.302.b08-0.el7_9.x86_64.rpm | 33 MB 00:00:01

(4/4): ords-21.2.0-4.el7.noarch.rpm | 68 MB 00:00:10

Total 9.2 MB/s | 102 MB 00:00:11
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
Updating : tzdata-java-2021a-1.el7.noarch 1/5
Installing : 1:java-1.8.0-openjdk-headless-1.8.0.302.b08-0.el7_9.x86_64 2/5
Installing : 1:java-1.8.0-openjdk-1.8.0.302.b08-0.el7_9.x86_64 3/5
Installing : ords-21.2.0-4.el7.noarch 4/5
INFO: Before start ords, run below command as oracle id to configure it:
INFO: /usr/local/bin/ords install simple
INFO: In order to add the ords to systemd service run below command:
INFO: sudo systemd enable ords
Cleanup : tzdata-java-2019a-1.el7.noarch 5/5
Verifying : ords-21.2.0-4.el7.noarch 1/5
Verifying : tzdata-java-2021a-1.el7.noarch 2/5
Verifying : 1:java-1.8.0-openjdk-1.8.0.302.b08-0.el7_9.x86_64 3/5
Verifying : 1:java-1.8.0-openjdk-headless-1.8.0.302.b08-0.el7_9.x86_64 4/5
Verifying : tzdata-java-2019a-1.el7.noarch 5/5

Installed:
ords.noarch 0:21.2.0-4.el7

Dependency Installed:
java-1.8.0-openjdk.x86_64 1:1.8.0.302.b08-0.el7_9 java-1.8.0-openjdk-headless.x86_64 1:1.8.0.302.b08-0.el7_9

Dependency Updated:
tzdata-java.noarch 0:2021a-1.el7

Complete!

What just happened, and are we done yet?

Our ORDS helper program was downloaded and extracted to /usr/local/bin.

Yum didn’t know we had Java, so it pulled down the Open-JDK version 8 for ORDS as Java is listed as a dependency in the RPM.

So NOW we can actually do the configuration of ORDS and start it up.

This installer text should look extremely familiar if you’ve done an ORDS install/config before. But, let’s list a few import things to keep in mind:

  • if you enable SQL Developer Web – you get ALL the ORDS feature
  • HTTP is the default, but in real world you REALLY WANT HTTPS
  • if you select HTTPS, ORDS will generate a self-signed SSL Cert – don’s use this, get a real one from somewhere like Let’s Encrypt and use that
  • you’ll want to create an ords script to start it up as your machine comes up, it’s pretty simple, just do ‘ords’ or ‘ords standalone’ – if you want help, run ‘ords help’

I already have the ORDS_METADATA and ORDS_PUBLIC_USER setup in my database, so when ORDS sees those, it’s good to go.

If you’re doing a setup for the first time on a database, you’ll be prompted for an admin account (like SYS) to do the install, so be sure to have your DBA on hand, not to mention their blessing for deploying ORDS on their database.

The install

[oracle@localhost ~]$ ords install simple
This Oracle REST Data Services instance has not yet been configured.
Please complete the following prompts


Enter the location to store configuration data: /home/oracle/ords_config
Enter the name of the database server [localhost]:
Enter the database listen port [1521]:
Enter 1 to specify the database service name, or 2 to specify the database SID [1]:
Enter the database service name:orcl
Enter the database password for ORDS_PUBLIC_USER:
Confirm password:

Retrieving information.
Enter 1 if you want to use PL/SQL Gateway or 2 to skip this step.
If using Oracle Application Express or migrating from mod_plsql then you must enter 1 [1]:2
Enter a number to select a feature to enable:
   [1] SQL Developer Web  (Enables all features)
   [2] REST Enabled SQL
   [3] Database API
   [4] REST Enabled SQL and Database API
   [5] None
Choose [1]:
2021-09-30T20:08:44.981Z INFO        reloaded pools: []
2021-09-30T20:08:44.984Z INFO        Oracle REST Data Services schema version 21.2.0.r1741826 is installed.
Enter 1 if you wish to start in standalone mode or 2 to exit [1]:
Enter 1 if using HTTP or 2 if using HTTPS [1]:
2021-09-30T20:09:00.397Z INFO        HTTP and HTTP/2 cleartext listening on host: localhost port: 8080
2021-09-30T20:09:00.526Z INFO        Disabling document root because the specified folder does not exist: /home/oracle/ords_config/ords/standalone/doc_root
2021-09-30T20:09:03.023Z INFO        Configuration properties for: |apex|pu|
database.api.enabled=true
db.connectionType=basic
db.hostname=localhost
db.port=1521
db.servicename=orcl
feature.sdw=true
restEnabledSql.active=true
db.password=******
db.username=ORDS_PUBLIC_USER
resource.templates.enabled=true

2021-09-30T20:09:03.024Z WARNING     *** jdbc.MaxLimit in configuration |apex|pu| is using a value of 10, this setting may not be sized adequately for a production environment ***
2021-09-30T20:09:03.024Z WARNING     *** jdbc.InitialLimit in configuration |apex|pu| is using a value of 3, this setting may not be sized adequately for a production environment ***
2021-09-30T20:09:04.783Z WARNING     :::'localhost' is not a unique hostname
2021-09-30T20:09:12.705Z INFO        Oracle REST Data Services initialized
Oracle REST Data Services version : 21.2.0.r1741826
Oracle REST Data Services server info: jetty/9.4.42.v20210604


Woohoo!

ORDS is running, and I can login with SQL Developer Web to start building my REST APIs.
Author

I'm a Distinguished Product Manager at Oracle. My mission is to help you and your company be more efficient with our database tools.

7 Comments

  1. Hi Jeff,

    Great News.

    1) Would you consider this for production as well? Or would running it in tomcat or weblogic be better suitable than the standalone version?

    2) wouldn’t it make sense to provide a systemctl service to automatically start the service? So that I don’t have to implement those scripts myself?

    Regards

    • 1. yes standalone already supported for production, and many places at Oracle run it this way
      2. I’m reminded by smart people that doing yum install sets this up for you already

    • Hi Jeff,
      in the meantime I got the opportunity to try this in a production setting with Oracle Linux 8 on OCI. We ran into two issues so far:
      1) the systemctl scripts seem to be broken at least for Oracle Linux 8. In /etc/init.d/ords I had to do two modifications to get it to work:
      change ORDS_CONFIG=$( printf “%q” “$ORDS_CONFIG” ) to
      export ORDS_CONFIG=$( printf “%q” “$ORDS_CONFIG” )
      remove /comment out the line:
      export APP_VM_OPTS=$app_vm_opts to
      maybe the second one is “just for my setting”, but the first part I think is a generic bug. Is this something known? Or should I create an SR?

      2) I run the standalone ords on port 8080/http and put an OCI Load balancer in front of it that terminates the HTTPS. That does only work for APEX when I include
      https://myfancy.example.com
      See 2139195.1 where I got that from, however I kind of think this is still a bug since my LB is passing all the X-Forwarded/Host-Headers correctly. Is this a “known working setting”? I created SR 3-29614310421 for this in case you’d like to check further.

      Regards
      Johannes

  2. Richard Martens Reply

    Would it be possible to have this installed inside a tomcat instance as well Jeff ?

  3. Geert De Paep Reply

    Nice!
    Is there the option to do the configuration in silent mode? I.e. prepare a parameter file and use that during the configuration, without user interaction?
    Thanks

Write A Comment