Oracle recently released version 4.2.4 of its Application Express (APEX) software. This post is to document how to upgrade Oracle APEX from 4.2.3 to 4.2.4.
The Oracle APEX installation to be upgraded has the following specification:
- The operating system of the server is CentOS 6.5.
- The Oracle Database version is Oracle XE 11gR2.
- Oracle APEX is served using the APEX Listener, via GlassFish 4.
Download and read the Patch Set Notes
First things first, read up on the patch set notes here.
Download and unzip the Patch Set
Next, the patch set is downloaded via Oracle Support.
The downloaded patch set is then extracted.
[oracle@server ~]$ unzip p17607802_424_Generic.zip
The database is backed up as a precaution if the patch is unsuccessful.
I prefer a cold and consistent backup to ease the recovery process.
[oracle@server ~]$ rman target / nocatalog Recovery Manager: Release 184.108.40.206.0 - Production on Tue Jan 7 12:33:41 2014 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. connected to target database: XE (DBID=2709648321) using target database control file instead of recovery catalog RMAN> shutdown immediate database closed database dismounted Oracle instance shut down RMAN> startup mount connected to target database (not started) Oracle instance started database mounted RMAN> backup database plus archivelog; RMAN> alter database open; database opened RMAN> exit Recovery Manager complete.
Prevent access to the APEX instance
No users should be using the APEX installation while it is being upgraded. Access to the instance should be limited. In this particular case, since APEX is served by the APEX Listener which is hosted by a GlassFish instance, user access is prevented by shutting down the GlassFish instance.
[oracle@server ~]$ sudo service glassfish4 stop Shutting down glassfish4: Waiting for the domain to stop ... Command stop-domain executed successfully. [ OK ]
The above command is used to control the GlassFish installation only if the corresponding service init script has already been correctly created. An example on how this is done can be found here.
Apply the patch set
Now, set the current directory to the patch directory, and apply the patch.
[oracle@server ~]$ cd patch [oracle@server patch]$ sqlplus / as sysdba SQL*Plus: Release 220.127.116.11.0 Production on Tue Jan 7 16:07:39 2014 Copyright (c) 1982, 2011, Oracle. All rights reserved. Connected to: Oracle Database 11g Express Edition Release 18.104.22.168.0 - 64bit Production SQL> @apxpatch.sql
The patch will now be applied, and the process will take a few minutes.
Copy patch directory contents into APEX directory
After the patch process is completed, it is time to copy the contents of the patch directory into the original APEX installation directory.
[oracle@server patch]$ cp -R * /path/to/apex/
This will include the images directory as well, and if the path to the APEX directory is the same one used to originally create the images WAR file, the WAR file need not be recreated.
The final step is to restart the GlassFish instance.
[oracle@server ~]$ sudo service glassfish4 start Starting glassfish4: Waiting for domain1 to start ..................................................... Successfully started the domain : domain1 domain Location: /home/gfish/glassfish4/glassfish/domains/domain1 Log File: /home/gfish/glassfish4/glassfish/domains/domain1/logs/server.log Admin Port: 4848 Command start-domain executed successfully. [ OK ]
Now the APEX installation is successfully updated to version 4.2.4, and is ready to be accessed.