A great feature that has been introduced with Oracle APEX 5.1 is a new way to install / upgrade an existing APEX instance to a new version.
Previously installing a new version of APEX meant shutting down access to that server for your end users for the entire duration of this installation.
Now it is possible to reduce downtime to a short part of that installation.
Here is how this works
Instead of using the script apexins.sql to install APEX into the database, there are 3 scripts to initiate each phase of the installation process. For sake of similarity, all scripts take the same arguments as the original apexins.sql
- @apexins1.sql – creates the new APEX schema (ie. APEX_180200) with all tables, views, packages, but no data. In this phase the old APEX version is still active and can be used without limitations.
- @apexins2.sql – now all application metadata is migrated from the old APEX schema to the new one. The old APEX version is still active, but in a readonly mode. No applications can be modified, but everything can still be used. In terms of a production system all apps continue to work and all end users are happy
- @apexins3.sql – is the final phase and needs the usual webserver shutdown. Now the new APEX schema is being activated and the old one retired. Some leftover metadata (like the activity log) is migrated from old to new schema.
Wonderful Carsten Czarski wrote a great post about this feature and explains it in more detail. See also the documentation about Maximizing Uptime During an Application Express Upgrade.
Using this staged installation process we could minimize downtime of our live systems to less than 3 minutes.