5 Installing Application Express and Configuring Embedded PL/SQL Gateway

In order to run, Oracle Application Express must have access to a Web listener. To use the Embedded PL/SQL Gateway with Oracle Application Express, you must first install Oracle Application Express and then configure the Embedded PL/SQL Gateway. These instructions apply to both new and upgrade installations.

5.1 Oracle Database Requirement

Oracle Application Express release 5.0 requires an Oracle Database Release 11.1.0.7 or later, including Enterprise Edition and Express Edition (Oracle Database XE).

5.2 About Patching Oracle Application Express

If you are already running Oracle Application Express, then check the Oracle Application Express page on the Oracle Technology Network (OTN) for information about patch set releases or later releases of Oracle Application Express:

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

5.3 Performing Pre-installation Tasks for Oracle Application Express

Before installing Oracle Application Express, Oracle recommends that you complete the following steps:

  1. Review and satisfy all Oracle Application Express installation requirements. See "Oracle Application Express Installation Requirements."

  2. If you are actively using Oracle Application Express and upgrading the current installation then shut down with normal or immediate priority the Oracle Database instances where you plan to install Oracle Application Express. On Oracle Real Application Clusters (Oracle RAC) systems, shut down all instances on each node.

    An alternative to shutting down the database is to prevent all users from accessing Oracle Application Express when upgrading your installation from a previous release of Oracle Application Express. Oracle only recommends this option in high availability production environments where planned outages are not available. For all other scenarios, the database should be shut down.

    To disable access to Oracle Application Express when an existing installation is using the Embedded PL/SQL Gateway, disable the Oracle XML DB Protocol Server by setting the HTTP port to 0. Start SQL*Plus, connect as SYS to the database where Oracle Application Express is installed, and run:

    EXEC DBMS_XDB.SETHTTPPORT(0);
    

    Once you have prevented access from Oracle Application Express users, you should log in to SQL*Plus as SYS, connecting to the database where Oracle Application Express is installed, and query V$SESSION to ensure there are no long running sessions which would interfere with the upgrade process.

  3. Back up the Oracle Database installation.

    Oracle recommends that you create a backup of the current Oracle Database installation before you install Oracle Application Express. You can use Oracle Database Recovery Manager, which is included in the Oracle Database installation, to perform the backup.

  4. Start the Oracle Database instance that contains the target database.

    After backing up the system, you must start the Oracle instance that contains the target Oracle Database. Do not start other processes such as a Web listener. However, if you are performing a remote installation, make sure the Web listener for the remote database has started.

    Note:

    If you are connecting to a remote database, then start the Web listener.

5.4 Installing Oracle Application Express

How you install Oracle Application Express depends upon how you access the installation script and the type of database you into which you are installing.

5.4.1 Accessing the Installation Script

How you access the Oracle Application Express installation script depends upon whether you download the Oracle Application Express distribution from Oracle Technology Network (OTN), or install the version that ships with Oracle Database 12c Release 2 (12.2).

5.4.1.1 Downloading the Script from Oracle Technology Network

To download the script from the Oracle Application Express download page:

  1. For installations where the development will be in English only, download the file apex_5.0_en.zip from the Oracle Application Express download page. If the development will include languages other than English, download apex_5.0.zip from the Oracle Application Express download page. See:

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

    Note that the actual file name may differ if a more recent release has shipped since this document was published.

  2. Unzip downloaded zip file:

    • If English only, unzip apex_5.0_en.zip as follows, preserving directory names:

      • UNIX and Linux: $ unzip apex_5.0_en.zip

      • Windows: Double click the file apex_5.0_en.zip in Windows Explorer

    • If multiple languages, unzip apex_5.0.zip as follows, preserving directory names:

      • UNIX and Linux: $ unzip apex_5.0.zip

      • Windows: Double click the file apex_5.0.zip in Windows Explorer

    Note:

    You should keep the directory tree where you unzip the files short and not under directories that contain spaces. For example, within Windows unzip to C:\TEMP.
  3. Change your working directory to apex.

  4. Run the installation script. Go to the next section, "Running the Application Express Installation Script."

5.4.1.2 Accessing the Script Shipping with Oracle Database 12c Release 2 (12.2)

To access the script shipping with Oracle Database 12c Release 2 (12.2):

  1. Change your working directory to $ORACLE_HOME/apex.

  2. Run the installation script. Go to the next section, "Running the Application Express Installation Script."

5.4.2 Running the Application Express Installation Script

To run the Oracle Application Express installation script:

  1. Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example:

    • On Windows:

      SYSTEM_DRIVE:\ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
    • On UNIX and Linux:

      $ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
  2. Disable any existing password complexity rules for the default profile. See "Configuring Password Protection" in Oracle Database Security Guide.

  3. Select an installation option.

    Full development environment provides complete access to the Application Builder environment to develop applications. A Runtime environment enables users to run applications that cannot be modified.

    • Full development environment.

      Run apexins.sql passing the following four arguments in the order shown:

      @apexins.sql tablespace_apex tablespace_files tablespace_temp images
      

      Where:

      • tablespace_apex is the name of the tablespace for the Oracle Application Express application user.

      • tablespace_files is the name of the tablespace for the Oracle Application Express files user.

      • tablespace_temp is the name of the temporary tablespace or tablespace group.

      • images is the virtual directory for Oracle Application Express images. To support future Oracle Application Express upgrades, define the virtual image directory as /i/.

      Example:

      @apexins.sql SYSAUX SYSAUX TEMP /i/
      

      Note:

      If you receive the following error, exit SQL*Plus and change your working directory to where you unzipped the installation file, for example C:\TEMP in Windows, before starting SQL*Plus:

      SP2-0310: unable to open file "apexins.sql"

    • Runtime environment. Run apxrtins.sql passing the following arguments in the order shown:

      @apxrtins.sql tablespace_apex tablespace_files tablespace_temp images
      

      Where:

      • tablespace_apex is the name of the tablespace for the Oracle Application Express application user.

      • tablespace_files is the name of the tablespace for the Oracle Application Express files user.

      • tablespace_temp is the name of the temporary tablespace or tablespace group.

      • images is the virtual directory for Oracle Application Express images. To support future Oracle Application Express upgrades, define the virtual image directory as /i/.

      Example:

      @apxrtins.sql SYSAUX SYSAUX TEMP /i/
      

See Also:

Oracle Database PL/SQL Language Reference for more information about SQL*Plus

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 REST Data Services or Oracle HTTP Server and mod_plsql.

If you are upgrading from a previous release, then FLOWS_FILES already exists and APEX_PUBLIC_USER is created if it does not already exist.

Tip:

Oracle Application Express must be installed from a writable directory on the file system. See "Reviewing a Log of an Installation Session."

5.4.3 Creating or Updating Your Instance Administration Account

This section describes how to create or update your Instance Administrator account.

Tip:

Skip this section if you are upgrading from a previous release of Oracle Application Express. In an upgrade scenario, the Instance Administrator account and password is preserved and carried over from the prior release.

5.4.3.1 What Is an Instance Administrator?

Instance administrators are superusers that are responsible for managing an entire Oracle Application Express instance, including managing workspace provisioning, configuring features and instance settings, and managing security. To perform these tasks, an Instance administrator signs in to the Oracle Application Express Administration Services application.

See Also:

"Oracle Application Express Administration Services" in Oracle Application Express Administration Guide

5.4.3.2 About apxchpwd.sql

Running the apxchpwd.sql script enables your to create or update your Instance Administrator account. You must run the apxchpwd.sql script in the following scenarios:

  • New Oracle Application Express installations - Run apxchpwd.sql to create an Instance Administrator account and password.

  • Converting of a runtime environment to a development environment - Run apxchpwd.sql to change the Instance Administrator account password.

  • Changing Your Instance Administrator Password -Run apxchpwd.sql to change the password for an existing Instance Administrator account.

  • Unlocking Your Instance Administrator Account - Run apxchpwd.sql to unlock an existing Instance Administrator account.

Tip:

You do not need to run apxchpwd.sql when upgrading from a previous release of Oracle Application Express. In an upgrade scenario, the Instance Administrator account password is preserved and carried over from the prior release.

5.4.3.3 Running apxchpwd.sql

To create or update your Instance Administrator account:

  1. Change your working directory to the apex directory where you unzipped the installation software.

  2. Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example:

    • On Windows:

      SYSTEM_DRIVE:\ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
    • On UNIX and Linux:

      $ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
  3. Run apxchpwd.sql. For example:

    @apxchpwd.sql
    

    Follow the on-screen instructions. You will be prompted provide a username, password, and email address. If the account username does not exist, it will be created for you.

See Also:

Oracle Database PL/SQL Language Reference for more information about SQL*Plus

5.4.4 Restarting Processes

After you install Oracle Application Express, you must restart the processes that you stopped before you began the installation.

5.5 Configuring the Embedded PL/SQL Gateway

The Embedded PL/SQL Gateway installs with the Oracle Database 11g and later. However, you must configure it before you can use it with Oracle Application Express. To configure the Embedded PL/SQL Gateway, you run a configuration script and unlock the ANONYMOUS account.

Note:

The Oracle XML DB Protocol Server with the Embedded PL/SQL Gateway is not supported before Oracle Database 11g.

5.5.1 Running the apex_epg_config.sql Configuration Script

You configure the Embedded PL/SQL Gateway by running the configuration script apex_epg_config.sql. Then, you unlock the ANONYMOUS account.

To run the apex_epg_config.sql configuration script:

  1. Change your working directory to the apex directory where you unzipped the Oracle Application Express software.

  2. Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example:

    • On Windows:

      SYSTEM_DRIVE:\ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
    • On UNIX and Linux:

      $ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
  3. If you are configuring a PDB, enter the following statement:

    ALTER SESSION SET CONTAINER = <PDB_NAME>;
    
  4. Run apex_epg_config.sql passing the file system path to the base directory where the Oracle Application Express software was unzipped as shown in the following example:

    • On Windows:

      @apex_epg_config.sql SYSTEM_DRIVE:\TEMP
      
    • On UNIX and Linux:

      @apex_epg_config.sql /tmp
      
  5. Enter the following statement to unlock the ANONYMOUS account:

    ALTER USER ANONYMOUS ACCOUNT UNLOCK;
    

5.5.2 Updating the Images Directory When Upgrading from a Previous Release

If you are upgrading Oracle Application Express from a previous release, you must run the apex_epg_config.sql script to update the images directory.

Tip:

If this is a new installation, this step is unnecessary. The images will be loaded by running apex_epg_config.sql as described in the prior section.

To run the apex_epg_config.sql script:

  1. Change your working directory to the apex directory where you unzipped the Oracle Application Express software.

  2. Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role:

    • On Windows:

      SYSTEM_DRIVE:\ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
    • On UNIX and Linux:

      $ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
  3. Run apex_epg_config.sql passing the file system path to the base directory where the Oracle Application Express software was unzipped as shown in the following example:

    • On Windows:

      @apex_epg_config.sql SYSTEM_DRIVE:\TEMP
      
    • On UNIX and Linux:

      @apex_epg_config.sql /tmp
      

    Tip:

    The above examples assume that you unzipped Oracle Application Express in a directory called TEMP on Windows and tmp on UNIX or Linux.

5.5.3 Verifying the Oracle XML DB Protocol Server Port

The Embedded PL/SQL Gateway runs in the Oracle XML DB Protocol Server in the Oracle database. You can determine if the Oracle XML DB Protocol Server is enabled by verifying the associated port number.

To verify the port number where the Oracle XML DB Protocol Server is running:

  1. Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role:

    • On Windows:

      SYSTEM_DRIVE:\ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
    • On UNIX and Linux:

      $ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
  2. Enter the following statement to verify the port number:

    SELECT DBMS_XDB.GETHTTPPORT FROM DUAL;
    

    If the port number returns 0, the Oracle XML DB Protocol Server is disabled.

  3. To enable it, follow the instructions in the sect section, "Enabling Oracle XML DB Protocol Server."

5.5.4 Enabling Oracle XML DB Protocol Server

The Embedded PL/SQL Gateway runs in the Oracle XML DB Protocol Server in the Oracle database.

To enable Oracle XML DB Protocol Server:

  1. Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example:

    • On Windows:

      SYSTEM_DRIVE:\ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
    • On UNIX and Linux:

      $ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
  2. Enter a statement similar to the following:

    EXEC DBMS_XDB.SETHTTPPORT(port);
    

    For example:

    EXEC DBMS_XDB.SETHTTPPORT(8080);
    

Note:

Port numbers less than 1024 are reserved for use by privileged processes on many operating systems. To enable the XML DB HTTP listener on a port less than 1024, such as 80, review the following documentation:

5.5.5 Configuring Static File Support

Oracle Application Express enables application developers to include static files with their applications. Static files can be associated with a workspace, an application, a plug-in, or an application theme. When using the embedded PL/SQL Gateway as your web listener, the necessary configuration to support static files is performed as part of the embedded PL/SQL Gateway configuration.

5.5.6 About Configuring Embedded PL/SQL Gateway Behind a Reverse Proxy or Load Balancer

If Oracle Application Express will be running behind a reverse proxy or load balancer, you set the CGI environment variables PROTOCOL and HTTP_HOST. For Embedded PL/SQL Gateway, you must call the following PL/SQL block:

  1. Change your working directory to the apex directory where you unzipped the installation software.

  2. Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example:

    • On Windows:

      SYSTEM_DRIVE:\ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
    • On UNIX and Linux:

      $ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
  3. Execute the following PL/SQL block:

    BEGIN
     DBMS_EPG.set_dad_attribute (
     dad_name => 'APEX',
     attr_name => 'cgi-environment-list',
     attr_value => 'REQUEST_PROTOCOL=https');
     DBMS_EPG.set_dad_attribute (
     dad_name => 'APEX',
     attr_name => 'cgi-environment-list',
     attr_value => 'HTTP_HOST=external-name:external-port');
     commit;
    END;
    /
    

To learn more, see your Java EE application servers documentation.

5.6 Enabling Network Services in Oracle Database 11g or Later

5.6.1 When and Why Network Services Must be Enabled

By default, the ability to interact with network services is disabled in Oracle Database 11g Release 1 or 2 or later. Therefore, if you are running Oracle Application Express with Oracle Database 11g Release 1 or 2 or later, you must use the new DBMS_NETWORK_ACL_ADMIN package to grant connect privileges to any host for the APEX_050000 database user. Failing to grant these privileges results in issues with:

  • Sending outbound mail in Oracle Application Express.

    Users can call methods from the APEX_MAIL package, but issues arise when sending outbound email.

  • Using Web services in Oracle Application Express.

  • PDF report printing.

Tip:

To run the examples described in this section, the compatible initialization parameter of the database must be set to at least 11.1.0.0.0. By default an Oracle 11g database will already have the parameter set properly, but a database upgraded to 11g or 12c database from a prior version may not. See "Creating and Configuring an Oracle Database" in Oracle Database Administrator's Guide for information about changing database initialization parameters.

5.6.2 Granting Connect Privileges Prior to Oracle Database 12c

The following example demonstrates how to grant connect privileges to any host for the APEX_050000 database user. This example assumes you connected to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role.

DECLARE
  ACL_PATH  VARCHAR2(4000);
BEGIN
  -- Look for the ACL currently assigned to '*' and give APEX_050000
  -- the "connect" privilege if APEX_050000 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_050000',
     'connect') IS NULL THEN
      DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH,
     'APEX_050000', 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_050000', TRUE, 'connect');
  DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('power_users.xml','*');
END;
/
COMMIT;

The following example demonstrates how to provide less privileged access to local network resources. This example enables access to servers on the local host only, such as email and report servers.

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

5.6.3 Granting Connect Privileges in Oracle Database 12c

Procedures CREATE_ACL, ASSIGN_ACL, ADD_PRIVILEGE and CHECK_PRIVILEGE in DBMS_NETWORK_ACL_ADMIN are deprecated in Oracle Database 12c. Oracle recommends using APPEND_HOST_ACE instead. The following example demonstrates how to grant connect privileges to any host for the APEX_050000 database user. This example assumes you connected to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role.

BEGIN
    DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE(
        host => '*',
        ace => xs$ace_type(privilege_list => xs$name_list('connect'),
                           principal_name => 'apex_050000',
                           principal_type => xs_acl.ptype_db));
END;
/

The following example demonstrates how to provide less privileged access to local network resources. This example enables access to servers on the local host only, such as email and report servers.

BEGIN
    DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE(
        host => 'localhost',
        ace => xs$ace_type(privilege_list => xs$name_list('connect'),
                           principal_name => 'apex_050000',
                           principal_type => xs_acl.ptype_db));
END;
/

5.6.4 Troubleshooting an Invalid ACL Error

If you receive an ORA-44416: Invalid ACL error after running the previous script, use the following query to identify the invalid ACL:

REM Show the dangling references to dropped users in the ACL that is assigned
REM to '*'.

SELECT ACL, PRINCIPAL
  FROM DBA_NETWORK_ACLS NACL, XDS_ACE ACE
 WHERE HOST = '*' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL AND
       NACL.ACLID = ACE.ACLID AND
       NOT EXISTS (SELECT NULL FROM ALL_USERS WHERE USERNAME = PRINCIPAL);

Next, run the following code to fix the ACL:

DECLARE
  ACL_ID   RAW(16);
  CNT      NUMBER;
BEGIN
  -- Look for the object ID of the ACL currently assigned to '*'
  SELECT ACLID INTO ACL_ID FROM DBA_NETWORK_ACLS
   WHERE HOST = '*' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL;

  -- If just some users referenced in the ACL are invalid, remove just those
  -- users in the ACL. Otherwise, drop the ACL completely.
  SELECT COUNT(PRINCIPAL) INTO CNT FROM XDS_ACE
   WHERE ACLID = ACL_ID AND
         EXISTS (SELECT NULL FROM ALL_USERS WHERE USERNAME = PRINCIPAL);

  IF (CNT > 0) THEN

    FOR R IN (SELECT PRINCIPAL FROM XDS_ACE
               WHERE ACLID = ACL_ID AND
                     NOT EXISTS (SELECT NULL FROM ALL_USERS
                                  WHERE USERNAME = PRINCIPAL)) LOOP
      UPDATE XDB.XDB$ACL
         SET OBJECT_VALUE =
               DELETEXML(OBJECT_VALUE,
                         '/ACL/ACE[PRINCIPAL="'||R.PRINCIPAL||'"]')
       WHERE OBJECT_ID = ACL_ID;
    END LOOP;

  ELSE
    DELETE FROM XDB.XDB$ACL WHERE OBJECT_ID = ACL_ID;
  END IF;

END;
/

REM commit the changes.

COMMIT;

Once the ACL has been fixed, you must run the first script in this section to apply the ACL to the APEX_050000 user. See "Granting Connect Privileges Prior to Oracle Database 12c."

5.7 Performing Security Tasks

Oracle highly recommends you configure and use Secure Sockets Layer (SSL) to ensure that passwords and other sensitive data are not transmitted in clear text in HTTP requests. Without the use of SSL, passwords could potentially be exposed, compromising security.

SSL is an industry standard protocol that uses RSA public key cryptography in conjunction with symmetric key cryptography to provide authentication, encryption, and data integrity.

See Also:

"Configuring HTTP Protocol Attributes" in Oracle Application Express Administration Guide

5.8 Controlling the Number of Concurrent Jobs

This section explains how to specify the number of concurrently running jobs.

5.8.1 About Managing the Number of Concurrent Jobs

JOB_QUEUE_PROCESSES determine the maximum number of concurrently running jobs. In Oracle Application Express transactional support and SQL scripts require jobs. If JOB_QUEUE_PROCESSES is not enabled and working properly, you cannot successfully execute a script.

5.8.2 Viewing the Number of JOB_QUEUE_PROCESSES

This section describes three ways to view the number of JOB_QUEUE_PROCESSES:

5.8.2.1 Viewing JOB_QUEUE_PROCESSES in the Installation Log File

After installing or upgrading Oracle Application Express, you can view the number of JOB_QUEUE_PROCESSES in the installation log files. See "Reviewing a Log of an Installation Session."

5.8.2.2 Viewing JOB_QUEUE_PROCESSES in Oracle Application Express

You can view the number of JOB_QUEUE_PROCESSES on the About Application Express page.

To view the About Application Express page:

  1. Sign in to Oracle Application Express. See "Signing In to Your Workspace."

  2. Locate the Help menu at the top of the page.

  3. From the Help menu, select About.

    The About Application Express page appears. The current number JOB_QUEUE_PROCESSES displays at the bottom of the page.

5.8.2.3 Viewing JOB_QUEUE_PROCESSES from SQL*Plus

You can view the number of JOB_QUEUE_PROCESSES from SQL*Plus by running the following SQL statement:

SELECT VALUE FROM v$parameter WHERE NAME = 'job_queue_processes'

5.8.3 Changing the Number of JOB_QUEUE_PROCESSES

You can change the number of JOB_QUEUE_PROCESSES by running a SQL statement in SQL*Plus:

To update the number of JOB_QUEUE_PROCESSES:

  1. Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role:

    • On Windows:

      SYSTEM_DRIVE:\ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
    • On UNIX and Linux:

      $ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
  2. In SQL*Plus run the following SQL statement:

    ALTER SYSTEM SET JOB_QUEUE_PROCESSES = <number>
    

    For example, running the statement ALTER SYSTEM SET JOB_QUEUE_PROCESSES = 20 sets JOB_QUEUE_PROCESSES to 20.

5.9 About Running Oracle Application Express in Other Languages

The Oracle Application Express interface is translated into German, Spanish, French, Italian, Japanese, Korean, Brazilian Portuguese, Simplified Chinese, and Traditional Chinese. A single instance of Oracle Application Express can be installed with one or more of these translated versions. Developers can choose to run the Application Express development environment in any of the installed languages by simply selecting the language from the Application Builder log in screen or home page.

In order to install other languages you must use the apex_5.0.zip file which contains the extra files referenced below. If you previously downloaded apex_5.0_en.zip, then you do not need to re-install Oracle Application Express. Simply download apex_5.0.zip and unzip the file into the same directory where you unzipped apex_5.0_en.zip.

The translated version of Oracle Application Express should be loaded into a database that has a character set that supports the specific language. If you attempt to install a translated version of Oracle Application Express into a database that does not support the character encoding of the language, the installation may fail or the translated Oracle Application Express instance may appear corrupt when run. The database character set AL32UTF8 supports all the translated versions of Oracle Application Express.

You can manually install translated versions of Oracle Application Express using SQL*Plus. The installation files are encoded in AL32UTF8.

Note:

Regardless of the target database character set, to install a translated version of Oracle Application Express, you must set the character set value of the NLS_LANG environment variable to AL32UTF8 before starting SQL*Plus.

The following examples illustrate valid NLS_LANG settings for loading Oracle Application Express translations:

American_America.AL32UTF8
Japanese_Japan.AL32UTF8 

5.10 Installing Translated Versions of Oracle Application Express

This section describes installing translated versions of Oracle Application Express.

5.10.1 About Installing Translated Versions of Oracle Application Express

Whether you are installing for the first time or upgrading from a previous release, you must run the load_lang.sql script to run a translated version of Oracle Application Express.

The installation scripts are located in subdirectories identified by a language code in the unzipped distribution apex/builder. For example, the German version is located in apex/builder/de and the Japanese version is located in apex/builder/ja. Within each directory, there is a language loading script identified by the language code (for example, load_de.sql or load_ja.sql).

5.10.2 Installing a Translated Version of Oracle Application Express

To install a translated version of Oracle Application Express:

  1. Set the NLS_LANG environment variable, making sure that the character set is AL32UTF8. For example:

    • Bourne or Korn shell:

      NLS_LANG=American_America.AL32UTF8
      export NLS_LANG
      
    • C shell:

      setenv NLS_LANG American_America.AL32UTF8
      
    • For Windows based systems:

      set NLS_LANG=American_America.AL32UTF8
      
  2. Navigate to the directory under apex/builder based on the language you need to install. For example for German, navigate to apex/builder/de. Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example:

    • On Windows:

      SYSTEM_DRIVE:\ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
    • On UNIX and Linux:

      $ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
  3. Execute the following statement:

    ALTER SESSION SET CURRENT_SCHEMA = APEX_050000;
    
  4. Execute the appropriate language specific script. For example:

    @load_lang.sql
    

    Where lang is the specific language (for example, load_de.sql for German or load_ja.sql for Japanese).

5.11 About Configuring the SHARED_SERVERS Parameter

The embedded PL/SQL gateway uses the shared server architecture of the Oracle Database. To achieve acceptable performance when using the embedded PL/SQL gateway, ensure the SHARED_SERVERS database initialization parameter is set to a reasonable value (that is, not 0 or 1). For a small group of concurrent users, Oracle recommends a value of 5 for SHARED_SERVERS.

Consider the following example:

  1. Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example:

    • On Windows:

      SYSTEM_DRIVE:\ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
    • On UNIX and Linux:

      $ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
  2. Run the following statement:

    ALTER SYSTEM SET SHARED_SERVERS = 5 SCOPE=BOTH;
    

5.12 Creating a Workspace and Adding Oracle Application Express Users

Before you can develop or install applications, you must create a workspace, add Oracle Application Express users and sign in to your workspace.

5.12.1 About Workspaces and Users

You access the Oracle Application Express home page by logging in to a workspace using a JavaScript enabled Web browser. To learn more, see "Browser Requirements."

A workspace enables multiple users to work within the same Oracle Application Express installation while keeping their objects, data, and applications private. Each workspace has a unique ID and name. An instance administrator can create a workspace manually within Oracle Application Express Administration Services or have users submit requests. Oracle Application Express Administration Services is a separate application for managing an entire Oracle Application Express instance.

See Also:

"Creating Workspaces" and "Managing Workspace and Change Requests" in Oracle Application Express Administration Guide

5.12.2 Accessing Oracle Application Express Administration Services

To manually create a workspace and user accounts, you sign in to a separate application for managing an entire Oracle Application Express instance called Oracle Application Express Administration Services. You sign in to Oracle Application Express Administration Services using the ADMIN account and password created or reset during the installation process.

To access Oracle Application Express Administration Services:

  1. In a Web browser, navigate to the Oracle Application Express Administration Services application.

    Because your setup uses Embedded PL/SQL Gateway, go to:

    http://hostname:port/apex/apex_admin
    

    Where:

    hostname is the name of the system where Oracle XML DB Protocol server is installed.

    port is the port number assigned to HTTP on the Oracle XML DB Protocol server. In a default installation, this number is 8080. If you are using the Oracle Database 12c multitenant architecture, then each pluggable database (PDB) will have a distinct port number.

    apex is the database access descriptor (DAD) defined in the configuration file.

  2. On the Sign In page:

    Note that, depending on your setup, you might be required to change your password when you log in for the first time.

See Also:

"Oracle Application Express Administration Services" in Oracle Application Express Administration Guide.

5.12.3 Creating a Workspace Manually

To manually create a workspace you sign in to a separate application called Oracle Application Express Administration Services. You sign in to Oracle Application Express Administration Services using the ADMIN account and password created or reset during the installation process.

To create an Oracle Application Express workspace manually:

  1. Access Oracle Application Express Administration Services. See "Accessing Oracle Application Express Administration Services."

    Oracle Application Express Administration Services appears. Next, create a workspace.

  2. Click Manage Workspaces.

  3. Under Workspace Actions, click Create Workspace.

    The Create Workspace Wizard appears.

  4. For Identify Workspace, enter the following:

    1. Workspace Name - Enter a unique workspace name.

    2. Workspace ID - Leave Workspace ID blank to have the new Workspace ID automatically generated. A Workspace ID must be a positive integer greater than 100000.

    3. Workspace Description - Enter a workspace description.

    4. Click Next.

  5. For Identify Schema, specify whether you are re-using an existing schema or creating a new one.

    If you are using an existing schema:

    1. For Re-use existing schema, select Yes.

    2. Select a schema from the list.

    3. Click Next.

    If you are creating a new schema:

    1. For Re-use existing schema, select No.

    2. Enter a schema name and password.

    3. Specify a space quota.

    4. Click Next.

  6. For Identify Administrator, enter the Workspace administrator information and click Next.

  7. Confirm your selections and click Create Workspace.

See Also:

"Oracle Application Express Administration Services" in Oracle Application Express Administration Guide.

5.12.4 Creating Oracle Application Express Users

To create an Oracle Application Express user account:

  1. Access Oracle Application Express Administration Services. See "Accessing Oracle Application Express Administration Services."

    Oracle Application Express Administration Services appears.

  2. Click the Manage Workspaces icon.

  3. Click Manage Developers and Users.

  4. Click Create User.

  5. Under User Attributes, enter the appropriate information. Fields marked with an asterisk are required.

    Tip:

    To learn more about a specific attribute, click the item label. When Help is available, the item label changes to red when you pass your cursor over it and the cursor changes to an arrow and question mark.
  6. Under Account Privileges:

    1. Workspace - Select a workspace from the list.

    2. Default Schemas - Specify the default schema used for data browsing, application creation, and SQL script execution.

      When using workspaces that have more than one schema available, this schema is the default. This setting does not control security, only the user's preference.

    3. User is an administrator - Specify if this user should have workspace administrator privileges.

      Administrators are given access to all components. Additionally, they can manage user accounts, groups, and development services. Components may not be available if they are switched off by Instance Administrators.

    4. User is a developer - Specify if this user should have developer privileges.

      Developers must have access to either Application Builder, SQL Workshop, or both. These components may not be available if they are switched off by the Instance Administrator.

    5. Application Builder Access - Determines whether a developer has access to the Application Builder.

    6. SQL Workshop Access - Determines whether a developer has access to the SQL Workshop.

    7. Team Development Access - Determines whether a developer has access to the Team Development.

    8. Set Account Availability - Select Locked to prevent the account from being used. Select Unlocked to allow the account to be used.

      If the user has exceeded the maximum log in failures allowed, specified in Workspace Preferences, then their account will be locked automatically.

  7. Under Password:

    • Password - Enter a case sensitive password.

    • Confirm Password - Enter the password again.

    • Require Change of Password On First Use - Select No to allow the user to use the same password until it expires. Select Yes to require the user to change the password immediately when logging in the first time.

  8. Click Create User or Create and Create Another.

5.12.5 Signing In to Your Workspace

Use your credentials (that is, your workspace name, user name and password) to sign in to the workspace.

To sign in to your workspace:

  1. In a Web browser, navigate to the Oracle Application Express Sign In page.

    Because your setup uses Embedded PL/SQL Gateway, go to:

    http://hostname:port/apex/
    

    Where:

    • hostname is the name of the system where Oracle XML DB Protocol server is installed.

    • port is the port number assigned to HTTP on the Oracle XML DB Protocol server. In a default installation, this number is 8080. If you are using the Oracle Database 12c multitenant architecture, then each pluggable database (PDB) will have a distinct port number.

    • apex is the database access descriptor (DAD) defined in the configuration file.

    The Sign In page appears.

  2. On the Sign In page, enter:

    • Workspace - Enter the name of your workspace.

    • Username - Enter your user name.

    • Password - Enter your case-sensitive password.

  3. Click Sign In.

    Note that, depending on your setup, you might be required to change your password when you log in for the first time.

See Also:

See "Creating Workspaces" and "Managing Workspace and Change Requests" in Oracle Application Express Administration Guide

5.13 Performing Post Installation Tasks for Upgrade Installations

Once you have verified that your upgrade installation was successful and all upgraded applications function properly, you should remove schemas from prior Oracle Application Express installations.

5.13.1 About Removing Prior Oracle Application Express Installations

The database users associated with schemas from prior installations are privileged users and should be removed when they are no longer necessary. Removing schemas from a prior installation is a two step process. First you verify if a prior installation exists and then you remove the schemas.

5.13.2 Verifying if a Prior Installation Exists

To verify if a prior installation exists:

  1. Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS. For example:

    • On Windows:

      SYSTEM_DRIVE:\ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password 
      
    • On UNIX and Linux:

      $ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password 
      
  2. Run the following query:

    SELECT username  FROM dba_users  WHERE (  username LIKE 'FLOWS\_______' ESCAPE '\'       OR username LIKE 'APEX\_______' ESCAPE '\' )   AND username NOT IN ( SELECT schema                           FROM dba_registry                          WHERE comp_id = 'APEX' );
    

If the results contain entries in the form FLOWS_XXXXXX or APEX_XXXXXX where XXXXXX represents six numbers, those entries are candidates for removal.

5.13.3 Removing Schemas from Prior Installations

To remove schemas from prior installations:

  1. Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example:

    • On Windows:

      SYSTEM_DRIVE:\ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
    • On UNIX and Linux:

      $ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
  2. Execute a statement similar to the following example:

    DROP USER APEX_040200 CASCADE;
    

5.13.4 Fixing Invalid ACL in Oracle Database 11g or Later

After following the instructions in"About Removing Prior Oracle Application Express Installations", you may need to fix an invalid ACL if you are running Oracle Database 11g or later and you enabled network services for the prior Oracle Application Express schema.

To fix an invalid ACL:

  1. Change your working directory to the apex directory where you unzipped the installation software.

  2. Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example:

    • On Windows:

      SYSTEM_DRIVE:\ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
    • On UNIX and Linux:

      $ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
  3. Execute a statement similar to the following:

    EXEC DBMS_NETWORK_ACL_ADMIN.DELETE_PRIVILEGE('power_users.xml', 'FLOWS_030000');
    

5.14 About Performance Optimization Tasks

Performance of web applications heavily depends on their size and how often a browser has to request static content like images, CSS and JavaScript files. To improve performance, most web servers support on-the-fly HTTP response compression and provide settings that enable you to configure on how long browsers can cache a file before requesting it again. The HTTP response compression is usually implemented using gzip encoding, while browser file caching is enabled by issuing Cache-Control HTTP response header.

Please see your web server documentation to learn how to enable response compression and browser file caching. For optimal performance of the Oracle Application Express development environment and Oracle Application Express applications, Oracle recommends enabling gzip compression of files in the virtual images directory (for example, /i/) and responses from the database access descriptor as well as allowing browsers to cache files from the virtual images directory for at least 12 hours.

5.15 Converting Between Runtime and Full Development Environments

This section describes how to convert between runtime and full development environments.

5.15.1 About Runtime and Full Development Environments

An Oracle Application Express runtime environment enables users to run a production application without supporting the ability to change or edit the application. It includes only the packages necessary to run your applications, making it a more hardened environment. It does not provide a web interface for administration.

You administer an Oracle Application Express runtime environment using SQL*Plus or SQL Developer and the APEX_INSTANCE_ADMIN API.

See Also:

"About the Oracle Application Express Runtime Environment" and "Installing Exported Applications into a Runtime Environment" in Oracle Application Express Administration Guide

5.15.2 Converting a Runtime Environment to a Full Development Environment in a non-CDB or Locally in a PDB

To convert an Oracle Application Express runtime environment to a full development environment in a non-CDB or locally in a PDB:

  1. Change your working directory to the apex directory where you unzipped the installation software.

  2. Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example:

    • On Windows:

      SYSTEM_DRIVE:\ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
    • On UNIX and Linux:

      $ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
  3. Run apxdvins.sql. For example:

    @apxdvins.sql
    
  4. Follow the instructions in "Creating or Updating Your Instance Administration Account."

See Also:

Oracle Database PL/SQL Language Reference for more information about SQL*Plus

5.15.3 Converting a Full Development Environment to a Runtime Environment in a non-CDB or Locally in a PDB

Tip:

Before converting a full development environment to a runtime environment, export all Websheet applications. When you convert a development environment to runtime, existing Websheet data grids and reports will be deleted from all workspaces. Converting the environment back to a full development environment will not restore these Websheet data grids or reports.

To convert an Oracle Application Express full development environment to a runtime environment in a non-CDB or locally in a PDB:

  1. Change your working directory to the apex directory where you unzipped the installation software.

  2. Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example:

    • On Windows:

      SYSTEM_DRIVE:\ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
    • On UNIX and Linux:

      $ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
  3. Run apxdevrm.sql. For example:

    @apxdevrm.sql
    

See Also:

Oracle Database PL/SQL Language Reference for more information about SQL*Plus

5.15.4 Converting a Runtime Environment to a Full Development Environment in a CDB

To convert an Oracle Application Express runtime environment to a full development environment in a CDB:

  1. Change your working directory to the apex directory where you unzipped the installation software.

  2. Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example:

    • On Windows:

      SYSTEM_DRIVE:\ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
    • On UNIX and Linux:

      $ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
  3. Run apxdvins_con.sql. For example:

    @apxdvins_con.sql
    
  4. Follow the instructions in "Creating or Updating Your Instance Administration Account."

See Also:

Oracle Database PL/SQL Language Reference for more information about SQL*Plus

5.15.5 Converting a Full Development Environment to a Runtime Environment in a CDB

Tip:

Before converting a full development environment to a runtime environment, export all Websheet applications. When you convert a development environment to runtime, existing Websheet data grids and reports will be deleted from all workspaces. Converting the environment back to a full development environment will not restore these Websheet data grids or reports.

To convert an Oracle Application Express full development environment to a runtime environment in a CDB:

  1. Change your working directory to the apex directory where you unzipped the installation software.

  2. Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example:

    • On Windows:

      SYSTEM_DRIVE:\ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
    • On UNIX and Linux:

      $ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
  3. Run apxdevrm_con.sql. For example:

    @apxdevrm_con.sql
    

See Also:

Oracle Database PL/SQL Language Reference for more information about SQL*Plus