Return to site

OXAR - Upgrade ORDS v3.0.x to v19.3

Upgrade your OXAR installation!

Why upgrade?

Because Oracle APEX is constantly adding new features and the new versions include all those bug fixes, so unless you have paid support, you can only fix those bugs via upgrade.

But I can follow Oracle's Documentation on how to upgrade...

Yes kid, but with OXAR is more complicated than that.. in fact, OXAR (to my knowledge) was not designed with in-place upgrades in mind.

So this instructions will help you stay in your existing installation without having to build a new one, transfer your apps and objects, certs, etc..

Steps I followed

Notes:

  • The following OS commands must be run as root.
  • Use SQLPlus to connect.
  • I use dropbox but you can use whatever you prefer.
  • In this example I had an ORDS 3.0.9 via OXAR Installation
  • You want to upgrade ORDS before APEX as it's an APEX 18.2/19.1 requirement to have ORDS 3.0.12 and above (see my other BLOG).

pm2 stop node4ords
systemctl stop tomcat@oxar
cd ~
mkdir ords183
cd ords183
wget https://www.dropbox.com/s/{secret_link}/ords-18.3.0.270.1456.zip
unzip ords-18.3.0.270.1456.zip
cd /var/lib/tomcat/webapps
mv ords.war ords.war.309
rm -rf /var/lib/tomcat/webapps/ords/*
cp /root/ords183/ords.war /var/lib/tomcat/webapps
unzip ords.war -d ords
chown -R tomcat:tomcat ords

Run the install of ORDS and answer the prompts, with a vanilla OXAR you should only be prompted for the config directory and SYS password:

java -jar ords.war install advanced

This Oracle REST Data Services instance has not yet been configured.
Please complete the following prompts

Enter the location to store configuration data:/etc

Verify ORDS schema in Database Configuration apex with connection host: localhost port: 1521 sid: xe

Retrieving information.
Requires SYS AS SYSDBA to verify Oracle REST Data Services schema.

Enter the database password for SYS AS SYSDBA:
Confirm password:

Retrieving information.
Upgrading Oracle REST Data Services schema 3.0.9.348.07.16 to version 18.3.0.r2701456
... Log file written to /root/ords_upgrade_2019-04-26_152715_00068.log
... Upgrading ORDS schema to 18.3.0.r2701456
Completed upgrade for Oracle REST Data Services version 18.3.0.r2701456. Elapsed time: 00:00:19.461

Enter 1 if you wish to start in standalone mode or 2 to exit [1]:2

Now start tomcat and while it's running configure the configdir. (for some weird reason it only worked while running, maybe a bug?).
Then start node4ords and you're done!

systemctl start tomcat@oxar
java -jar ords.war configdir /etc
pm2 start node4ords

Last step is to cleanup:

cd ~ rm -rf ords183

Note:

Seems ORDS leaves some views with errors or at least on a weird state, the log shows errors like this:

WARNING: ORA-04063: view "ORDS_METADATA.UNIFIED_POOL_CONFIG" has errors java.sql.SQLException: ORA-04063: view "ORDS_METADATA.UNIFIED_POOL_CONFIG" has errors

Check the views owned by ORDS_METADATA schema and if there are some views with errors, validate to have them fixed.
 

For me I just run the following and works/fix the issue always:

   

cd /var/lib/tomcat/webapps

java -jar ords.war validate --database apex

Requires SYS AS SYSDBA to verify Oracle REST Data Services schema.

Enter the database password for SYS AS SYSDBA:
Confirm password:

Retrieving information.

Oracle REST Data Services will be validated.

Validating Oracle REST Data Services schema version 18.3.0.r2701456

... Log file written to /root/ords_validate_core_2019-04-26_203740_00175.log

Completed validating Oracle REST Data Services version 18.3.0.r2701456.
Elapsed time: 00:00:08.26

Final Notes:
Please backup prior you make any changes, and test, test and more test.

Let me know if you have any questions.

Thanks

Gaspar

ps. Latest updates to this post will be on Github:
https://github.com/OraOpenSource/OXAR/issues/265