Upgrade APEX component of Oracle Database

Oracle Database 19c APEX Upgrade: 19.2 to 24.1.7

Oracle APEX (Application Express) is a low-code development platform for building web applications using Oracle Database. It enables developers to create applications quickly, with SQL for data interaction. APEX is designed to simplify development, automate processes and provide powerful tools for reporting, dashboards, and data management while tightly integrating with Oracle’s database ecosystem.

The Oracle APEX upgrade process is independent of the database engine version, meaning you can upgrade APEX without needing to upgrade the Oracle Database itself. This is because APEX is installed as a set of database objects within the Oracle Database but is managed as a separate component. However, there are database version compatibility requirements. For example, each version of APEX requires a minimum Oracle Database version to function properly. You can upgrade APEX independently as long as the database meets those version requirements.

Oracle APEX release 24.1 requires an Oracle Database release 19c or later. APEX runs on all database editions, including Enterprise Edition (EE), Standard Edition (SE), and Oracle Database Free. APEX can be installed in single-instance database and in Oracle Real Application Clusters (Oracle RAC) database. APEX disk space requirements are as follows:

  • Free space in APEX tablespace for each additional language (other than English) installed: 60 MB
  • Free space for APEX software files on the file system: 599 MB if using English only download (apex_24.1_en.zip) and 983 MB if using full download (apex_24.1.zip).
  • Free space in APEX tablespace: 190 MB
  • Free space in SYSTEM tablespace: 125 MB

Upgrading APEX is no different from the initial installation; there is no need to uninstall anything

The upgrade process creates new database objects in a new schema and migrates the application metadata to the new release.

I will provide the steps. Currently, I have version 19.2 installed in my database with very minimal usage and a dedicated tablespace (APEX19). Using a dedicated tablespace is considered a best practice because it keeps APEX application objects (tables, views, procedures) isolated from other database objects. This approach also allows for the possibility of dropping the old, unused tablespace after a successful migration.

For installations where the development will be in English only, download the apex_24.1_en.zip file from the APEX download page. If the development will include languages other than English, download apex_24.1.zip from the APEX download page.

Connect to the database that will be upgraded. Select the appropriate installation option according to your needs. Refer to the Installation Guide for APEX Release 24.1 for more information about the available installation options. I will proceed with the Full Development Environment option, which is the most common choice.

Check for any invalid objects owned by APEX_240100 user in dba_objects and Check the APEX component from dba_registry whether is valid and its version is updated to the 24.1.

Each time APEX is installed or upgraded, the wwv_flow_epg_include_mod_local function is created under the new schema. This function is invoked by Oracle Application Express’s request validation mechanism, which is called by the embedded PL/SQL gateway or mod_plsql.

The APEX request validation function first evaluates the incoming request. Based on the procedure name, it can approve, reject, or delegate the request to the wwv_flow_epg_include_mod_local function. This local function allows for custom request evaluation using user-defined rules.

By default, it returns FALSE for all procedures. In this case, the following error is encountered for custom procedures:

ORA-20000: Procedure call forbidden by request validation function (wwv_flow_epg_include_modules.authorize).

In short, this function adds an additional layer of security by controlling which procedures can be invoked in HTTP requests. I will add HR.SAMPLE_FUNCTION to the allowed list as an example.

More information is available on Oracle Application Express Administration Guide and HTTP-403 Forbidden Error While Trying To Access The DB Procedure From The URL (Doc ID 783646.1).

Starting with APEX 20.2, APEX_INSTANCE_ADMIN.ADD_WEB_ENTRY_POINT procedure can also be used.

Now we may proceed with dropping old user “APEX_190200” and old tablespace(APEX19) for me. But first we will make sure that old tablespace is not used by any other database users and other APEX schemas.

I need to move 5 indexes, 1 LOB index, and 1 table belonging to the FLOWS_FILES user from the APEX19 (old) tablespace to the new tablespace APEX24.

The process is straightforward: these objects will be moved to the new tablespace. Although How to Move APEX Schemas to a New Tablespace During APEX Upgrade (Doc ID 760404.1) was originally written for APEX version 3, it remains valid for the current versions. We will follow a similar approach as outlined in that document.

Now drop old user.

In our environment, a package named WWV_DBMS_SQL_APEX_190200 with an invalid status remained under the SYS schema. This package was related to the APEX 19.2 version. After the APEX_190200 schema was dropped, we also removed this invalid package.

Drop old tablespace.

The APEX major version upgrade steps have been successfully completed. Optionally, you may choose to apply the latest cumulative patch to ensure optimal performance and stability, especially if the APEX component is actively utilized..

Patch Set Bundle 7 for Oracle APEX 24.1 was released on the 9th December 2024. I will apply it. (Patch 36695709). It is also available in APEX download page. Download and unzip it.

Run utlrp for invalid objects.

Check the patch from dictionary. When this patch is applied, the APEX product version will be updated to 24.1.7 in dba_registry

Hope it helps.


Discover More from Osman DİNÇ


Comments

Leave your comment