3 Downloading from Oracle Technology Network

This chapter describes how to install Oracle Application Express by downloading a ZIP file from Oracle Technology Network (OTN) and completing the appropriate post installation tasks.

The instructions in this chapter apply to both new and upgrade installations. To learn more, see "Upgrading from a Previous Version of Oracle Application Express".

This chapter contains these topics:

Note:

Within the context of this document, the Apache Oracle home directory (ORACLE_HTTPSERVER_HOME) is the location where Oracle HTTP Server is installed.

3.1 Recommended Pre-installation Tasks

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. 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 version 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 user access to Oracle Application Express when the existing installation is using the Oracle HTTP Server and mod_plsql, you should either shut down the Web server or disable the Application Express Database Access Descriptor of the Web server.

    For an existing installation using the embedded PL/SQL gateway, you should disable the Oracle XMLDB HTTP server by setting the HTTP port to 0. This can be accomplished by starting SQL*Plus, connecting as SYS to the database where Oracle Application Express is installed, and running:

    EXEC DBMS_XDB.SETHTTPPORT(0);
    

    Once you have prevented access from Oracle Application Express users, you should log into 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 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 the listener or Oracle HTTP Server. However, if you are performing a remote installation, make sure the database listener for the remote database has started.

3.2 Choosing an HTTP Server

In order to run, Oracle Application Express must have access to Oracle Application Express Listener, the embedded PL/SQL gateway or Oracle HTTP Server and mod_plsql. To learn more, see "About Choosing an HTTP Server".

3.3 Downloading from OTN and Configuring Oracle Application Express Listener

This section describes how to install Oracle Application Express by downloading a ZIP file from OTN and then configuring the Oracle Application Express Listener.

Topics in this section include:

3.3.1 Install the Oracle Database and Complete Pre-installation Tasks

Oracle Application Express requires an Oracle database that is release 10.2.0.3 or later or Oracle Database 10g Express Edition. To learn more, see the Oracle Database Installation Guide for your operating environment and "Recommended Pre-installation Tasks".

3.3.2 Download and Install Oracle Application Express

To install Oracle Application Express:

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

    http://www.oracle.com/technology/products/database/application_express/download.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_4.0_en.zip as follows, preserving directory names:

      • UNIX and Linux: Unzip apex_4.0_en.zip

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

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

      • UNIX and Linux: Unzip apex_4.0.zip

      • Windows: Double click the file apex_4.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:\.
  3. Change your working directory to apex.

  4. 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
      
  5. Disable any existing password complexity rules for the default profile. See "Configuring Password Protection" in Oracle Database Security Guide.

  6. Select the appropriate 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. To learn more, see "About the Oracle Application Express Runtime Environment".

    Available installation options include:

    • Full development environment. Run apexins.sql passing the following four arguments in the order shown:

      @apexins 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.

      • 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 SYSAUX SYSAUX TEMP /i/
      

      Note:

      If you receive the following error, please exit SQL*Plus and change your working directory to apex:

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

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

      @apxrtins 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.

      • 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 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_040000 - 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 used for Oracle Application Express configuration with Oracle HTTP Server and mod_plsql or Oracle Application Express Listener.

If you are upgrading from a previous release, 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".

3.3.3 Change the Password for the ADMIN Account

In a new installation of Oracle Application Express, or if you are converting a runtime environment to a development environment, you must change the password of the internal ADMIN account. In an upgrade scenario, the password will be preserved and carried over from the prior release.

To change the password for the ADMIN 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
    

    When prompted enter a password for the ADMIN account.

See Also:

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

3.3.4 Restart Processes

After you install Oracle Application Express, you must restart the processes that you stopped before you began the installation, such as listener and other processes. In addition, restart Oracle HTTP Server.

3.3.5 Configure APEX_PUBLIC_USER Account

It is important to correctly configure the APEX_PUBLIC_USER account to enable proper operation of Oracle Application Express.

3.3.5.1 Unlocking the APEX_PUBLIC_USER Account

The APEX_PUBLIC_USER account is locked at the end of a new installation of Oracle Application Express. You must unlock this account before configuring the database access descriptor (DAD) in a new installation.

Tip:

If you are upgrading from a prior release of Oracle Application Express, this step is unnecessary.

To unlock the APEX_PUBLIC_USER account:

  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 USER APEX_PUBLIC_USER ACCOUNT UNLOCK
    

3.3.5.2 Changing the Password for the APEX_PUBLIC_USER Account

The APEX_PUBLIC_USER account is created with a random password in a new installation of Oracle Application Express. You must change the password for this account before configuring the database access descriptor (DAD) in a new installation.

Tip:

If you are upgrading from a prior release of Oracle Application Express, this step is unnecessary.

To change the password for the APEX_PUBLIC_USER account:

  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 USER APEX_PUBLIC_USER IDENTIFIED BY new_password
    

    Where new_password is the new password you are setting for APEX_PUBLIC_USER. You will use this password when creating the DAD in the sections that follow.

3.3.5.2.1 About Password Expiration in Oracle Database 11g

In the default profile in Oracle Database 11g, the parameter PASSWORD_LIFE_TIME is set to 180. If you are using Oracle Database 11g with Oracle Application Express, this causes the password for APEX_PUBLIC_USER to expire in 180 days. As a result, your Oracle Application Express instance will become unusable until you change the password.

To prevent this behavior, create another profile in which the PASSWORD_LIFE_TIME parameter is set to unlimited and alter the APEX_PUBLIC_USER account and assign it the new profile.

See Also:

Oracle Database Security Guide for information on creating profiles and assigning them to database users.

3.3.6 Download and Install Oracle Application Express Listener

To download the Oracle Application Express Listener:

  1. Download the file apex_listener_1.0.zip from the Oracle Application Express download page. See:

    http://www.oracle.com/technology/products/database/application_express/html/apex_listener_download.html
    

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

  2. Unzip apex_listener_1.0.zip as follows, preserving directory names:

    • UNIX and Linux: Unzip apex_listener_1.0.zip

    • Windows: Double click the file apex_listener_1.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:\.
  3. Locate the Installation Guide and follow instructions to complete installation and configuration steps.

3.3.7 Enable Network Services in Oracle Database 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_040000 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.

  • Searching for content in online Help (that is, using the Find link).

Topics in this section include:

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 11g database will already have the parameter set properly, but a database upgraded to 11g 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.

3.3.7.1 Granting Connect Privileges

The following example demonstrates how to grant connect privileges to any host for the APEX_040000 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);
  ACL_ID    RAW(16);
BEGIN
  -- Look for the ACL currently assigned to '*' and give APEX_040000
  -- the "connect" privilege if APEX_040000 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;

  -- Before checking the privilege, ensure that the ACL is valid
  -- (for example, does not contain stale references to dropped users).
  -- If it does, the following exception will be raised:
  --
  -- ORA-44416: Invalid ACL: Unresolved principal 'APEX_040000'
  -- ORA-06512: at "XDB.DBMS_XDBZ", line ...
  --
  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_040000', 
     'connect') IS NULL THEN 
      DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH, 
     'APEX_040000', 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_040000', 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 would enable indexing the Oracle Application Express Online Help and could possibly enable email and PDF printing if those servers were also on the local host.

DECLARE
  ACL_PATH  VARCHAR2(4000);
  ACL_ID    RAW(16);
BEGIN
  -- Look for the ACL currently assigned to 'localhost' and give APEX_040000
  -- the "connect" privilege if APEX_040000 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;

  -- Before checking the privilege, ensure that the ACL is valid
  -- (for example, does not contain stale references to dropped users).
  -- If it does, the following exception will be raised:
  --
  -- ORA-44416: Invalid ACL: Unresolved principal 'APEX_040000'
  -- ORA-06512: at "XDB.DBMS_XDBZ", line ...
  --

  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_040000', 
     'connect') IS NULL THEN 
      DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH, 
     'APEX_040000', 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 power users to connect to everywhere',
    'APEX_040000', TRUE, 'connect');
  DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('local-access-users.xml','localhost');
END;
/
COMMIT;

3.3.7.2 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_040000 user. See "Granting Connect Privileges".

3.3.8 Enable Indexing of Online Help in Oracle Database 11gR2 and Higher

The ability to search Oracle Application Express online Help is accomplished through Oracle Text and a URL datastore. There is a change in the default behavior and permissions to use an Oracle Text URL datastore in database 11gR2 and higher.

If users attempt to search Oracle Application Express online Help in Oracle database 11gR2 and encounter the following error, then the permission to use an Oracle Text URL datastore has not been granted to database user APEX_040000.

ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine 
ORA-20000: Oracle Text error: 
DRG-10758: index owner does not have the privilege to use file or URL datastore

To enable the indexing of online Help in Oracle Application Express, the permission to use an Oracle Text URL datastore must be granted to the APEX_040000 database user. This is accomplished by assigning this specific privilege to a database role and then granting this role to the APEX_040000 database user.

To determine if the ability to use an Oracle Text URL datastore is already granted to a database role:

  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 command:

    SELECT par_value FROM ctxsys.ctx_parameters WHERE par_name = 'FILE_ACCESS_ROLE';
    

    This returns either NULL or the database role which is granted the ability to use an Oracle Text URL datastore.

  3. If no value is returned by step 2, then create a new database role as shown in the following example:

    CREATE ROLE APEX_URL_DATASTORE_ROLE;
    
  4. Grant this role to the database user APEX_040000 with the following statement:

    GRANT APEX_URL_DATASTORE_ROLE to APEX_040000;
    

    If step 2 returned a value, use this database role name instead of the example APEX_URL_DATASTORE_ROLE.

  5. Lastly, if step 2 did not return a value, then use the Oracle Text API to grant permission to the newly created database role with the following statement:

    EXEC ctxsys.ctx_adm.set_parameter('file_access_role', 'APEX_URL_DATASTORE_ROLE');
    

3.3.9 Security Considerations

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:

"Requiring HTTPS" in Oracle Application Express Administration Guide

3.3.10 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. At runtime, each user's Web browser language settings determine the specific language version.

In order to install other languages you must use the apex_4.0.zip file which contains the extra files referenced below. If you previously downloaded apex_4.0_en.zip, then you don't need to re-install Oracle Application Express. Simply download apex_4.0.zip and unzip the file into the same directory where you unzipped apex_4.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 

3.3.10.1 Installing a Translated Version 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 of directory, there is a language loading script identified by the language code (for example, load_de.sql or load_ja.sql).

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_040000;
    
  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).

3.3.11 About Managing JOB_QUEUE_PROCESSES

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

Topics in this section include:

3.3.11.1 Viewing the Number of JOB_QUEUE_PROCESSES

There are currently three ways to view the number of JOB_QUEUE_PROCESSES:

  • In the installation log file

  • On the About Application Express page in Oracle Application Express

  • From SQL*Plus

3.3.11.1.1 Viewing JOB_QUEUE_PROCESSES in the Installation Log File

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

3.3.11.1.2 Viewing JOB_QUEUE_PROCESSES in Oracle Application Express

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

To view the About Application Express page:

  1. Log in to Oracle Application Express. See "Logging in to Your Workspace".

  2. On the Administration list, click About Application Express.

    The current number JOB_QUEUE_PROCESSES displays at the bottom of the page.

3.3.11.1.3 Viewing JOB_QUEUE_PROCESSES from SQL*Plus

You can also 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'

3.3.11.2 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.

3.3.12 Create a Workspace and Add Oracle Application Express Users

You access the Oracle Application Express home page by logging in to workspace using a Web browser. Your Web browser must support JavaScript and the HTML 4.0 and CSS 1.0 standards. See "Browser Requirements".

A workspace is a virtual private database allowing 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 "Creating Workspaces" and "Managing Workspace Requests" in Oracle Application Express Administration Guide.

See Also:

Oracle Database 2 Day + Oracle Application Express Developer's Guide if you are new to Oracle Application Express

Topics in this section include:

3.3.12.1 Creating a Workspace Manually

To create an Oracle Application Express workspace manually:

  1. Log in to Oracle Application Express Administration Services. Oracle Application Express Administration Services is a separate application for managing an entire Oracle Application Express instance. You log in using the ADMIN account and password created or reset during the installation process.

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

      Because your setup uses Oracle Application Express Listener, go to:

      http://hostname:port/apex/apex_admin
      

      Where:

      hostname is the name of the system where Oracle HTTP Server is installed.

      port is the port number assigned to Oracle HTTP Server. In a default installation, for Oracle WebLogic Server this number is 7001, in OC4J this number is 8888, in Oracle Glassfish Server this number is 8080. These defaults are correct at the time this document was written. Please review the related Web server documentation for the latest default port if necessary.

      apex is the mount point defined in the Web Server configuration file.

    2. On the Login page:

    See Also:

    See "Logging in to Oracle Application Express Administration Services" in Oracle Application Express Administration Guide.

    Next, create a workspace.

  2. Click Manage Workspaces.

  3. Under Manage Workspaces, click Create Workspace.

    The Create Workspace Wizard appears.

  4. For Identify Workspace, enter a workspace name and description and click Next.

  5. For Identify Schema, select the Oracle Forms application schema.

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

    2. Select a schema from the list.

    3. Click Next.

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

  7. Confirm your selections and click Create.

3.3.12.2 Creating Oracle Application Express Users

To create an Oracle Application Express user account:

  1. Log in to Oracle Application Express Administration Services as described in the previous section. See "Logging in to Oracle Application Express Administration Services" in Oracle Application Express Administration Guide.

  2. Click the Administration icon.

    The Administration page appears.

  3. Click Manage Users and Groups.

  4. Click Create User.

    The Create User page appears.

  5. Under User Identification, enter:

    1. Username - Enter the username used to log in to the system. Restrictions include:

      • Maximum length of 100 characters

      • No spaces

      • Only these special characters are permitted: ampersand (@) and period (.)

    2. Email Address - Enter the valid email address for this user.

    3. First Name - Enter the first or given name to further identify the user (optional).

    4. Last Name - Enter the last or family name to further identify the user (optional).

    5. Description - Enter comments about this user (optional).

  6. Under Account Privileges:

    1. 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.

    2. Accessible Schemas (null for all) - Leave this blank to enable the end user to access all schemas in the workspace, or enter a colon-delimited list of schemas for which this user has permissions when using the SQL Workshop.

    3. User is a workspace 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. Components may not be available if they are switched off by Instance Administrators.

    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 login 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. Under User Groups, optionally select one or more user groups by holding down the CTRL key and selecting the groups.

  9. Click Create User or Create and Create Another.

3.3.12.3 Logging in to Your Workspace

Once you create a workspace, you must log in to it using your login credentials (that is, the workspace name, user name, and password).

See Also:

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

To log in to your workspace:

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

    Because your setup uses the Oracle Application Express Listener, go to:

    http://hostname:port/apex
    

    Where:

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

    • port is the port number assigned to Oracle HTTP Server. In a default installation, for Oracle WebLogic Server this number is 7001, in OC4J this number is 8888, in Oracle Glassfish Server this number is 8080. These defaults are correct at the time this document was written. Please review the related Web server documentation for the latest default port if necessary.

    • apex is the mount point defined in the Web Server configuration file.

    The Login page appears.

  2. Under Login, enter the following:

    • Workspace field - Enter the name of your workspace.

    • Username field - Enter your user name.

    • Password field - Enter your case-sensitive password.

  3. Click Login.

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

3.4 Downloading from OTN and Configuring the Embedded PL/SQL Gateway

This section describes how to install Oracle Application Express by downloading a ZIP file from OTN and then configuring the embedded PL/SQL gateway.

Topics in this section include:

3.4.1 Install the Oracle Database and Complete Pre-installation Tasks

Oracle Application Express requires an Oracle database that is release 10.2.0.3 or later or Oracle Database 10g Express Edition. To learn more, see the Oracle Database Installation Guide for your operating environment and "Recommended Pre-installation Tasks".

3.4.2 Download and Install Oracle Application Express

To install Oracle Application Express:

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

    http://www.oracle.com/technology/products/database/application_express/download.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_4.0_en.zip as follows, preserving directory names:

      • UNIX and Linux: Unzip apex_4.0_en.zip

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

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

      • UNIX and Linux: Unzip apex_4.0.zip

      • Windows: Double click the file apex_4.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:\.
  3. Change your working directory to apex.

  4. 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
      
  5. Disable any existing password complexity rules for the default profile. See "Configuring Password Protection" in Oracle Database Security Guide.

  6. Select the appropriate 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. To learn more, see "About the Oracle Application Express Runtime Environment".

    Available installation options include:

    • Full development environment. Run apexins.sql passing the following four arguments in the order shown:

      @apexins 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.

      • 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 SYSAUX SYSAUX TEMP /i/
      

      Note:

      If you receive the following error, please exit SQL*Plus and change your working directory to apex:

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

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

      @apxrtins 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.

      • 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 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_040000 - 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 used for Oracle Application Express configuration with Oracle HTTP Server and mod_plsql or Oracle Application Express Listener.

If you are upgrading from a previous release, 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".

3.4.3 Change the Password for the ADMIN Account

In a new installation of Oracle Application Express, or if you are converting a runtime environment to a development environment, you must change the password of the internal ADMIN account. In an upgrade scenario, the password will be preserved and carried over from the prior release.

To change the password for the ADMIN 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
    

    When prompted enter a password for the ADMIN account.

See Also:

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

3.4.4 Restart Processes

After you install Oracle Application Express, you must restart the processes that you stopped before you began the installation, such as listener and other processes.

3.4.5 Configure the Embedded PL/SQL Gateway

The embedded PL/SQL gateway installs with the Oracle Database 11g. However, you must configure it before you can use it with Oracle Application Express. To accomplish this, you run a configuration file and unlock the ANONYMOUS account.

Note:

The Oracle XML DB HTTP Server with the embedded PL/SQL gateway is not supported before Oracle Database 11g.

Topics in this section include:

3.4.5.1 Running the apex_epg_config.sql Configuration Script

In a new installation, you configure the embedded PL/SQL gateway by running the configuration script apex_epg_config.sql. Then, you unlock the ANONYMOUS account.

Note:

If you are upgrading and have previously configured the embedded PL/SQL gateway, skip this section and go to "Updating the Images Directory When Upgrading from a Previous Release".

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. 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 SYSTEM_DRIVE:\TEMP
      
    • On UNIX and Linux:

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

    ALTER USER ANONYMOUS ACCOUNT UNLOCK;
    

3.4.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 apxldimg.sql script to update the images directory.

Tip:

If you are not upgrading from a prior release of Oracle Application Express, this step is unnecessary. The images will be loaded by running apex_epg_config.sql as described in the prior section.

To run the apxldimg.sql script:

  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. Run apxldimg.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:

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

      @apxldimg.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.

3.4.5.3 Verifying the Oracle XML DB HTTP Server Port

The embedded PL/SQL gateway runs in the Oracle XML DB HTTP server in the Oracle database. You can determine if the Oracle XML DB HTTP server is enabled by verifying the associated port number.

To verify the port number where the Oracle XML DB HTTP 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 HTTP Server is disabled.

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

3.4.5.4 Enabling Oracle XML DB HTTP Server

The embedded PL/SQL gateway runs in the Oracle XML DB HTTP server in the Oracle database.

To enable Oracle XML DB HTTP 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:

3.4.6 Enable Network Services in Oracle Database 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_040000 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.

  • Searching for content in online Help (that is, using the Find link).

Topics in this section include:

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 11g database will already have the parameter set properly, but a database upgraded to 11g 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.

3.4.6.1 Granting Connect Privileges

The following example demonstrates how to grant connect privileges to any host for the APEX_040000 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);
  ACL_ID    RAW(16);
BEGIN
  -- Look for the ACL currently assigned to '*' and give APEX_040000
  -- the "connect" privilege if APEX_040000 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;

  -- Before checking the privilege, ensure that the ACL is valid
  -- (for example, does not contain stale references to dropped users).
  -- If it does, the following exception will be raised:
  --
  -- ORA-44416: Invalid ACL: Unresolved principal 'APEX_040000'
  -- ORA-06512: at "XDB.DBMS_XDBZ", line ...
  --
  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_040000', 
     'connect') IS NULL THEN 
      DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH, 
     'APEX_040000', 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_040000', 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 would enable indexing the Oracle Application Express Online Help and could possibly enable email and PDF printing if those servers were also on the local host.

DECLARE
  ACL_PATH  VARCHAR2(4000);
  ACL_ID    RAW(16);
BEGIN
  -- Look for the ACL currently assigned to 'localhost' and give APEX_040000
  -- the "connect" privilege if APEX_040000 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;

  -- Before checking the privilege, ensure that the ACL is valid
  -- (for example, does not contain stale references to dropped users).
  -- If it does, the following exception will be raised:
  --
  -- ORA-44416: Invalid ACL: Unresolved principal 'APEX_040000'
  -- ORA-06512: at "XDB.DBMS_XDBZ", line ...
  --

  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_040000', 
     'connect') IS NULL THEN 
      DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH, 
     'APEX_040000', 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 power users to connect to everywhere',
    'APEX_040000', TRUE, 'connect');
  DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('local-access-users.xml','localhost');
END;
/
COMMIT;

3.4.6.2 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_040000 user. See "Granting Connect Privileges".

3.4.7 Enable Indexing of Online Help in Oracle Database 11gR2 and Higher

The ability to search Oracle Application Express online Help is accomplished through Oracle Text and a URL datastore. There is a change in the default behavior and permissions to use an Oracle Text URL datastore in database 11gR2 and higher.

If users attempt to search Oracle Application Express online Help in Oracle database 11gR2 and encounter the following error, then the permission to use an Oracle Text URL datastore has not been granted to database user APEX_040000.

ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine 
ORA-20000: Oracle Text error: 
DRG-10758: index owner does not have the privilege to use file or URL datastore

To enable the indexing of online Help in Oracle Application Express, the permission to use an Oracle Text URL datastore must be granted to the APEX_040000 database user. This is accomplished by assigning this specific privilege to a database role and then granting this role to the APEX_040000 database user.

To determine if the ability to use an Oracle Text URL datastore is already granted to a database role:

  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 command:

    SELECT par_value FROM ctxsys.ctx_parameters WHERE par_name = 'FILE_ACCESS_ROLE';
    

    This returns either NULL or the database role which is granted the ability to use an Oracle Text URL datastore.

  3. If no value is returned by step 2, then create a new database role as shown in the following example:

    CREATE ROLE APEX_URL_DATASTORE_ROLE;
    
  4. Grant this role to the database user APEX_040000 with the following statement:

    GRANT APEX_URL_DATASTORE_ROLE to APEX_040000;
    

    If step 2 returned a value, use this database role name instead of the example APEX_URL_DATASTORE_ROLE.

  5. Lastly, if step 2 did not return a value, then use the Oracle Text API to grant permission to the newly created database role with the following statement:

    EXEC ctxsys.ctx_adm.set_parameter('file_access_role', 'APEX_URL_DATASTORE_ROLE');
    

3.4.8 Security Considerations

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:

"Requiring HTTPS" in Oracle Application Express Administration Guide

3.4.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. At runtime, each user's Web browser language settings determine the specific language version.

In order to install other languages you must use the apex_4.0.zip file which contains the extra files referenced below. If you previously downloaded apex_4.0_en.zip, then you don't need to re-install Oracle Application Express. Simply download apex_4.0.zip and unzip the file into the same directory where you unzipped apex_4.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 

3.4.9.1 Installing a Translated Version 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 of directory, there is a language loading script identified by the language code (for example, load_de.sql or load_ja.sql).

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_040000;
    
  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).

3.4.10 About Managing JOB_QUEUE_PROCESSES

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

Topics in this section include:

3.4.10.1 Viewing the Number of JOB_QUEUE_PROCESSES

There are currently three ways to view the number of JOB_QUEUE_PROCESSES:

  • In the installation log file

  • On the About Application Express page in Oracle Application Express

  • From SQL*Plus

3.4.10.1.1 Viewing JOB_QUEUE_PROCESSES in the Installation Log File

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

3.4.10.1.2 Viewing JOB_QUEUE_PROCESSES in Oracle Application Express

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

To view the About Application Express page:

  1. Log in to Oracle Application Express. See "Logging in to Your Workspace".

  2. On the Administration list, click About Application Express.

    The current number JOB_QUEUE_PROCESSES displays at the bottom of the page.

3.4.10.1.3 Viewing JOB_QUEUE_PROCESSES from SQL*Plus

You can also 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'

3.4.10.2 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.

3.4.11 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;
    

3.4.12 Create a Workspace and Add Oracle Application Express Users

You access the Oracle Application Express home page by logging in to workspace using a Web browser. Your Web browser must support JavaScript and the HTML 4.0 and CSS 1.0 standards. See "Browser Requirements".

A workspace is a virtual private database allowing 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 Oracle Application Express 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 "Creating Workspaces" and "Managing Workspace Requests" in Oracle Application Express Administration Guide.

See Also:

Oracle Database 2 Day + Oracle Application Express Developer's Guide if you are new to Oracle Application Express

Topics in this section include:

3.4.12.1 Creating a Workspace Manually

To create an Oracle Application Express workspace manually:

  1. Log in to Oracle Application Express Administration Services. Oracle Application Express Administration Services is a separate application for managing an entire Oracle Application Express instance. You log in using the ADMIN account and password created or reset during the installation process.

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

      Because your setup uses the embedded PL/SQL gateway, go to:

      http://hostname:port/apex/apex_admin
      

      Where:

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

      port is the port number assigned to Oracle XML DB HTTP server. In a default installation, this number is 8080.

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

    2. On the Login page:

    See Also:

    See "Logging in to Oracle Application Express Administration Services" in Oracle Application Express Administration Guide.

    Next, create a workspace.

  2. Click Manage Workspaces.

  3. Under Manage Workspaces, click Create Workspace.

    The Create Workspace Wizard appears.

  4. For Identify Workspace, enter a workspace name and description and click Next.

  5. For Identify Schema, select the Oracle Forms application schema.

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

    2. Select a schema from the list.

    3. Click Next.

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

  7. Confirm your selections and click Create.

3.4.12.2 Creating Oracle Application Express Users

To create an Oracle Application Express user account:

  1. Log in to Oracle Application Express Administration Services as described in the previous section. See "Logging in to Oracle Application Express Administration Services" in Oracle Application Express Administration Guide.

  2. Click the Administration icon.

    The Administration page appears.

  3. Click Manage Users and Groups.

  4. Click Create User.

    The Create User page appears.

  5. Under User Identification, enter:

    1. Username - Enter the username used to log in to the system. Restrictions include:

      • Maximum length of 100 characters

      • No spaces

      • Only these special characters are permitted: ampersand (@) and period (.)

    2. Email Address - Enter the valid email address for this user.

    3. First Name - Enter the first or given name to further identify the user (optional).

    4. Last Name - Enter the last or family name to further identify the user (optional).

    5. Description - Enter comments about this user (optional).

  6. Under Account Privileges:

    1. 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.

    2. Accessible Schemas (null for all) - Leave this blank to enable the end user to access all schemas in the workspace, or enter a colon-delimited list of schemas for which this user has permissions when using the SQL Workshop.

    3. User is a workspace 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. Components may not be available if they are switched off by Instance Administrators.

    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 login 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. Under User Groups, optionally select one or more user groups by holding down the CTRL key and selecting the groups.

  9. Click Create User or Create and Create Another.

3.4.12.3 Logging in to Your Workspace

Once you create a workspace, you must log in to it using your login credentials (that is, the workspace name, user name, and password).

See Also:

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

To log in to your workspace:

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

    Because your setup uses the embedded PL/SQL gateway, go to:

    http://hostname:port/apex
    

    Where:

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

    • port is the port number assigned to Oracle XML DB HTTP server. In a default installation, this number is 8080.

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

      For users who have upgraded from earlier releases, or who have a custom configuration, this value may be htmldb or something else. Verify your DAD with your Oracle Application Express administrator.

    The Login page appears.

  2. Under Login, enter the following:

    • Workspace field - Enter the name of your workspace.

    • Username field - Enter your user name.

    • Password field - Enter your case-sensitive password.

  3. Click Login.

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

3.5 Downloading from OTN and Configuring Oracle HTTP Server

This section describes how to install Oracle Application Express by downloading a ZIP file from OTN and then configuring Oracle HTTP Server with mod_plsql distributed with Oracle Database 11g or Oracle Application Server 10g.

Topics in this section include:

3.5.1 Install the Oracle Database and Complete Pre-installation Tasks

Oracle Application Express requires an Oracle database that is release 10.2.0.3 or later or Oracle Database 10g Express Edition. To learn more, see the Oracle Database Installation Guide for your operating environment and "Recommended Pre-installation Tasks".

3.5.2 Download and Install Oracle Application Express

To install Oracle Application Express:

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

    http://www.oracle.com/technology/products/database/application_express/download.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_4.0_en.zip as follows, preserving directory names:

      • UNIX and Linux: Unzip apex_4.0_en.zip

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

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

      • UNIX and Linux: Unzip apex_4.0.zip

      • Windows: Double click the file apex_4.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:\.
  3. Change your working directory to apex.

  4. 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
      
  5. Disable any existing password complexity rules for the default profile. See "Configuring Password Protection" in Oracle Database Security Guide.

  6. Select the appropriate 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. To learn more, see "About the Oracle Application Express Runtime Environment".

    Available installation options include:

    • Full development environment. Run apexins.sql passing the following four arguments in the order shown:

      @apexins 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.

      • 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 SYSAUX SYSAUX TEMP /i/
      

      Note:

      If you receive the following error, please exit SQL*Plus and change your working directory to apex:

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

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

      @apxrtins 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.

      • 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 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_040000 - 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 used for Oracle Application Express configuration with Oracle HTTP Server and mod_plsql or Oracle Application Express Listener.

If you are upgrading from a previous release, 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".

3.5.3 Change the Password for the ADMIN Account

In a new installation of Oracle Application Express, or if you are converting a runtime environment to a development environment, you must change the password of the internal ADMIN account. In an upgrade scenario, the password will be preserved and carried over from the prior release.

To change the password for the ADMIN 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
    

    When prompted enter a password for the ADMIN account.

See Also:

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

3.5.4 Restart Processes

After you install Oracle Application Express, you must restart the processes that you stopped before you began the installation, such as listener and other processes. In addition, restart Oracle HTTP Server.

3.5.5 Configure Oracle HTTP Server Distributed with Oracle Database 11g or Oracle Application Server 10g

This section describes how to configure Oracle HTTP Server with mod_plsql distributed with Oracle Database 11g or Oracle Application Server 10g.

Topics in this section include:

3.5.5.1 Unlocking the APEX_PUBLIC_USER Account

The APEX_PUBLIC_USER account is locked at the end of a new installation of Oracle Application Express. You must unlock this account before configuring the database access descriptor (DAD) in a new installation.

Tip:

If you are upgrading from a prior release of Oracle Application Express, this step is unnecessary.

To unlock the APEX_PUBLIC_USER account:

  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 USER APEX_PUBLIC_USER ACCOUNT UNLOCK
    

3.5.5.2 Changing the Password for the APEX_PUBLIC_USER Account

The APEX_PUBLIC_USER account is created with a random password in a new installation of Oracle Application Express. You must change the password for this account before configuring the database access descriptor (DAD) in a new installation.

Tip:

If you are upgrading from a prior release of Oracle Application Express, this step is unnecessary.

To change the password for the APEX_PUBLIC_USER account:

  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 USER APEX_PUBLIC_USER IDENTIFIED BY new_password
    

    Where new_password is the new password you are setting for APEX_PUBLIC_USER. You will use this password when creating the DAD in the sections that follow.

3.5.5.2.1 About Password Expiration in Oracle Database 11g

In the default profile in Oracle Database 11g, the parameter PASSWORD_LIFE_TIME is set to 180. If you are using Oracle Database 11g with Oracle Application Express, this causes the password for APEX_PUBLIC_USER to expire in 180 days. As a result, your Oracle Application Express instance will become unusable until you change the password.

To prevent this behavior, create another profile in which the PASSWORD_LIFE_TIME parameter is set to unlimited and alter the APEX_PUBLIC_USER account and assign it the new profile.

See Also:

Oracle Database Security Guide for information on creating profiles and assigning them to database users.

3.5.5.3 Copy the Images Directory

Whether you are loading a new installation or upgrading from a previous release, you must copy the images directory from the top level of the apex\images directory to the location on the file system containing the Oracle home for Oracle HTTP Server.

Topics in this section include:

3.5.5.3.1 Copying the Images Directory After an Upgrade

During an upgrade, you must overwrite your existing images directory. Before you begin the upgrade, to ensure that you can revert to the previous version, Oracle recommends that you create a copy of your existing images directory for Oracle Application Express, indicating the release number of the images (for example, images_3_1).

To locate the images directory on the file system, review the following files for the text alias /i/:

  • Oracle Application Server 10g—see the marvel.conf or dads.conf files.

  • Oracle HTTP Server distributed with Oracle Database 11g—see the marvel.conf or dads.conf files.

When you locate the images directory path, copy the existing images directory to a backup location. Doing so enables you to revert to the previous release, if that becomes necessary.

After you copy the existing images directory, use the following command syntax to copy the apex\images directory from the Oracle Database home to the existing images directory path, overwriting the existing images:

  • Oracle Application Server 10g:

    • On Windows:

      xcopy /E /I APEX_HOME\apex\images ORACLE_HTTPSERVER_HOME\Apache\images
      
    • On UNIX and Linux:

      cp -rf APEX_HOME/apex/images ORACLE_HTTPSERVER_HOME/Apache
      
  • Oracle HTTP Server distributed with Oracle Database 11g:

    • On Windows:

      xcopy /E /I APEX_HOME\apex\images ORACLE_HTTPSERVER_HOME\ohs\images
      
    • On UNIX and Linux:

      cp -rf APEX_HOME/apex/images ORACLE_HTTPSERVER_HOME/ohs
      

In the preceding syntax examples:

  • APEX_HOME is the directory where the Oracle Application Express software was unzipped

  • ORACLE_HTTPSERVER_HOME is the existing Oracle Application Server or Oracle HTTP Server Oracle home

3.5.5.3.2 Copying the Images Directory in a New Installation

After installation, copy the directory apex/images.

  • Oracle Application Server 10g:

    • On Windows:

      xcopy /E /I ORACLE_HOME\apex\images ORACLE_HTTPSERVER_HOME\Apache\images
      
    • On UNIX and Linux:

      cp -rf $ORACLE_HOME/apex/images ORACLE_HTTPSERVER_HOME/Apache
      
  • Oracle HTTP Server distributed with Oracle Database 11g:

    • On Windows:

      xcopy /E /I ORACLE_HOME\apex\images ORACLE_HTTPSERVER_HOME\ohs\images
      
    • On UNIX and Linux:

      cp -rf $ORACLE_HOME/apex/images ORACLE_HTTPSERVER_HOME/ohs
      

In the preceding syntax examples:

  • ORACLE_HOME is the Oracle Database Oracle home

  • ORACLE_HTTPSERVER_HOME is the existing Oracle Application Server or Oracle HTTP Server Oracle home

3.5.5.4 Configuring Oracle HTTP Server 11g or Oracle Application Server 10g

Perform the following post installation steps if:

  • This is a new installation of Oracle Application Express (that is, you are not upgrading from a previous release).

  • You are running Oracle HTTP Server distributed with Oracle Database 11g or Oracle Application Server 10g.

  • Oracle HTTP Server is installed in an Oracle home.

Topics in this section include:

Note:

Within the context of this document, ORACLE_HTTPSERVER_HOME is the location where Oracle HTTP Server is installed.
3.5.5.4.1 Editing the dads.conf File

If this is a new installation of Oracle Application Express, you must edit the dads.conf file. The dads.conf file contains the information about the DAD to access Oracle Application Express.

To edit the dads.conf file:

  1. Use a text editor and open the dads.conf.

    • Oracle Application Server 10g:

      • On Windows see:

        ORACLE_HTTPSERVER_HOME\Apache\modplsql\conf\dads.conf
        
      • On UNIX and Linux see:

        ORACLE_HTTPSERVER_HOME/Apache/modplsql/conf/dads.conf
        
    • Oracle HTTP Server distributed with Oracle Database 11g:

      • On Windows see:

        ORACLE_HTTPSERVER_HOME\ohs\modplsql\conf\dads.conf
        
      • On UNIX and Linux see:

        ORACLE_HTTPSERVER_HOME/ohs/modplsql/conf/dads.conf
        
  2. In the dads.conf file, replace ORACLE_HTTPSERVER_HOME, host, port, service_name, and apex_public_user_password with values appropriate for your environment. Note that the apex_public_user_password is the password you changed in "Changing the Password for the APEX_PUBLIC_USER Account".

    Note that the path listed is only an example. The path in the dads.conf file should reference the file system path described in "Copy the Images Directory".

    Alias /i/ "ORACLE_HTTPSERVER_HOME/Apache/images/"
    
    <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
     PlsqlRequestValidationFunction wwv_flow_epg_include_modules.authorize
     Allow from all
    </Location>
    
  3. Locate the line containing PlsqlNLSLanguage.

    The PlsqlNLSLanguage setting determines the language setting of the DAD. The character set portion of the PlsqlNLSLanguage value must be set to AL32UTF8, regardless of whether or not the database character set is AL32UTF8. For example:

    ...
    PlsqlNLSLanguage            AMERICAN_AMERICA.AL32UTF8
    ...
    
  4. Save and exit the dads.conf file.

3.5.5.4.2 Stopping and Restarting Oracle HTTP Server

To stop and restart Oracle HTTP Server:

  • UNIX and Linux

    If database is 10g and lower, execute the following:

    ORACLE_HTTPSERVER_HOME/opmn/bin/opmnctl stopproc ias-component=HTTP_Server
    ORACLE_HTTPSERVER_HOME/opmn/bin/opmnctl startproc ias-component=HTTP_Server
    
  • Windows, execute the following:

    If database is 10g and lower, execute the following:

    ORACLE_HTTPSERVER_HOME\opmn\bin\opmnctl stopproc ias-component=HTTP_Server
    ORACLE_HTTPSERVER_HOME\opmn\bin\opmnctl startproc ias-component=HTTP_Server
    

Note:

If you are using Oracle HTTP Server that is included with Oracle Fusion Middleware 11.1.1, you may need to replace the ias-component name above if the name given to the component was something other than HTTP_Server when it was installed. The default name is ohs1.

3.5.5.5 Disabling Oracle XML DB HTTP Server

If you were previously using the embedded PL/SQL Gateway and now wish to use Oracle HTTP server and mod_plsql, you need to disable the Oracle XML DB HTTP server.

To disable Oracle XML DB HTTP 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. Run the following command:

    EXEC DBMS_XDB.SETHTTPPORT(0);
    

3.5.6 Enable Network Services in Oracle Database 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_040000 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.

  • Searching for content in online Help (that is, using the Find link).

Topics in this section include:

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 11g database will already have the parameter set properly, but a database upgraded to 11g 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.

3.5.6.1 Granting Connect Privileges

The following example demonstrates how to grant connect privileges to any host for the APEX_040000 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);
  ACL_ID    RAW(16);
BEGIN
  -- Look for the ACL currently assigned to '*' and give APEX_040000
  -- the "connect" privilege if APEX_040000 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;

  -- Before checking the privilege, ensure that the ACL is valid
  -- (for example, does not contain stale references to dropped users).
  -- If it does, the following exception will be raised:
  --
  -- ORA-44416: Invalid ACL: Unresolved principal 'APEX_040000'
  -- ORA-06512: at "XDB.DBMS_XDBZ", line ...
  --
  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_040000', 
     'connect') IS NULL THEN 
      DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH, 
     'APEX_040000', 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_040000', 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 would enable indexing the Oracle Application Express Online Help and could possibly enable email and PDF printing if those servers were also on the local host.

DECLARE
  ACL_PATH  VARCHAR2(4000);
  ACL_ID    RAW(16);
BEGIN
  -- Look for the ACL currently assigned to 'localhost' and give APEX_040000
  -- the "connect" privilege if APEX_040000 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;

  -- Before checking the privilege, ensure that the ACL is valid
  -- (for example, does not contain stale references to dropped users).
  -- If it does, the following exception will be raised:
  --
  -- ORA-44416: Invalid ACL: Unresolved principal 'APEX_040000'
  -- ORA-06512: at "XDB.DBMS_XDBZ", line ...
  --

  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_040000', 
     'connect') IS NULL THEN 
      DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH, 
     'APEX_040000', 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 power users to connect to everywhere',
    'APEX_040000', TRUE, 'connect');
  DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('local-access-users.xml','localhost');
END;
/
COMMIT;

3.5.6.2 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_040000 user. See "Granting Connect Privileges".

3.5.7 Enable Indexing of Online Help in Oracle Database 11gR2 and Higher

The ability to search Oracle Application Express online Help is accomplished through Oracle Text and a URL datastore. There is a change in the default behavior and permissions to use an Oracle Text URL datastore in database 11gR2 and higher.

If users attempt to search Oracle Application Express online Help in Oracle database 11gR2 and encounter the following error, then the permission to use an Oracle Text URL datastore has not been granted to database user APEX_040000.

ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine 
ORA-20000: Oracle Text error: 
DRG-10758: index owner does not have the privilege to use file or URL datastore

To enable the indexing of online Help in Oracle Application Express, the permission to use an Oracle Text URL datastore must be granted to the APEX_040000 database user. This is accomplished by assigning this specific privilege to a database role and then granting this role to the APEX_040000 database user.

To determine if the ability to use an Oracle Text URL datastore is already granted to a database role:

  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 command:

    SELECT par_value FROM ctxsys.ctx_parameters WHERE par_name = 'FILE_ACCESS_ROLE';
    

    This returns either NULL or the database role which is granted the ability to use an Oracle Text URL datastore.

  3. If no value is returned by step 2, then create a new database role as shown in the following example:

    CREATE ROLE APEX_URL_DATASTORE_ROLE;
    
  4. Grant this role to the database user APEX_040000 with the following statement:

    GRANT APEX_URL_DATASTORE_ROLE to APEX_040000;
    

    If step 2 returned a value, use this database role name instead of the example APEX_URL_DATASTORE_ROLE.

  5. Lastly, if step 2 did not return a value, then use the Oracle Text API to grant permission to the newly created database role with the following statement:

    EXEC ctxsys.ctx_adm.set_parameter('file_access_role', 'APEX_URL_DATASTORE_ROLE');
    

3.5.8 Security Considerations

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.

3.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. At runtime, each user's Web browser language settings determine the specific language version.

In order to install other languages you must use the apex_4.0.zip file which contains the extra files referenced below. If you previously downloaded apex_4.0_en.zip, then you don't need to re-install Oracle Application Express. Simply download apex_4.0.zip and unzip the file into the same directory where you unzipped apex_4.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 

3.5.9.1 Installing a Translated Version 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 of directory, there is a language loading script identified by the language code (for example, load_de.sql or load_ja.sql).

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_040000;
    
  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).

3.5.10 About Managing JOB_QUEUE_PROCESSES

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

Topics in this section include:

3.5.10.1 Viewing the Number of JOB_QUEUE_PROCESSES

There are currently three ways to view the number of JOB_QUEUE_PROCESSES:

  • In the installation log file

  • On the About Application Express page in Oracle Application Express

  • From SQL*Plus

3.5.10.1.1 Viewing JOB_QUEUE_PROCESSES in the Installation Log File

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

3.5.10.1.2 Viewing JOB_QUEUE_PROCESSES in Oracle Application Express

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

To view the About Application Express page:

  1. Log in to Oracle Application Express. See "Logging in to Your Workspace".

  2. On the Administration list, click About Application Express.

    The current number JOB_QUEUE_PROCESSES displays at the bottom of the page.

3.5.10.1.3 Viewing JOB_QUEUE_PROCESSES from SQL*Plus

You can also 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'

3.5.10.2 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.

3.5.11 About Obfuscating PlsqlDatabasePassword Parameter

The PlsqlDatabasePassword parameter specifies the password for logging in to the database. You can use the dadTool.pl utility to obfuscate passwords in the dads.conf file.

You can find the dadTool.pl utility in the following directory:

  • For UNIX and Linux based systems:

    ORACLE_BASE/ORACLE_HTTPSERVER_HOME/Apache/modplsql/conf
    
  • For Windows based systems:

    ORACLE_BASE\ORACLE_HTTPSERVER_HOME\Apache\modplsql\conf
    

3.5.11.1 Obfuscating Passwords

To obfuscate passwords, run dadTool.pl by following the instructions in the dadTool.README file.

3.5.12 Create a Workspace and Add Oracle Application Express Users

You access the Oracle Application Express home page by logging in to workspace using a Web browser. Your Web browser must support JavaScript and the HTML 4.0 and CSS 1.0 standards. See "Browser Requirements".

A workspace is a virtual private database allowing 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 "Creating Workspaces" and "Managing Workspace Requests" in Oracle Application Express Administration Guide.

See Also:

Oracle Database 2 Day + Oracle Application Express Developer's Guide if you are new to Oracle Application Express

Topics in this section include:

3.5.12.1 Creating a Workspace Manually

To create an Oracle Application Express workspace manually:

  1. Log in to Oracle Application Express Administration Services. Oracle Application Express Administration Services is a separate application for managing an entire Oracle Application Express instance. You log in using the ADMIN account and password created or reset during the installation process.

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

      Because your setup uses Apache and mod_plsql, go to:

      http://hostname:port/pls/apex/apex_admin
      

      Where:

      hostname is the name of the system where Oracle HTTP Server is installed.

      port is the port number assigned to Oracle HTTP Server. In a default installation, this number is 7777.

      pls is the indicator to use the mod_plsql cartridge.

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

    2. On the Login page:

    See Also:

    See "Logging in to Oracle Application Express Administration Services" in Oracle Application Express Administration Guide.

    Next, create a workspace.

  2. Click Manage Workspaces.

  3. Under Manage Workspaces, click Create Workspace.

    The Create Workspace Wizard appears.

  4. For Identify Workspace, enter a workspace name and description and click Next.

  5. For Identify Schema, select the Oracle Forms application schema.

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

    2. Select a schema from the list.

    3. Click Next.

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

  7. Confirm your selections and click Create.

3.5.12.2 Creating Oracle Application Express Users

To create an Oracle Application Express user account:

  1. Log in to Oracle Application Express Administration Services as described in the previous section. See "Logging in to Oracle Application Express Administration Services" in Oracle Application Express Administration Guide.

  2. Click the Administration icon.

    The Administration page appears.

  3. Click Manage Users and Groups.

  4. Click Create User.

    The Create User page appears.

  5. Under User Identification, enter:

    1. Username - Enter the username used to log in to the system. Restrictions include:

      • Maximum length of 100 characters

      • No spaces

      • Only these special characters are permitted: ampersand (@) and period (.)

    2. Email Address - Enter the valid email address for this user.

    3. First Name - Enter the first or given name to further identify the user (optional).

    4. Last Name - Enter the last or family name to further identify the user (optional).

    5. Description - Enter comments about this user (optional).

  6. Under Account Privileges:

    1. 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.

    2. Accessible Schemas (null for all) - Leave this blank to enable the end user to access all schemas in the workspace, or enter a colon-delimited list of schemas for which this user has permissions when using the SQL Workshop.

    3. User is a workspace 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. Components may not be available if they are switched off by Instance Administrators.

    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 login 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. Under User Groups, optionally select one or more user groups by holding down the CTRL key and selecting the groups.

  9. Click Create User or Create and Create Another.

3.5.12.3 Logging in to Your Workspace

Once you create a workspace, you must log in to it using your login credentials (that is, the workspace name, user name, and password).

See Also:

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

To log in to your workspace:

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

    Because your setup uses the HTTP server, go to:

    http://hostname:port/pls/apex
    

    Where:

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

    • port is the port number assigned to Oracle XML DB HTTP server. In a default installation, this number is 8080.

    • pls is the indicator to use the mod_plsql cartridge.

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

      For users who have upgraded from earlier releases, or who have a custom configuration, this value may be htmldb or something else. Verify your DAD with your Oracle Application Express administrator.

    The Login page appears.

  2. Under Login, enter the following:

    • Workspace field - Enter the name of your workspace.

    • Username field - Enter your user name.

    • Password field - Enter your case-sensitive password.

  3. Click Login.

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

3.6 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.

Topics in this section include:

3.6.1 Remove 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.

3.6.1.1 Verify 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_%' OR USERNAME LIKE 'APEX_%') 
       AND USERNAME NOT IN (
            SELECT 'FLOWS_FILES' 
              FROM DUAL 
             UNION 
            SELECT 'APEX_PUBLIC_USER' FROM DUAL 
             UNION
            SELECT SCHEMA s 
               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.

3.6.1.2 Remove 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 FLOWS_030000 CASCADE;
    

3.6.2 Fix Invalid ACL in Oracle Database 11g

After following the instructions in"Remove Prior Oracle Application Express Installations", you may need to fix an invalid ACL if you are running Oracle Database 11g 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 following:

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

3.7 About the Oracle Application Express Runtime Environment

The 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 the Oracle Application Express runtime environment using SQL*Plus or SQL Developer and the APEX_INSTANCE_ADMIN API. To learn more see, "Managing a Runtime Environment" and in Oracle Application Express Application Builder User's Guide.

Topics in this section include:

3.7.1 Converting a Runtime Environment to a Full Development Environment

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

  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
    
  4. Follow the instructions in "Change the Password for the ADMIN Account".

See Also:

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

3.7.2 Converting a Full Development Environment to a Runtime Environment

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

  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
    

See Also:

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