Monday, 20 June 2016

Upgrading Apex from 4.0.2 to 4.2 in Oracle XE


This post features the steps to upgrade Apex 4.0.2 to 4.2.2 in a Windows XE database.
The process of upgrading apex is pretty standard so this guide can apply a few versions of Apex.

OVERVIEW:
1. Create the APEX_DATA tablespace
2. Extract the APEX install files into a working directory
3. Shutdown the APEX gateway listener
4. Run the installation file
5. Check the registry and post installation status
6. Startup the APEX gateway listener

1. Create the APEX_DATA tablespace

CREATE TABLESPACE apex_data DATAFILE 'C:\ORACLE\APP\ORACLE\ORADATA\XE\APEX_DATA.DBF' SIZE 2G LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;

2. Shutdown the APEX gateway listener
EXEC DBMS_XDB.sethttpport(0);

3. Extract the APEX install files into a working directory









I’ve moved the old $ORACLE_HOME/apex directory aside into $ORACLE_HOME/apex.4.0.2
I’ve extracted the 4.2.2 zip file into the $ORACLE_HOME/apex directory

4. Run the installation file

In cmd, change directory to your apex directory:
C:\oracle\app\oracle\product\11.2.0\server\apex

Log in to sqlplus as sysdba
sqlplus /nolog
conn / as sysdba

Check the current apex version in the database
SQL> select comp_name, version, status from dba_registry where comp_name = 'Oracle Application Express';

COMP_NAME                    VERSION          STATUS
---------------------------- ---------------- ------------------
Oracle Application Express   4.0.2            VALID

Run the apex installer
SQL> @apexins.sql APEX_DATA APEX_DATA TEMP /i/
.  ____   ____           ____        ____
. /    \ |    \   /\    /     |     /
.|      ||    /  /  \  |      |    |
.|      ||---    ----  |      |    |-- 
.|      ||   \  /    \ |      |    |
. \____/ |    \/      \ \____ |____ \____
.
. Application Express (APEX) Installation.
..........................................
.
... Checking prerequisites (MANUAL)
.

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.


PL/SQL procedure successfully completed.

.
... Prerequisite checks passed.
.

Performing Application Express component validation - please wait...

old   6:     if '^UPGRADE' = '1' then
new   6:     if '2' = '1' then
old   7:        dbms_registry.loaded('APEX','^version');
new   7:        dbms_registry.loaded('APEX','4.2.2.00.11');
old   8:     elsif '^UPGRADE' = '2' then
new   8:     elsif '2' = '2' then
old  10:             dbms_registry.upgraded('APEX','^version');
new  10:             dbms_registry.upgraded('APEX','4.2.2.00.11');
old  12:             dbms_registry.loaded('APEX','^version');
new  12:             dbms_registry.loaded('APEX','4.2.2.00.11');
Completing registration process. 08:59:08
Validating installation.  08:59:08
...Database user "SYS", database schema "APEX_040200", user# "49" 08:59:08
...Compiled 0 out of 3004 objects considered, 0 failed compilation 08:59:09
...266 packages
...258 package bodies
...452 tables
...11 functions
...16 procedures
...3 sequences
...457 triggers
...1320 indexes
...211 views
...0 libraries
...6 types
...0 type bodies
...0 operators
...0 index types
...Begin key object existence check 08:59:09
...Completed key object existence check 08:59:09
...Setting DBMS Registry 08:59:09
...Setting DBMS Registry Complete 08:59:09
...Exiting validate 08:59:09

PL/SQL procedure successfully completed.

timing for: Validate Installation
Elapsed: 00:00:00.53
old   1: alter session set current_schema = ^APPUN
new   1: alter session set current_schema = APEX_040200

Session altered.

timing for: Complete Installation
Elapsed: 00:18:40.58

PL/SQL procedure successfully completed.


GLOBAL_NAME
------------------------------
SYS

1 row selected.

The apex installer will run for about 10-20 minutes while it reinstalls its libraries.

It will boot you out once it has completed.

5. Check the registry and post installation status
SQL> select comp_name, version, status from dba_registry where comp_name = 'Oracle Application Express';

COMP_NAME                      VERSION                        STATUS
------------------------------ ------------------------------ ---------------
Oracle Application Express     4.2.2.00.11                    VALID

SQL>

6. Startup the APEX gateway listener
EXEC DBMS_XDB.sethttpport(8080);

Done


No comments:

Post a Comment