Apex upgrade on new install 11g using ohs standalone web server

Steps to upgrade from the base apex 3 to apex 4.1 on a new install of 11g database using ofm11g ohs as the web server.

sudo su – oracle

mkdir /home/stage –p

chmod 775 /home/stage

mv apex_4.1.1en.zip /home/stage

cd /home/stage

unzip apex_4.1.1en.zip

cd /home/stage/apex

sqlplus / as sysdba

@apexins SYSAUX SYSAUX TEMP /i/

@apxldimg.sql /home/stage

On the database server run the following

cd $ORACLE_HOME <- database home

cd apex

  1. DRIVE_LETTER:\> sqlplus /nolog
    SQL> CONNECT SYS as SYSDBA
    Enter password: SYS_password


  2. Run apxxepwd.sql. For example:

    @apxxepwd.sql

Set the password

unlock public account

ALTER USER APEX_PUBLIC_USER ACCOUNT UNLOCK

change the public user password

sql> PASSWORD APEX_PUBLIC_USER;

<new password>


on ohs server


modify dads.conf



  1. Alias /i/ "ORACLE_BASE\ORACLE_HTTPSERVER_HOME\images/"
    AddType text/xml xbl
    AddType text/x-component htc

    <Location /pls/apex>
    Order deny,allow
    PlsqlDocumentPath docs
    AllowOverride None
    PlsqlDocumentProcedure wwv_flow_file_mgr.process_download
    PlsqlDatabaseConnectString host:port:service_name ServiceNameFormat
    PlsqlNLSLanguage AMERICAN_AMERICA.AL32UTF8
    PlsqlAuthenticationMode Basic
    SetHandler pls_handler
    PlsqlDocumentTablename wwv_flow_file_objects$
    PlsqlDatabaseUsername APEX_PUBLIC_USER
    PlsqlDefaultPage apex
    PlsqlDatabasePassword apex_public_user_password
    Allow from all
    </Location>

  2. copy images from apex images directory on database to location on web server where I is mapped

 


Allow access with acl


 

DECLARE
ACL_PATH VARCHAR2(4000);
ACL_ID RAW(16);
BEGIN

SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS
WHERE HOST = '*' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL;

SELECT SYS_OP_R2O(extractValue(P.RES, '/Resource/XMLRef')) INTO ACL_ID
FROM XDB.XDB$ACL A, PATH_VIEW P
WHERE extractValue(P.RES, '/Resource/XMLRef') = REF(A) AND
EQUALS_PATH(P.RES, ACL_PATH) = 1;

DBMS_XDBZ.ValidateACL(ACL_ID);
IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'APEX_040100',
'connect') IS NULL THEN
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH,
'APEX_040100', 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_040100', TRUE, 'connect');
DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('power_users.xml','*');
END;
/
COMMIT;