Thursday, 10 November 2016

Upgrade APEX from 4.2 to 5.0

1.  Download the zip file  of APEX 5.0  from oracle support.

.2. Change your working directory to apex.Where you want to unzip the file.

3.Pre-Installation checks

check the current version of apex.
select comp_name, version from dba_registry;

COMP_NAME                                          VERSION
-------------------------------------------------- --------------------------
Apex                                              4.2.0.3.0

select account_status from dba_users where username = 'APEX_PUBLIC_USER';

ACCOUNT_STATUS
--------------------------------
OPEN

select default_tablespace, temporary_tablespace from dba_users where username = 'APEX_040200';


DEFAULT_TABLESPACE             TEMPORARY_TABLESPACE
------------------------------ ------------------------------
APEX                                                     TEMP


 4. Upgradation 

The script we need to run to do the installation or upgradation is  – apexins.sql . It is not required to uninstall the previous version while upgrading 

–  the script takes three parameters :
  • The default tabelspace of the APEX owner schema
  • The default tablespace of FLOWS_FILES schema
  • A temporary tablespace in the database
  • A virtual directory for APEX images.

We already know that the default tablespace for the APEX owner is APEX
We also know that the temporary tablespace is called TEMP
As for the FLOWS_FILES schema…

select default_tablespace from dba_users where username = 'FLOWS_FILES';
DEFAULT_TABLESPACE
------------------------------
SYSAUX

Wo to your working directory where you unzip the binary file and run the below command for upgradation.

@apexins.sql APEX SYSAUX TEMP /i/

Once Upgradation complete the logs are look like below

..done load verification images
timing for: Verification Images Load
Elapsed: 00:00:00.63
Set Credentials...
Creating Packaged Application Wizard Information...
Check Compatibility...
...Delete Packaged Applications and associated images
...Load Packaged Application Categories
...Load Packaged Applications and associated images
...done
Application Express Packaged and Sample Applications installation data

...Remove existing packaged application data


...Load packaged application archive

API Last Extended:20130101
Your Current Version:20130101
This import is compatible with version: 20130101
COMPATIBLE (You should be able to run this import without issues.)
--workspace/static/files
... elapsed: 40.3 sec
...done

...Expand packaged application archive

...done
timing for: Install Packaged and Sample Applications
Elapsed: 00:00:44.94

Session altered.


Package body altered.


Package body altered.

-- Enabling ws constraints. -------

PL/SQL procedure successfully completed.


Session altered.

...Adjust Application Express (APEX) owner and version

14 rows updated.


Commit complete.

timing for: Install Internal Applications
Elapsed: 00:10:22.51

Revoke succeeded.

JOB_QUEUE_PROCESSES: 4

PL/SQL procedure successfully completed.


Session altered.


Performing Application Express component validation - please wait...

Completing registration process. 07:59:19
Validating installation.  07:59:19
...Starting validation 07:59:19
...Database user "SYS", database schema "APEX_050000", user# "132" 07:59:19
...270 packages
...263 package bodies
...465 tables
...8 functions
...16 procedures
...4 sequences
...497 triggers
...1582 indexes
...255 views
...0 libraries
...14 types
...5 type bodies
...0 operators
...0 index types
...Begin key object existence check 07:59:52
...Completed key object existence check 07:59:52
...Setting DBMS Registry 07:59:52
...Setting DBMS Registry Complete 07:59:52
...Exiting validate 07:59:52

PL/SQL procedure successfully completed.

timing for: Validate Installation
Elapsed: 00:00:33.20

Session altered.

timing for: Complete Installation
Elapsed: 00:23:59.23

PL/SQL procedure successfully completed.




Thank you for installing Oracle Application Express 5.0.4.00.12

Oracle Application Express is installed in the APEX_050000 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)
http://host:port/apex/apex_admin     (Oracle REST Data Services)

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)
http://host:port/apex     (Oracle REST Data Services)


PL/SQL procedure successfully completed.


5. Upgrade Application Express password:
  •         SQL> @apxchpwd
    
            Enter password for Application Express ADMIN account.
                 Provide the password to application team

6. Configure APEX_PUBLIC_USER Account


ALTER USER APEX_PUBLIC_USER ACCOUNT UNLOCK;
ALTER USER APEX_PUBLIC_USER IDENTIFIED BY password

Incase application team facing any  connectivity issue :


A. verify the port number where the Oracle XML DB HTTP Server is running. 

SELECT DBMS_XDB.GETHTTPPORT FROM DUAL; 

EXEC DBMS_XDB.SETHTTPPORT(8080); ---if above return port 0

B.Enable Network Services

DECLARE
ACL_PATH VARCHAR2(4000);
BEGIN
-- Look for the ACL currently assigned to '*' and give APEX_040200
-- the "connect" privilege if APEX_040200 does not have the privilege yet.
SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS
WHERE HOST = '*' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL;
IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'APEX_040200','connect') IS NULL THEN
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH,'APEX_040200', TRUE, 'connect');
END IF;
EXCEPTION
WHEN NO_DATA_FOUND THEN
DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('power_users.xml',
'ACL that lets power users to connect to everywhere',
'APEX_040200', TRUE, 'connect');
DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('power_users.xml','*');
END;
/



No comments:

Post a Comment