Howto Upgrade Apex 3.02 to Apex 4.02 on RedHat Linux 5 Oracle 11g

1). Goto http://www.oracle.com/technetwork/developer-tools/apex/downloads/index.html

2) Accept the license agree ment and click this link

Oracle Application Express 4.0.2 - All languages Download

3) Download the zip file

4) Transfer the zip file to your Oracle database server

5) unzip the zip file in a writeable directory (i.e. the directory must be wriable to the oracle user)

6) Log everyone out of Apex

7) Backup the applications of the database, depending on you rlevel of concern for the existing Apex install.

8) cd apex

9) Find the existing Apex tablspace by querying

SELECT TABLESPACE_NAME FROM DBA_TABLESPACES;10) Run apexins.sql as follows

sqlplus / as sysdba @apexins.sql TABLESPACE_APEX TABLESPACE_FILES TEMP IMAGES

EXAMPLE FROM MY SYSTEM

/home/oracle/apex> sqlplus / as sysdba @apexins.sql FLOW_1044904725428444 FLOW_1044904725428444 TEMP /i/

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

Session altered.
. ____ ____ ____ ____
. / \ | \ /\ / | /
.| || / / \ | | |
.| ||--- ---- | | |--
.| || \ / \ | | |
. \____/ | \/ \ \____ |____ \____
.
. Application Express (APEX) Installation.
..........................................
.
... Checking prerequisites

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.
.
... Prerequisite check complete. Result passed.
.

10) Now wait as quite a lot of information scrolls by and your Apex 3.x installation is upgraded to 4.02. One my quad core VM with 11g and 4 gigs of RAM this took about 20 minutes.

11) Here some information that you might need, it scrolls by if you weren't watching closely right at the end.

Capture the following information at the end of the install, you might need it later:

Oracle Application Express is installed in the APEX_040000 schema.

The structure of the link to the Application Express administration services is as follows:
http://host:port/pls/apex/apex_admin (Oracle HTTP Server with mod_plsql)
http://host:port/apex/apex_admin (Oracle XML DB HTTP listener with the embedded PL/SQL gateway)

The structure of the link to the Application Express development interface is as follows:
http://host:port/pls/apex (Oracle HTTP Server with mod_plsql)
http://host:port/apex (Oracle XML DB HTTP listener with the embedded PL/SQL gateway)

Thank you for installing Oracle Application Express.

Oracle Application Express is installed in the APEX_040000 schema.

Performing Application Express component validation - please wait...

If you are using Oracle 11g Native Embedded PL/SQL Gateway then do the following:

13) sqlplus / as sysdba @apex_epg_config.sql $ORACLE_HOME

14 ) Your ADMIN password should be preserved from your old install to the new one.

15) sqlplus / as sysdba @apex_epg_config.sql $ORACLE_HOME

16) sqlplus / as sysdba @apxchpwd.sql

17) sqlplus / as sysdba @apxconf

18) sqlplus / as sysdba @apxldimg.sql $ORACLE_HOME

If you have made a mistake in the images path, then this command will reset your image location. You will know if this occurred if your Apex installation is valid but you cannot see the images when you login to Apex with a web browser.

In that case do this

19) cd apex/utilities

20) sqlplus / as sysdba @reset_image_prefix.sql
SQL*Plus: Release 11.2.0.1.0 Production on Sun Nov 21 08:36:21 2010

Copyright (c) 1982, 2009, Oracle. All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SP2-0734: unknown command beginning "Changed j..." - rest of line ignored.

Enter the Application Express image prefix [/i/]
...Changing Application Express image prefix

NEW_IMAGE
---------
/i/

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

Session altered.

...Recreate APEX global

PL/SQL procedure successfully completed.

...Update image prefix for all internal Application Express applications

PL/SQL procedure successfully completed.

...Purge all cached region and page entries

PL/SQL procedure successfully completed.

...Recompiling the Application Express schema

PL/SQL procedure successfully completed.

Image Prefix update complete

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
oracle@ussjchstdb21