Sunday, April 26, 2020

Oracle APEX 20.1 installed with only 2 mins downtime

Over the weekend I upgraded our environment to Oracle APEX 20.1.

I describe the process of installing a new version in the Safely Upgrading to Oracle APEX 18.1 blogpost. It comes down to cloning my current PDB, calling the clone the previous version of APEX, and then upgrade the current PDB to the latest APEX version.

This time I decided to not just run @apexins, instead, I wanted to try and minimize the downtime by following the steps described in the documentation under D Maximizing Uptime During an Application Express Upgrade.

Here're my notes, in case you want to maximize uptime.

During the first two phases, the Oracle APEX apps were still running:

SQL> @apexins1.sql sysaux sysaux temp /i/



SQL> @apexins2.sql sysaux sysaux temp /i/



The first two phases took about 7 minutes.
After phase 2, I stopped ORDS, and the downtime started for people wanting to use the Oracle APEX apps.

SQL> @apexins3.sql sysaux sysaux temp /i/



It completed in less than 2 minutes!

At the same time, phase 3 was running, I copied the images folder.
Note: you can also use the CDN by running @reset_image_prefix.sql after phase 3 and specifying: https://static.oracle.com/cdn/apex/20.1.0.00.13/

I ran the following command to allow APEX apps accessing, for example, AOP or other web services:

SQL> BEGIN
    DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE(
        host => '*',
        ace => xs$ace_type(privilege_list => xs$name_list('connect'),
                           principal_name => 'APEX_200100',
                           principal_type => xs_acl.ptype_db));
END;


And finally, I validated the ORDS config.

$ java -jar ords.war validate

I started ORDS again (running standalone), and the Oracle APEX apps were back online.

Very slick to do an upgrade with about 2 minutes downtime!

Update 27-APR-2020: Kris Rice sent me a message that there is no need to stop ORDS. It detects when APEX is upgrading and suspends traffic.

3 comments:

Bifin said...

You use the Apex 20.1 + ORDS 19 bundle everywhere.4? is it Stable?

They write that ORDS 19.4 has certain problems?
https://community.oracle.com/thread/4309023?start=15&tstart=0

Amin said...

I have been trying for the last 2 hours trying to install APEX 20.1 on a 19.3 Database. I had chosen not to have APEX installed when I created the database.
@apexins SYSAUX SYSAUX TEMP \i\
script completes but I do not see the user APEX_200100

Do I have to run the Runtime only option as well??

Amin said...

I gave up on the apexins.sql and did the 3 separate steps. It appears APEX 20.1 has installed. Do not know how the ORDS install will work out.