Updating Oracle 23c Free Docker, APEX & ORDS

Updating Oracle 23c Free Docker, APEX & ORDS

#If you followed my Oracle 23c Free Docker, APEX & ORDS all-in-one simple guide blog some time ago, you may wish to upgrade to the latest versions of

  • APEX

  • APEX Patch Set

  • ORDS

In this case, follow the instructions below.

IMPORTANT: These are experimental steps & unverified. These are simply a write-up of my notes as I updated my docker container. I will update this blog as future versions come out & I repeat these steps. For now, only use this blog for entertainment purposes and follow the official Oracle Documentation instead. Update 21/12/2023: Tested ORDS & Patches Update process

Issues I encountered:

Prerequisites

  1. Log in to your Workspace and click on the About menu option

  2. Take note of your Product Build, APEX_LISTENER_VERSION and Patch Version (note: Patch Version appears between Schema Compatibility and Last DDL Time but only if it's currently on a patch version - mine is not)

  3. It looks like I'm on APEX 23.1 and ORDS 23.1.4 and I want to upgrade to the latest - which at the time of writing is APEX 23.2 + patch set 2 & ORDS 23.3

Stop ORDS + Install wget

Stop ORDS before we do anything

  1. Now we enter bash

      docker exec -it 23cfree /bin/bash
    
  2. Drop into superuser

     su
    
  3. Stop ORDS

     sh /home/oracle/scripts/stop_ords.sh
    
  4. Take this opportunity to Install wget

     dnf install wget -y
    

Update ORDS

This will update ORDS to the latest version

  1. Whilst still as su, update ORDS

     dnf update ords -y
    
  2. Upgrade ORDS

     export _JAVA_OPTIONS="-Xms512M -Xmx512M"
     ords --config /etc/ords/config install
    
  3. Use the following configuration

     Installation Type > Choose option [1]
     Connection > Choose option [1] 
     administrator username > SYS
     password > E
    

    The output will look like this

     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
    
  4. Start ORDS

     sh /home/oracle/scripts/start_ords.sh
    
  5. Note: if you are upgrading to ORDS 23.3.0 or above and you have followed my Nginx Proxy Manager blog, then in Nginx Proxy Manager, you must edit /ords/ section by clicking the ⚙️icon and remove this line

        proxy_set_header Host $http_host:$port;
    

Update APEX

This will update APEX to the latest version

  1. Exit Super User (if in superuser)

     [ $(id -u) -eq 0 ] && exit
    
  2. Run this to get the latest APEX (1min)

      curl -o apex-latest.zip https://download.oracle.com/otn_software/apex/apex-latest.zip
    
  3. unzip it & enter the apex folder (1min)

      # CAREFUL: This removes the apex folder from the original instructions
      rm -r /home/oracle/apex
    
      # unzip 
      unzip -o apex-latest.zip
      rm apex-latest.zip
      cd apex
    
  4. Open SQL*Plus with sqlplus / as sysdba

      sqlplus / as sysdba
    

    like this...

      bash-4.4$ sqlplus / as sysdba
    
      SQL*Plus: Release 23.0.0.0.0 - Developer-Release on Wed Apr 5 13:27:32 2023 Version 23.2.0.0.0
    
      Copyright (c) 1982, 2023, Oracle. All rights reserved.
    
      Connected to: Oracle Database 23c Free, Release 23.0.0.0.0 - Developer-Release Version 23.2.0.0.0
    
  5. Set the PDB

      ALTER SESSION SET CONTAINER = FREEPDB1;
    
  6. Then run the APEX installer below to upgrade APEX

      @apexins.sql SYSAUX SYSAUX TEMP /i/
    
  7. Configure Static File Support

     @apex_rest_config.sql
    
  8. Use the following configuration

     APEX_LISTENER user > E
     APEX_REST_PUBLIC_USER > E
    
  9. Exit out of sqlplus when compete

     exit
    
  10. Copy the latest APEX images folder to where ORDS expects it

    # Backup Images folder / or delete it
    mv /home/oracle/software/apex/images /home/oracle/software/apex/images$(date +"%Y%m%d")
    # Copy the APEX images folder
    cp -r /home/oracle/apex/images /home/oracle/software/apex
    # TBC
    chmod 777 /home/oracle/software/apex/images/
    

Install the latest APEX Patch Set

  1. In your browser, go to https://apex.oracle.com/download and check for the presence of the latest cumulative patch set i.e

  2. Click the link, sign in to My Oracle Support and Click Download

  3. You'll see the download window.

    Right-click the filename in the hyperlink i.e. p35895964_2320_Generic.zip and copy the link address to the clipboard. It will look like something similar to this:

     # APEX 23.2 Patch 1
     # https://updates.oracle.com/Orion/Services/download/p35895964_2320_Generic.zip?aru=25470420&patch_file=p35895964_2320_Generic.zip
    
     # APEX 23.2 Patch 2
     # https://updates.oracle.com/Orion/Services/download/p35895964_2320_Generic.zip?aru=25497679&patch_file=p35895964_2320_Generic.zip
    
     # APEX 23.2 Patch 3
     # https://updates.oracle.com/Orion/Services/download/p35895964_2320_Generic.zip?aru=25536745&patch_file=p35895964_2320_Generic.zip
    
     # APEX 23.2 Patch 4
     https://updates.oracle.com/Orion/Services/download/p35895964_2320_Generic.zip?aru=25565403&patch_file=p35895964_2320_Generic.zip
    

    Note: you can use the above URLs instead of using the browser to find them

  4. Exit Super User (if in superuser)

     [ $(id -u) -eq 0 ] && exit
    
  5. Now prepare a command like this, but change the username, password and URL (the URL needs to be in quotes)

     #!/bin/bash
    
     # Define variables
     oracleUsername="myOracleUsername"
     oraclePassword="myOraclePassword"
     url="PASTE URL HERE"
    
     # Use variables in wget command
     wget --http-user="$oracleUsername" \
          --http-password="$oraclePassword" \
          --no-check-certificate \
          --output-document="patchfile.zip" \
          "$url"
    
  6. Paste in your prepared wget command to terminal and the patch file will download.

     Connecting to aru-akam.oracle.com (aru-akam.oracle.com)
     HTTP request sent, awaiting response... 200 OK
     Length: 357387 (349K) [application/zip]
     Saving to: 'patchfile.zip'
    
     patchfile.zip       100%[===================>] 349.01K  --.-KB/s
    
     2023-12-01 21:21:14 (167 MB/s) - 'patchfile.zip' saved [357387/357387]
    
  7. Unzip it

      unzip patchfile.zip
    
  8. Enter the patch folder.

     patchfolder=$(unzip -l patchfile.zip | awk '{print $4}' | grep -o '^[^/]\+/' | sed 's#/$##' | sort | uniq)
     cd $patchfolder
    
  9. Open SQL*Plus with sqlplus / as sysdba

      sqlplus / as sysdba
    

    like this...

      bash-4.4$ sqlplus / as sysdba
    
      SQL*Plus: Release 23.0.0.0.0 - Developer-Release on Wed Apr 5 13:27:32 2023 Version 23.2.0.0.0
    
      Copyright (c) 1982, 2023, Oracle. All rights reserved.
    
      Connected to: Oracle Database 23c Free, Release 23.0.0.0.0 - Developer-Release Version 23.2.0.0.0
    
  10. Set the PDB

     ALTER SESSION SET CONTAINER = FREEPDB1;
    
  11. Then run the APEX installer below to patch APEX

    @catpatch.sql
    
  12. Copy the patched APEX images folder to where ORDS expects it

    sudo cp -rf images /home/oracle/software/apex
    
  13. Remove the patch file and patch folder

    cd /home/oracle/
    rm /home/oracle/patchfile.zip
    rm -r $patchfolder
    

Start ORDS

Finally, start ORDS

  1. Drop into superuser

     su
    
  2. Start ORDS

     sh /home/oracle/scripts/start_ords.sh
    
  3. Exit Super User (if in superuser)

     [ $(id -u) -eq 0 ] && exit
    

Confirm the upgrade

  1. Log in to your Workspace and click on the About menu option

  2. Take note of your Product Build, APEX_LISTENER_VERSION and Patch Version

  3. Success!

What's the picture? I spotted this on a walk near Follifoot. I had to do a double-take when I saw it. Visit Yorkshire!