Updating Application Express

After installation of Oracle XE 11g you should update Apex to the newest version, currently Apex 5.0.4. Therefore download the software at OTN and unzip the file to any directory you want. Please note, there is an account required for Oracle Technical Network “OTN”.

As next, i created two dedicated tablespaces as SYS user.

 
CREATE TABLESPACE APEX DATAFILE 
  'D:\ORACLE\ORACLEXE\APP\ORACLE\ORADATA\XE\APEX.DBF' 
  SIZE 500M EXTENT MANAGEMENT LOCAL 
  SEGMENT SPACE MANAGEMENT AUTO; 
CREATE TABLESPACE APEX_FILES DATAFILE 
 'D:\ORACLE\ORACLEXE\APP\ORACLE\ORADATA\XE\APEX_FILES.DBF' 
 SIZE 500M EXTENT MANAGEMENT LOCAL 
 SEGMENT SPACE MANAGEMENT AUTO;

Now check as SYS user that everything works fine and the tablespaces have been created. For instance, via this SQL statement:

/* takes care for the data files */
SELECT /* + RULE */  
       df.tablespace_name "Tablespace",
       df.bytes / (1024 * 1024) "Size (MB)",
       SUM(fs.bytes) / (1024 * 1024) "Free (MB)",
       NVL(ROUND(SUM(fs.bytes) * 100 / df.bytes),1) "% Free",
       ROUND((df.bytes - SUM(fs.bytes)) * 100 / df.bytes) "% Used"
  FROM dba_free_space fs,
       (SELECT tablespace_name,
               SUM(bytes) bytes
          FROM dba_data_files
          GROUP BY tablespace_name
       ) df
  WHERE fs.tablespace_name (+) = df.tablespace_name
  GROUP BY df.tablespace_name, df.bytes
UNION ALL
/* takes care for the temp files */
SELECT /* + RULE */ 
       df.tablespace_name tspace,
       fs.bytes / (1024 * 1024),
       SUM(df.bytes_free) / (1024 * 1024),
       NVL(ROUND((SUM(fs.bytes) - df.bytes_used) * 100 / fs.bytes), 1),
       ROUND((SUM(fs.bytes) - df.bytes_free) * 100 / fs.bytes)
  FROM dba_temp_files fs,
       (SELECT tablespace_name,
               bytes_free,
               bytes_used
          FROM v$temp_space_header
          GROUP BY tablespace_name, bytes_free, bytes_used
       ) df
  WHERE fs.tablespace_name (+) = df.tablespace_name
  GROUP BY df.tablespace_name, fs.bytes, df.bytes_free, df.bytes_used
  ORDER BY 4 DESC; 

My result:

Tablespace Size

Then open a DOS command box “cmd” and navigate to your new unzipped Apex 5.0.4 directory.

In my case:

D:\Oracle\Apex\apex_5.0.4\apex\

apexins3

Next start sqlplus as SYS user and issue the following command:

sta apexins apex apex_files temp /i/

like this:

The four arguments apexins, apex, apex_files, temp and /i/ stand for:

arguments

It takes several minutes till the installation is ready.

The last installation lines of the DOS command box are:

last_lines

Apex is now up to date and we are ready for installing two more users. These are APEX_LISTENER and APEX_REST_PUBLIC_USER to prepare RESTful services.

Therefore we have to run as SYS user the following script in SQL*Plus:

sta apex_rest_config.sql

When Prompted, enter a password for the APEX_LISTENER and APEX_REST_PUBLIC_USER accounts. Take a note of the passwords, it will be required during the ORDS configuration.

To run the script apex_rest_config.sql is mandatory, if you wish to use RESTful Services with Apex and make use of static files, see comment below. An instance administrator can control the availability of RESTful Services. If the instance administrator (WS: Internal, User: Admin) has disabled this feature for this Application Express instance, RESTful Services won’t be available. Go to “Manage Instance => Instance Settings => Security” to change the value, if you want.

The off/on switching of RESTful Services has no impact for static files. This only applies to the RESTful Services defined in the “Region Definition” section of the Component View of the Application Builder for an application.

A comment to static files of Apex in Shared Components

Oracle Application Express enables application developers to include static files with their applications. Static files can be associated with a workspace, an application, a plug-in, or an application theme. When using Oracle REST Data Services as your web listener, static files are provided with the Oracle Application Express RESTful service module. Therefore, you must configure RESTful Services in new installations and in upgrade installations when RESTful Services were not configured in a previous release.

A remark to the new users:

  • APEX_LISTENER
    • this user queries RESTful Services definitions stored in Oracle Application Express.
    • DMLs for wwv_flow_rt$ tables have been granted to APEX_LISTENER.
  • APEX_REST_PUBLIC_USER
    • this user invokes RESTful Services definitions stored in Oracle Application Express.

 

In the next post entry we are going to the ORDS installation.

Leave a Reply

Close Menu