Get the latest – Enhance your DB Developer VM

As technology evolves, staying ahead is not just an option but a necessity. We can’t run headlong into every new technology though. Trying out new concepts without disrupting the systems that are relied upon day in, day out, requires caution. This year I have found the Oracle Developer DB Virtual Machine to be really useful for trying out new converged database concepts without impacting what I’m working with on a daily basis. By keeping the database and tools in a sandbox that I can just park and come back to when I’ve got time, I can comfortably fire up the VM and start experimenting.

In April of 2023 the Oracle DB Developer VM was released with the Oracle 23c Free database and related database tools which were released at the time. Just under 6 months later the virtual machine image was update in September 2023 to have more recent versions of those tools. In December 2023 ORDS 23.4.0 was released. Do you have to wait another 5 – 6 months before you can start using the latest release of ORDS? No – and this article will walk you through the steps to achieve that…

Inside Job

Everything is going to take place inside the VM so make sure that is running…

VirtualBox Graphical User Interface

In fact, most of the steps will be commands in one of the terminals. The user is oracle and the working directory is /home/oracle/. This is our starting point…

One of the terminal sessions already started

Current running ORDS

By default there’s only one ORDS instance running in your VM. Get the details of the current ORDS instance using the jps command with some options which will tell you what the startup parameters were. Piping through grep keeps the list to just the ords instances running in standalone mode…

jps -ml | grep ords

3488 /home/oracle/ords/ords.war --config /home/oracle/ords_config serve --port 8080 --apex-images /home/oracle/apex_images

From the above we have a process id but more importantly, confirmation that the configuration directory is /home/oracle/ords_config and that certain serve options are provided too. We will use that information later.

Download latest ORDS

Oracle REST Data Services is available under the Oracle Free Use Licence so the latest released version is always available at https://download.oracle.com/otn_software/java/ords/ords-latest.zip. Remember all these commands are taking place in /home/oracle/ unless otherwise stated.

[oracle@localhost ~]$ wget https://download.oracle.com/otn_software/java/ords/ords-latest.zip

--2024-01-03 12:57:37-- https://download.oracle.com/otn_software/java/ords/ords-latest.zip
Resolving download.oracle.com (download.oracle.com)... 23.36.48.85
Connecting to download.oracle.com (download.oracle.com)|23.36.48.85|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 114754880 (109M) [application/zip]
Saving to: ‘ords-latest.zip’

ords-latest.zip 100%[==============================================>] 109.44M 9.58MB/s in 12s

2024-01-03 12:57:50 (9.18 MB/s) - ‘ords-latest.zip’ saved [114754880/114754880]

[oracle@localhost ~]$

Backup the current version

Just in case there is an issue and you need to go back to the version that came with your VM make a backup.

[oracle@localhost ~]$ cp -r ords ords_previous

Verify all the files are ready

Just make sure the files are in place…

[oracle@localhost ~]$ ls -l | grep ords
drwxrwxr-x. 10 oracle oracle 190 Sep 13 19:46 ords
drwxrwxr-x. 4 oracle oracle 37 Sep 13 19:46 ords_config
-rw-rw-r--. 1 oracle oracle 114754880 Dec 20 12:25 ords-latest.zip
drwxrwxr-x. 10 oracle oracle 190 Jan 3 12:59 ords_previous
[oracle@localhost ~]$

As you can see there’s the /home/oracle/ords/ directory that has the ORDS distribution that the VM shipped with. The /home/oracle/ords_config/ directory for ORDS configuration settings. The ords-latest.zip file which at the time of writing is ORDS 23.4.0. The /home/oracle/ords_previous/ directory which is a copy of the ORDS distribution that came with the virtual machine. Hopefully we’ll never have to use it.

Extract the ords-latest

Let’s put the most recent release of ORDS into it’s own directory…

[oracle@localhost ~]$ mkdir ords-latest
[oracle@localhost ~]$ unzip ords-latest.zip -d ords-latest
Archive: ords-latest.zip
creating: ords-latest/bin/
creating: ords-latest/linux-support/
creating: ords-latest/linux-support/man/
...
inflating: ords-latest/examples/plugins/lib/ords-plugin-apt-23.4.0.346.1619.jar
inflating: ords-latest/examples/plugins/lib/jakarta.inject-api-2.0.0.jar
inflating: ords-latest/examples/plugins/lib/ords-plugin-api-23.4.0.346.1619-javadoc.jar
[oracle@localhost ~]$ ls -l ords-latest
total 110032
drwxr-xr-x. 2 oracle oracle 34 Dec 12 16:36 bin
drwxr-xr-x. 3 oracle oracle 21 Dec 12 16:36 docs
drwxr-xr-x. 7 oracle oracle 93 Mar 27 2023 examples
drwxr-xr-x. 2 oracle oracle 28 Nov 24 17:50 icons
drwxr-xr-x. 3 oracle oracle 17 Nov 24 17:50 lib
-rw-r--r--. 1 oracle oracle 5996 Dec 12 05:35 LICENSE.txt
drwxr-xr-x. 3 oracle oracle 86 Dec 12 16:36 linux-support
-rw-r--r--. 1 oracle oracle 210 Dec 12 05:35 NOTICE.txt
-rw-r--r--. 1 oracle oracle 112653905 Dec 12 16:36 ords.war
drwxr-xr-x. 4 oracle oracle 38 Mar 27 2023 scripts
-rw-r--r--. 1 oracle oracle 365 Dec 12 05:35 THIRD-PARTY-LICENSES.txt
[oracle@localhost ~]$

Perform upgrade to DB

Now that you have the most recent version of ORDS you can upgrade the ORDS Metadata in the database. We must tell ORDS where the configuration directory is but we have that information from earlier…

[oracle@localhost ~]$ /home/oracle/ords-latest/bin/ords --config /home/oracle/ords_config install

ORDS: Release 23.4 Production on Wed Jan 03 13:06:06 2024

Copyright (c) 2010, 2024, Oracle.

Configuration:
/opt/oracle/userhome/oracle/ords_config/

Oracle REST Data Services - Interactive Install

Enter a number to select the type of installation
[1] Install or upgrade ORDS in the database only
[2] Create or update a database pool and install/upgrade ORDS in the database
[3] Create or update a database pool only
Choose [1]:

Just go with the default to upgrade ORDS in the database only and use SYS as the administrator. Remember that the password for everything in this Developer DB virtual machine is oracle. Here’s the output from running my upgrade…

Oracle REST Data Services - Interactive Install

Enter a number to select the type of installation
[1] Install or upgrade ORDS in the database only
[2] Create or update a database pool and install/upgrade ORDS in the database
[3] Create or update a database pool only
Choose [1]:
Enter a number to select the database pool to use or specify the database connection
[1] default jdbc:oracle:thin:@//localhost:1521/FREEPDB1
[2] Specify the database connection
Choose [1]:
Provide database user name with administrator privileges.
Enter the administrator username: sys
Enter the database password for SYS AS SYSDBA:
Connecting to database user: SYS AS SYSDBA url: jdbc:oracle:thin:@//localhost:1521/FREEPDB1

Retrieving information.
Connecting to database user: ORDS_PUBLIC_USER url: jdbc:oracle:thin:@//localhost:1521/FREEPDB1
2024-01-03T13:07:08.935Z INFO Created folder /opt/oracle/userhome/oracle/ords_config/logs
2024-01-03T13:07:08.936Z INFO The log file is defaulted to the current working directory located at /opt/oracle/userhome/oracle/ords_config/logs
2024-01-03T13:07:09.036Z INFO Upgrading Oracle REST Data Services schema 23.2.3r2421937 to version 23.4.0.r3461619 in FREEPDB1
2024-01-03T13:07:16.182Z INFO Completed upgrade for Oracle REST Data Services version 23.4.0.r3461619. Elapsed time: 00:00:07.1

2024-01-03T13:07:16.183Z INFO Log file written to /opt/oracle/userhome/oracle/ords_config/logs/ords_upgrade_2024-01-03_130708_93718.log

Symbolic gesture

This is not entirely necessary but we are going to make /home/oracle/ords/ a soft symbolic link so we can point it to whatever directory we like. If necessary, pointing it to /home/oracle/ords_previous/ if we encounter a problem.

[oracle@localhost ~]$ rm -rf ords
[oracle@localhost ~]$ ln -s ords-latest ords
[oracle@localhost ~]$ /home/oracle/ords/bin/ords --version

ORDS: Release 23.4 Production on Wed Jan 03 13:13:10 2024

Copyright (c) 2010, 2024, Oracle.

Configuration:
/opt/oracle/userhome/oracle/

Oracle REST Data Services 23.4.0.r3461619
[oracle@localhost ~]$

That confirms we have /home/oracle/ords/ now pointing to the ORDS we just downloaded.

Serve it up!

Although /home/oracle/ords/ now points to the latest release of ORDS the currently running version of ORDS is the previous one. We could just restart the VM to address that. The ORDS service is defined with the DB service in /etc/init.d/oracle so the database and ORDS can be restarted together. Just for now, let’s find the ORDS standalone instance, stop it and start it in the terminal window just to see that the same startup command gives us ORDS 23.4.0.

# Find the currently running ORDS instance and kill it
ps -ef | grep ords
kill -9 <pid>

# Restart ORDS
/bin/bash /home/oracle/ords/bin/ords --config /home/oracle/ords_config serve --port 8080 --apex-images /home/oracle/apex_images

2024-01-03T13:22:51.292Z INFO

Mapped local pools from /home/oracle/ords_config/databases:
/ords/ => default => VALID


2024-01-03T13:22:51.547Z INFO Oracle REST Data Services initialized
Oracle REST Data Services version : 23.4.0.r3461619
Oracle REST Data Services server info: jetty/10.0.18
Oracle REST Data Services java info: Java HotSpot(TM) 64-Bit Server VM 11.0.19+9-LTS-224

That confirms the same ORDS serve command that we saw at the top of this article will startup ORDS in standalone mode listening on port 8080.

ORDS 23.4.0 running on Database Developer VM

Stop and Start

Starting ORDS in standalone mode is part of the service startup for the VM so powering off the VM and starting it again will bring you back to the clean state of new terminal windows, but the version of ORDS running is now 23.4.0. When there is a more recent version of ORDS released that can be extracted into a new directory and the /home/oracle/ords/ soft symbolic link could be changed to point to that.

Restart the VM and the version of ORDS is the latest

Success! You now have your Oracle Database 23c Free VirtualBox Appliance running with the most recent version of ORDS.

3 thoughts on “Get the latest – Enhance your DB Developer VM

Leave a comment