Install and configure Apex 5.0.X embedded PL/SQL

This article presents how to install and configure Apex for version 5.0.X for Oracle 11G

Prepare software to installation

Download installation package from Oracle site and unzip.

Download apex_5.0.X.zip to directory /tmp and unzip it from
http://www.oracle.com/technetwork/developer-tools/apex/downloads/index.html

cd /tmp
unzip <downloaded software>

After unzip is completed a new directory will be created /tmp/apex so go to this directory and log into database as SYSDBA. Always use SYSDBA account for running all scripts.

cd /tmp/apex
sqlplus / as sysdba

Pre-installation steps

It’s recommended to do backup of the database and disable the Oracle XMLDB HTTP server by setting the HTTP port to 0.

EXEC DBMS_XDB.SETHTTPPORT(0);

Install full development option

@apexins tablespace_apex tablespace_files tablespace_temp images

tablespace_apex - name of the tablespace for APEX user.
tablespace_files - name of the tablespace for APEX files user.
tablespace_temp - name of the temporary tablespace.
images - virtual directory for APEX images. Define the virtual 
image directory as /i/ for future updates.

@apexins SYSAUX SYSAUX TEMP /i/
When Oracle Application Express installs, it creates three new database accounts:
  • APEX_050000 – The account that owns the Oracle Application Express schema and metadata.
  • FLOWS_FILES – The account that owns the Oracle Application Express uploaded files.
  • APEX_PUBLIC_USER – The minimally privileged account is used for Oracle Application Express configuration with Oracle Application Express Listener or Oracle HTTP Server and mod_plsql.

Change password for ADMIN account. When prompted enter a password for the ADMIN account.

@apxchpwd

Configure embedded PL/SQL Gateway and unlock ANONYMOUS account. One important note – you are calling script from directory /tmp/apex but you need to specify /tmp. It can seem a little bit weird.

@apex_epg_config /tmp
ALTER USER ANONYMOUS ACCOUNT UNLOCK;

Verifying Oracle XML DB HTTP Server Port and set it to 8080

SELECT DBMS_XDB.GETHTTPPORT FROM DUAL;
EXEC DBMS_XDB.SETHTTPPORT(port);
EXEC DBMS_XDB.SETHTTPPORT(8080);

Enable Network Services in 11g

By default, the ability to interact with network services is disabled in Oracle Database 11g release 1 or 2. Therefore, if you are running Oracle Application Express with Oracle Database 11g release 1 or 2, you must use the new DBMS_NETWORK_ACL_ADMIN package to grant connect privileges to any host for the APEX_050100 database user. User name can change with next releases to APEX_050200, APEX_050XXXX so keep it in mind.

DECLARE
  ACL_PATH  VARCHAR2(4000);
BEGIN
  -- Look for the ACL currently assigned to '*' and give APEX_050100
  -- the "connect" privilege if APEX_050100 
  --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_050100',
     'connect') IS NULL THEN
      DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH,
     'APEX_050100', TRUE, 'connect');
  END IF;
 
EXCEPTION
  -- When no ACL has been assigned to '*'.
  WHEN NO_DATA_FOUND THEN
  DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('power_users.xml',
    'ACL that lets power users to connect to everywhere',
    'APEX_050100', TRUE, 'connect');
  DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('power_users.xml','*');
END;
/
COMMIT;

Configure database parameters for APEX

JOB_QUEUE_PROCESSES must be set to at least 20

ALTER SYSTEM SET JOB_QUEUE_PROCESSES = <number>
ALTER SYSTEM SET JOB_QUEUE_PROCESSES = 20 SCOPE = BOTH;

The embedded PL/SQL gateway uses the shared server architecture of the Oracle database. For a small group of concurrent users, Oracle recommends a value of 5 for SHARED_SERVERS.

ALTER SYSTEM SET SHARED_SERVERS = 5 SCOPE=BOTH;

Verify APEX is working

Administration page

http://hostname:port/apex/apex_admin

Development page

http://hostname:port/apex

apex5_login apex5_login_main

Have a fun 🙂

Tomasz

 

18 thoughts on “Install and configure Apex 5.0.X embedded PL/SQL

  1. I am trying to install Apex for the last 3/4 months, installation part is very easy and in fact as a last attempt, I followed all the above steps, exactly like that. But still I couldn’t get the login screen. Somehow that port is not active and not seeing anything listening on it. Whereas we can see 8007 is active for EBS connections but 8080 is not active, I am really fed up with it, the installation steps are very straight forwards, but not getting the login screen, please help.
    [oracle@heuhfs01 dbs]$ netstat -an | grep 8007
    tcp 0 0 0.0.0.0:8007 0.0.0.0:* LISTEN
    [oracle@heuhfs01 dbs]$ netstat -an | grep 8080
    [oracle@heuhfs01 dbs]$

      • Please see our below listener.ora file, I am not seeing any updated related to Apex, besides that we are running SQLs to install Apex, how can it possible for a SQL script to update listener.ora, I doubt those SQL file does that, unless we need to manually update the listener, please advise.

        heuhfs
        [SSH] Server Version OpenSSH_4.3
        [SSH] Logged in (password)

        Last login: Mon Apr 27 15:57:45 2015 from 41330502.cst.lightpath.net
        [root@heuhfs01 ~]# su – oracle
        [oracle@heuhfs01 ~]$ cd $TNS_ADMIN
        [oracle@heuhfs01 VIS5_heuhfs01]$ more listener.ora
        #
        # $Header: ad8ilsnr.ora 120.3 2007/12/18 10:13:38 sbandla ship $
        #
        # ###############################################################
        #
        # This file is automatically generated by AutoConfig. It will be read and
        # overwritten. If you were instructed to edit this file, or if you are not
        # able to use the settings created by AutoConfig, refer to Metalink Note
        # 387859.1 for assistance.
        #
        # ###############################################################

        #

        #
        # Net8 definition for Database listener
        #

        VIS5 =
        (DESCRIPTION_LIST =
        (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = heuhfs01.sparksolution.com)(PORT = 1528))
        )
        )

        SID_LIST_VIS5 =
        (SID_LIST =
        (SID_DESC =
        (ORACLE_HOME= /u03/oracle/VIS5/db/tech_st/11.1.0)
        (SID_NAME = VIS5)
        )
        )

        STARTUP_WAIT_TIME_VIS5 = 0
        CONNECT_TIMEOUT_VIS5 = 10
        TRACE_LEVEL_VIS5 = OFF

        LOG_DIRECTORY_VIS5 = /u03/oracle/VIS5/db/tech_st/11.1.0/network/admin
        LOG_FILE_VIS5 = VIS5
        TRACE_DIRECTORY_VIS5 = /u03/oracle/VIS5/db/tech_st/11.1.0/network/admin
        TRACE_FILE_VIS5 = VIS5
        ADMIN_RESTRICTIONS_VIS5 = OFF
        SUBSCRIBE_FOR_NODE_DOWN_EVENT_VIS5 = OFF

        IFILE=/u03/oracle/VIS5/db/tech_st/11.1.0/network/admin/VIS5_heuhfs01/listener_ifile.ora
        [oracle@heuhfs01 VIS5_heuhfs01]$ more IFILE=/u03/oracle/VIS5/db/tech_st/11.1.0/network/admin/VIS5_heuhfs01/listener_ifile.ora
        IFILE=/u03/oracle/VIS5/db/tech_st/11.1.0/network/admin/VIS5_heuhfs01/listener_ifile.ora: No such file or directory
        [oracle@heuhfs01 VIS5_heuhfs01]$

  2. Thanks for tutorial!
    I got working apex 5.0 with the first try!
    my environment – wmware with windows server 2008r2, Oracle Database 12c Release 1 enterprise ed.

    • HI ,

      Please let me know how Apex 5 was installed in 12C version. I am facing issue with a blank screen launching after installtion.Please share any document or link to solve this issue

  3. If you want to access APEX from remote addresses it is required to allow access to the XML DB HTTP server non-localhost interfaces.

    Enable remote HTTP connections (optional):
    SQL> EXEC dbms_xdb.setListenerLocalAccess(l_access => FALSE);

    If l_access is set to TRUE, setListenerLocalAccess allows access to the XML DB HTTP server on the localhost only.
    If l_access is set to FALSE, setListenerLocalAccess allows access to the XML DB HTTP server on both the localhost and non-localhost interfaces i.e. remote connections.

    • Thanks, Frank! Great help!
      I tried to manage the remote connection this morning after I upgraded yesterday to Apex 5. This is the step I missed out on!
      Is this new for 5? As I had the standard 4 on XE running for quite some time, and on several instances also upgraded to 4.2.6 without having to change this setting before.

  4. Hi, How can I turn SSL active? I´ve already tried, but I lost access after turn on! I would like to use a wildcard certificate. Is it possible use?

  5. I have the same problem as Cristian. I set require HTTPS to “Always” (APEX 5) and I can no longer access my application. What is the proper way to enable SSL?

Leave a Reply to Warren Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.