

# Oracle Application Express (APEX)
<a name="Appendix.Oracle.Options.APEX"></a>

Amazon RDS supports Oracle Application Express (APEX) through the use of the `APEX` and `APEX-DEV` options. You can deploy Oracle APEX as a runtime environment or as a full development environment for web-based applications. Using Oracle APEX, you can build applications entirely within the web browser. For more information, see [Oracle application Express](https://apex.oracle.com/) in the Oracle documentation.

**Topics**
+ [Oracle APEX components](#Appendix.Oracle.Options.APEX.components)
+ [Requirements and limitations](Appendix.Oracle.Options.APEX.Requirements.md)
+ [Setting up Oracle APEX and Oracle Rest Data Services (ORDS)](Appendix.Oracle.Options.APEX.settingUp.md)
+ [Configuring Oracle Rest Data Services (ORDS)](Appendix.Oracle.Options.APEX.ORDSConf.md)
+ [Upgrading and removing Oracle APEX](Appendix.Oracle.Options.APEX.UpgradeandRemove.md)

## Oracle APEX components
<a name="Appendix.Oracle.Options.APEX.components"></a>

Oracle APEX consists of the following main components:
+ A *repository* that stores the metadata for Oracle APEX applications and components. The repository consists of tables, indexes, and other objects that are installed in your Amazon RDS DB instance.
+ A *listener* that manages HTTP communications with Oracle APEX clients. The listener resides on a separate host such as an Amazon EC2 instance, an on-premises server at your company, or your desktop computer. The listener accepts incoming connections from web browsers, forwards them to the Amazon RDS DB instance for processing, and then sends results from the repository back to the browsers. 

  RDS for Oracle supports the following types of listeners:
  + For Oracle APEX version 5.0 and later, use Oracle REST Data Services (ORDS) version 19.1 and higher. We recommend that you use the latest supported version of Oracle APEX and ORDS. This documentation describes older versions for backwards compatibility only.
  + For Oracle APEX version 4.1.1, you can use Oracle APEX Listener version 1.1.4.
  + You can use Oracle HTTP Server and `mod_plsql` listeners.
**Note**  
Amazon RDS doesn't support the Oracle XML DB HTTP server with the embedded PL/SQL gateway as a listener for Oracle APEX. In general, Oracle recommends against using the embedded PL/SQL gateway for applications that run on the internet.

  For more information about these listener types, see [About choosing a web listener](https://docs.oracle.com/database/apex-5.1/HTMIG/choosing-web-listener.htm#HTMIG29321) in the Oracle documentation.

When you add the `APEX` and `APEX-DEV` options to your RDS for Oracle DB instance, Amazon RDS installs the Oracle APEX repository only. Install your listener on a separate host.

# Requirements and limitations
<a name="Appendix.Oracle.Options.APEX.Requirements"></a>

The following topic lists the requirements and limitations for Oracle APEX and ORDS.

## Oracle APEX version requirements
<a name="Appendix.Oracle.Options.APEX.versions"></a>

The `APEX` option uses storage on the DB instance class for your DB instance. Following are the supported versions and approximate storage requirements for Oracle APEX.


****  

| Oracle APEX version | Storage requirements | Supported Oracle Database versions | Notes | 
| --- | --- | --- | --- | 
|  Oracle APEX version 24.2.v1  |  114 MiB  |  All  |  This version includes patch 37885097: PSE BUNDLE FOR APEX 24.2 (PSES ON TOP OF 24.2.0), PATCH\$1VERSION 4.  | 
|  Oracle APEX version 24.1.v1  |  112 MiB  |  All  |  This version includes patch 36695709: PSE BUNDLE FOR APEX 24.1 (PSES ON TOP OF 24.1.0), PATCH\$1VERSION 3. If you need exactly the same APEX images version to install on your EC2 instance, download patch 37544819: 24.1.3 PSE BUNDLE FOR APEX 24.1 (PSES ON TOP OF 24.1.0).  | 
|  Oracle APEX version 23.2.v1  |  110 MiB  |  All  |  This version includes patch 35895964: PSE BUNDLE FOR APEX 23.2 (PSES ON TOP OF 23.2.0), PATCH\$1VERSION 6. If you need exactly the same APEX images version to install on your EC2 instance, download patch 37593125: 23.2.6 PSE BUNDLE FOR APEX 23.2 (PSES ON TOP OF 23.2.0).  | 
|  Oracle APEX version 23.1.v1  |  106 MiB  |  All  |  This version includes patch 35283657: PSE BUNDLE FOR APEX 23.1 (PSES ON TOP OF 23.1.0), PATCH\$1VERSION 2.  | 
|  Oracle APEX version 22.2.v1  |  106 MiB  |  All  |  This version includes patch 34628174: PSE BUNDLE FOR APEX 22.2 (PSES ON TOP OF 22.2.0), PATCH\$1VERSION 4.  | 
|  Oracle APEX version 22.1.v1  |  124 MiB  |  All  |  This version includes patch 34020981: PSE BUNDLE FOR APEX 22.1 (PSES ON TOP OF 22.1.0), PATCH\$1VERSION 6.  | 
|  Oracle APEX version 21.2.v1  |  125 MiB  |  All  |  This version includes patch 33420059: PSE BUNDLE FOR APEX 21.2 (PSES ON TOP OF 21.2.0), PATCH\$1VERSION 8.  | 
|  Oracle APEX version 21.1.v1  |  125 MiB  |  All  |  This version includes patch 32598392: PSE BUNDLE FOR APEX 21.1, PATCH\$1VERSION 3.  | 
|  Oracle APEX version 20.2.v1  |  148 MiB  |  All except Oracle Database 21c  |  This version includes patch 32006852: PSE BUNDLE FOR APEX 20.2, PATCH\$1VERSION 2020.11.12. You can see the patch number and date by running the following query: <pre>SELECT PATCH_VERSION, PATCH_NUMBER <br />FROM   APEX_PATCHES;</pre>  | 
|  Oracle APEX version 20.1.v1  |  173 MiB  |  All except Oracle Database 21c  |  This version includes patch 30990551: PSE BUNDLE FOR APEX 20.1, PATCH\$1VERSION 2020.07.15.  | 
|  Oracle APEX version 19.2.v1  |  149 MiB  |  All except Oracle Database 21c  |  | 
|  Oracle APEX version 19.1.v1  |  148 MiB  |  All except Oracle Database 21c  |  | 

For downloadable Oracle APEX .zip files, see [ Oracle APEX Prior Release Archives ](https://www.oracle.com/tools/downloads/apex-all-archives-downloads.html) on the Oracle website.

## Oracle APEX and ORDS prerequisites
<a name="Appendix.Oracle.Options.APEX.PreReqs"></a>

Note the following prerequisites for using Oracle APEX and ORDS:
+ Your system must use the Java Runtime Environment (JRE).
+ Your Oracle client installation must include the following:
  + SQL\$1Plus or SQL Developer for administration tasks
  + Oracle Net Services for configuring connections to your RDS for Oracle DB instance

## Oracle APEX limitations
<a name="Appendix.Oracle.Options.APEX.limitations"></a>

You can't modify the `APEX_version` user account, which is managed by Amazon RDS. Thus, you can't apply database profiles or enforce password rules on this user. The profiles and password settings for `APEX_version` are predefined by Oracle and AWS and are designed to meet the security requirements for Amazon RDS.

# Setting up Oracle APEX and Oracle Rest Data Services (ORDS)
<a name="Appendix.Oracle.Options.APEX.settingUp"></a>

The following topic lists the steps required to set up Oracle APEX and ORDS

**Topics**
+ [Adding the APEX and APEX-DEV options to your DB instance](#Appendix.Oracle.Options.APEX.Add)
+ [Unlocking the public user account on your DB instance](#Appendix.Oracle.Options.APEX.PublicUser)
+ [Configuring RESTful services for Oracle APEX](#Appendix.Oracle.Options.APEX.ConfigureRESTful)
+ [Preparing to install ORDS on a separate host](#Appendix.Oracle.Options.APEX.ORDS.ords-setup)
+ [Setting up Oracle APEX listener](#Appendix.Oracle.Options.APEX.Listener)

## Adding the APEX and APEX-DEV options to your DB instance
<a name="Appendix.Oracle.Options.APEX.Add"></a>

To add the `APEX` and `APEX-DEV` options to your RDS for Oracle DB instance, do the following: 

1. Create a new option group, or copy or modify an existing option group.

1. Add the `APEX` and `APEX-DEV` options to the option group.

1. Associate the option group with your DB instance.

When you add the `APEX` and `APEX-DEV` options, a brief outage occurs while your DB instance is automatically restarted. 

**Note**  
`APEX_MAIL` is available when the `APEX` option is installed. The execute privilege for the `APEX_MAIL` package is granted to `PUBLIC` so you don't need the APEX administrative account to use it.

**To add the APEX and APEX-DEV options to a DB instance**

1. Determine the option group that you want to use. You can create a new option group or use an existing option group. If you want to use an existing option group, skip to the next step. Otherwise, create a custom DB option group with the following settings: 

   1. For **Engine**, choose the Oracle edition that you want to use. The `APEX` and `APEX-DEV` options are supported on all editions. 

   1. For **Major engine version**, choose the version of your DB instance. 

   For more information, see [Creating an option group](USER_WorkingWithOptionGroups.md#USER_WorkingWithOptionGroups.Create). 

1. Add the options to the option group. If you want to deploy only the Oracle APEX runtime environment, add only the `APEX` option. To deploy the full development environment, add both the `APEX` and `APEX-DEV` options.

   For **Version**, choose the version of Oracle APEX that you want to use.
**Important**  
If you add the `APEX` or `APEX-DEV` options to an existing option group that is already attached to one or more DB instances, a brief outage occurs. During this outage, all the DB instances are automatically restarted. 

   For more information about adding options, see [Adding an option to an option group](USER_WorkingWithOptionGroups.md#USER_WorkingWithOptionGroups.AddOption). 

1. Apply the option group to a new or existing DB instance: 
   + For a new DB instance, you apply the option group when you launch the instance. For more information, see [Creating an Amazon RDS DB instance](USER_CreateDBInstance.md). 
   + For an existing DB instance, you apply the option group by modifying the instance and attaching the new option group. When you add the `APEX` or `APEX-DEV` options to an existing DB instance, a brief outage occurs while your DB instance is automatically restarted. For more information, see [Modifying an Amazon RDS DB instance](Overview.DBInstance.Modifying.md). 

## Unlocking the public user account on your DB instance
<a name="Appendix.Oracle.Options.APEX.PublicUser"></a>

After you have installed the `APEX` or `APEX-DEV` options your DB instance, make sure to do the following:

1. Change the password for the `APEX_PUBLIC_USER` account.

1. Unlock the account.

You can do this by using the Oracle SQL\$1Plus command line utility. Connect to your DB instance as the master user, and issue the following commands. Replace `new_password` with a password of your choice. 

```
1. ALTER USER APEX_PUBLIC_USER IDENTIFIED BY new_password;
2. ALTER USER APEX_PUBLIC_USER ACCOUNT UNLOCK;
```

## Configuring RESTful services for Oracle APEX
<a name="Appendix.Oracle.Options.APEX.ConfigureRESTful"></a>

To configure RESTful services in Oracle APEX (not needed for Oracle APEX 4.1.1.V1), use SQL\$1Plus to connect to your DB instance as the master user. After you do this, run the `rdsadmin.rdsadmin_run_apex_rest_config` stored procedure. When you run the stored procedure, you provide passwords for the following users:
+ `APEX_LISTENER`
+ `APEX_REST_PUBLIC_USER`

The stored procedure runs the `apex_rest_config.sql` script, which creates new database accounts for these users.

**Note**  
Configuration isn't required for Oracle APEX version 4.1.1.v1. For this Oracle APEX version only, you don't need to run the stored procedure.

The following command runs the stored procedure.

```
1. EXEC rdsadmin.rdsadmin_run_apex_rest_config('apex_listener_password', 'apex_rest_public_user_password');
```

## Preparing to install ORDS on a separate host
<a name="Appendix.Oracle.Options.APEX.ORDS.ords-setup"></a>

Install ORDS on a separate host such as an Amazon EC2 instance, an on-premises server at your company, or your desktop computer. The examples in this section,assume that your host runs Linux and is named `myapexhost.example.com`.

Before you can install ORDS, you need to create a nonprivileged OS user, and then download and unzip the Oracle APEX installation file.

**To prepare for ORDS installation**

1. Log in to `myapexhost.example.com` as `root`. 

1. Create a nonprivileged OS user to own the listener installation. The following command creates a new user named *apexuser*. 

   ```
   useradd -d /home/apexuser apexuser
   ```

   The following command assigns a password to the new user. 

   ```
   passwd apexuser;
   ```

1. Log in to `myapexhost.example.com` as `apexuser`, and download the Oracle APEX installation file from Oracle to your `/home/apexuser` directory: 
   + [http://www.oracle.com/technetwork/developer-tools/apex/downloads/index.html](http://www.oracle.com/technetwork/developer-tools/apex/downloads/index.html) 
   + [Oracle application Express prior release archives](http://www.oracle.com/technetwork/developer-tools/apex/downloads/all-archives-099381.html) 

1. Unzip the file in the `/home/apexuser` directory.

   ```
   unzip apex_version.zip
   ```

   After you unzip the file, there is an `apex` directory in the `/home/apexuser` directory.

1. While you are still logged into `myapexhost.example.com` as `apexuser`, download the Oracle REST Data Services file from Oracle to your `/home/apexuser` directory: [http://www.oracle.com/technetwork/developer-tools/apex-listener/downloads/index.html](http://www.oracle.com/technetwork/developer-tools/apex-listener/downloads/index.html).

## Setting up Oracle APEX listener
<a name="Appendix.Oracle.Options.APEX.Listener"></a>

**Note**  
Oracle APEX Listener is deprecated. 

Amazon RDS for Oracle continues to support Oracle APEX version 4.1.1 and Oracle APEX Listener version 1.1.4. We recommend that you use the latest supported versions of Oracle APEX and ORDS.

Install Oracle APEX Listener on a separate host such as an Amazon EC2 instance, an on-premises server at your company, or your desktop computer. We assume that the name of your host is `myapexhost.example.com`, and that your host is running Linux.

### Preparing to install Oracle APEX listener
<a name="Appendix.Oracle.Options.APEX.Listener.preparing"></a>

Before you can install Oracle APEX Listener, you need to create a nonprivileged OS user, and then download and unzip the Oracle APEX installation file.

**To prepare for Oracle APEX listener installation**

1. Log in to `myapexhost.example.com` as `root`. 

1. Create a nonprivileged OS user to own the listener installation. The following command creates a new user named *apexuser*. 

   ```
   useradd -d /home/apexuser apexuser
   ```

   The following command assigns a password to the new user. 

   ```
   passwd apexuser;
   ```

1. Log in to `myapexhost.example.com` as `apexuser`, and download the Oracle APEX installation file from Oracle to your `/home/apexuser` directory: 
   + [http://www.oracle.com/technetwork/developer-tools/apex/downloads/index.html](http://www.oracle.com/technetwork/developer-tools/apex/downloads/index.html) 
   + [Oracle application Express prior release archives](http://www.oracle.com/technetwork/developer-tools/apex/downloads/all-archives-099381.html) 

1. Unzip the file in the `/home/apexuser` directory.

   ```
   unzip apex_<version>.zip                
   ```

   After you unzip the file, there is an `apex` directory in the `/home/apexuser` directory.

1. While you are still logged into `myapexhost.example.com` as `apexuser`, download the Oracle APEX Listener file from Oracle to your `/home/apexuser` directory.

#### Installing and configuring Oracle APEX listener
<a name="Appendix.Oracle.Options.APEX.Listener.installing"></a>

Before you can use Oracle APEX, you need to download the `apex.war` file, use Java to install Oracle APEX Listener, and then start the listener.

**To install and configure Oracle APEX listener**

1. Create a new directory based on Oracle APEX Listener and open the listener file.

   Run the following code:

   ```
   mkdir /home/apexuser/apexlistener
   cd /home/apexuser/apexlistener 
   unzip ../apex_listener.version.zip
   ```

1. Run the following code.

   ```
   java -Dapex.home=./apex -Dapex.images=/home/apexuser/apex/images -Dapex.erase -jar ./apex.war
   ```

1. Enter information for the program prompts following: 
   + The APEX Listener Administrator user name. The default is *adminlistener*. 
   + A password for the APEX Listener Administrator. 
   + The APEX Listener Manager user name. The default is *managerlistener*. 
   + A password for the APEX Listener Administrator. 

   The program prints a URL that you need to complete the configuration, as follows.

   ```
   INFO: Please complete configuration at: http://localhost:8080/apex/listenerConfigure
   Database is not yet configured
   ```

1. Leave Oracle APEX Listener running so that you can use Oracle Application Express. When you have finished this configuration procedure, you can run the listener in the background. 

1. From your web browser, go to the URL provided by the Oracle APEX Listener program. The Oracle Application Express Listener administration window appears. Enter the following information: 
   + **Username** – `APEX_PUBLIC_USER`
   + **Password** – the password for *APEX\$1PUBLIC\$1USER*. This password is the one that you specified earlier when you configured the Oracle APEX repository. For more information, see [Unlocking the public user account on your DB instance](#Appendix.Oracle.Options.APEX.PublicUser). 
   + **Connection type** – Basic 
   + **Hostname** – the endpoint of your Amazon RDS DB instance, such as `mydb.f9rbfa893tft.us-east-1.rds.amazonaws.com`. 
   + **Port** – 1521
   + **SID** – the name of the database on your Amazon RDS DB instance, such as `mydb`. 

1. Choose **Apply**. The Oracle APEX administration window appears. 

1. Set a password for the Oracle APEX `admin` user. To do this, use SQL\$1Plus to connect to your DB instance as the master user, and then run the following commands.

   ```
   1. EXEC rdsadmin.rdsadmin_util.grant_apex_admin_role;
   2. grant APEX_ADMINISTRATOR_ROLE to master;
   3. @/home/apexuser/apex/apxchpwd.sql
   ```

   Replace `master` with your master user name. When the `apxchpwd.sql` script prompts you, enter a new `admin` password. 

1. Return to the Oracle APEX administration window in your browser and choose **Administration**. Next, choose **Application Express Internal Administration**. When you are prompted for credentials, enter the following information: 
   + **User name** – `admin` 
   + **Password** – the password you set using the `apxchpwd.sql` script 

   Choose **Login**, and then set a new password for the `admin` user. 

Your listener is now ready for use.

# Configuring Oracle Rest Data Services (ORDS)
<a name="Appendix.Oracle.Options.APEX.ORDSConf"></a>

The following topic lists the configuration options for ORDS 21 and 22:

**Topics**
+ [Installing and configuring ORDS 21 and lower](#Appendix.Oracle.Options.APEX.ORDS)
+ [Installing and configuring ORDS 22 and higher](#Appendix.Oracle.Options.APEX.ORDS22)

## Installing and configuring ORDS 21 and lower
<a name="Appendix.Oracle.Options.APEX.ORDS"></a>

You are now ready to install and configure Oracle Rest Data Services (ORDS) for use with Oracle APEX. For Oracle APEX version 5.0 and later, use ORDS versions 19.1 to 21. To learn how to install ORDS 22 and higher, see [Installing and configuring ORDS 22 and higher](#Appendix.Oracle.Options.APEX.ORDS22).

Install the listener on a separate host such as an Amazon EC2 instance, an on-premises server at your company, or your desktop computer. For the examples in this section, we assume that the name of your host is `myapexhost.example.com`, and that your host is running Linux.

**To install and configure ORDS 21 and lower for use with Oracle APEX**

1. Go to [Oracle REST data services](https://www.oracle.com/database/technologies/appdev/rest-data-services-downloads-212.html), and examine the Readme. Make sure that you have the required version of Java installed.

1. Create a new directory for your ORDS installation.

   ```
   mkdir /home/apexuser/ORDS
   cd /home/apexuser/ORDS
   ```

1. Download the file `ords.version.number.zip` from [Oracle REST data services](https://www.oracle.com/database/technologies/appdev/rest-data-services-downloads-212.html).

1. Unzip the file into the `/home/apexuser/ORDS` directory.

1. If you're installing ORDS in a multitenant database, add the following line to the file `/home/apexuser/ORDS/params/ords_params.properties`:

   ```
   pdb.disable.lockdown=false
   ```

1. Grant the master user the required privileges to install ORDS.

   After the options for Oracle APEX are installed, give the master user the required privileges to install the ORDS schema. You can do this by connecting to the database and running the following commands. Replace `MASTER_USER` with the uppercase name of your master user.
**Important**  
When you enter the user name, use uppercase unless you created the user with a case-sensitive identifier. For example, if you run `CREATE USER myuser` or `CREATE USER MYUSER`, the data dictionary stores `MYUSER`. However, if you use double quotes in `CREATE USER "MyUser"`, the data dictionary stores `MyUser`. For more information, see [Granting SELECT or EXECUTE privileges to SYS objects](Appendix.Oracle.CommonDBATasks.TransferPrivileges.md).

   ```
   exec rdsadmin.rdsadmin_util.grant_sys_object('DBA_OBJECTS', 'MASTER_USER', 'SELECT', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('DBA_ROLE_PRIVS', 'MASTER_USER', 'SELECT', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('DBA_TAB_COLUMNS', 'MASTER_USER', 'SELECT', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('USER_CONS_COLUMNS', 'MASTER_USER', 'SELECT', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('USER_CONSTRAINTS', 'MASTER_USER', 'SELECT', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('USER_OBJECTS', 'MASTER_USER', 'SELECT', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('USER_PROCEDURES', 'MASTER_USER', 'SELECT', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('USER_TAB_COLUMNS', 'MASTER_USER', 'SELECT', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('USER_TABLES', 'MASTER_USER', 'SELECT', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('USER_VIEWS', 'MASTER_USER', 'SELECT', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('WPIUTL', 'MASTER_USER', 'EXECUTE', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('DBMS_SESSION', 'MASTER_USER', 'EXECUTE', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('DBMS_UTILITY', 'MASTER_USER', 'EXECUTE', true);
   ```
**Note**  
These commands apply to ORDS version 19.1 and later.

1. Install the ORDS schema using the downloaded ords.war file.

   ```
   java -jar ords.war install advanced
   ```

   The program prompts you for the following information. The default values are in brackets. For more information, see [Introduction to Oracle REST data services](https://docs.oracle.com/en/database/oracle/oracle-rest-data-services/20.2/aelig/installing-REST-data-services.html#GUID-6F7B4E61-B730-4E73-80B8-F53299123730) in the Oracle documentation.
   + Enter the location to store configuration data:

     Enter */home/apexuser/ORDS*. This is the location of the ORDS configuration files.
   + Specify the database connection type to use. Enter number for [1] Basic [2] TNS [3] Custom URL [1]:

     Choose the desired connection type.
   + Enter the name of the database server [localhost]: *DB\$1instance\$1endpoint*

     Choose the default or enter the correct value.
   + Enter the database listener port [1521]: *DB\$1instance\$1port*

     Choose the default or enter the correct value.
   + Enter 1 to specify the database service name, or 2 to specify the database SID [1]:

     Choose `2` to specify the database SID. 
   + Database SID [xe]

     Choose the default or enter the correct value.
   + Enter 1 if you want to verify/install Oracle REST Data Services schema or 2 to skip this step [1]:

     Choose `1`. This step creates the Oracle REST Data Services proxy user named ORDS\$1PUBLIC\$1USER.
   + Enter the database password for ORDS\$1PUBLIC\$1USER:

     Enter the password, and then confirm it.
   + Requires to login with administrator privileges to verify Oracle REST Data Services schema.

     Enter the administrator user name: *master\$1user*

     Enter the database password for *master\$1user*: *master\$1user\$1password*

     Confirm the password: *master\$1user\$1password*
**Note**  
Specify a password other than the prompt shown here as a security best practice.
   + Enter the default tablespace for ORDS\$1METADATA [SYSAUX].

     Enter the temporary tablespace for ORDS\$1METADATA [TEMP].

     Enter the default tablespace for ORDS\$1PUBLIC\$1USER [USERS].

     Enter the temporary tablespace for ORDS\$1PUBLIC\$1USER [TEMP].
   + Enter 1 if you want to use PL/SQL Gateway or 2 to skip this step. If you're using Oracle Application Express or migrating from mod\$1plsql, you must enter 1 [1].

     Choose the default.
   + Enter the PL/SQL Gateway database user name [APEX\$1PUBLIC\$1USER]

     Choose the default.
   + Enter the database password for APEX\$1PUBLIC\$1USER:

     Enter the password, and then confirm it.
   + Enter 1 to specify passwords for Application Express RESTful Services database users (APEX\$1LISTENER, APEX\$1REST\$1PUBLIC\$1USER) or 2 to skip this step [1]:

     Choose `2` for APEX 4.1.1.V1; choose `1` for all other APEX versions.
   + [Not needed for APEX 4.1.1.v1] Database password for APEX\$1LISTENER

     Enter the password (if required), and then confirm it.
   + [Not needed for APEX 4.1.1.v1] Database password for APEX\$1REST\$1PUBLIC\$1USER

     Enter the password (if required), and then confirm it.
   + Enter a number to select a feature to enable:

     Enter `1` to enable all features: SQL Developer Web, REST Enabled SQL, and Database API.
   + Enter 1 if you wish to start in standalone mode or 2 to exit [1]:

     Enter `1`.
   + Enter the APEX static resources location:

     If you unzipped APEX installation files into `/home/apexuser`, enter `/home/apexuser/apex/images`. Otherwise, enter `unzip_path/apex/images`, where *unzip\$1path* is the directory where you unzipped the file.
   + Enter 1 if using HTTP or 2 if using HTTPS [1]:

     If you enter `1`, specify the HTTP port. If you enter `2`, specify the HTTPS port and the SSL host name. The HTTPS option prompts you to specify how you will provide the certificate:
     + Enter `1` to use the self-signed certificate.
     + Enter `2` to provide your own certificate. If you enter `2`, specify the path for the SSL certificate and the path for the SSL certificate private key.

1. Set a password for the APEX `admin` user. To do this, use SQL\$1Plus to connect to your DB instance as the master user, and then run the following commands.

   ```
   1. EXEC rdsadmin.rdsadmin_util.grant_apex_admin_role;
   2. grant APEX_ADMINISTRATOR_ROLE to master;
   3. @/home/apexuser/apex/apxchpwd.sql
   ```

   Replace `master` with your master user name. When the `apxchpwd.sql` script prompts you, enter a new `admin` password. 

1. Start the ORDS listener. Run the following code.

   ```
   java -jar ords.war
   ```

   The first time you start ORDS, you are prompted to provide the location of the APEX Static resources. This images folder is located in the `/apex/images` directory in the installation directory for APEX. 

1. Return to the Oracle APEX administration window in your browser and choose **Administration**. Next, choose **Application Express Internal Administration**. When you are prompted for credentials, enter the following information: 
   + **User name** – `admin` 
   + **Password** – the password you set using the `apxchpwd.sql` script 

   Choose **Login**, and then set a new password for the `admin` user. 

Your listener is now ready for use.

## Installing and configuring ORDS 22 and higher
<a name="Appendix.Oracle.Options.APEX.ORDS22"></a>

You are now ready to install and configure Oracle Rest Data Services (ORDS) for use with Oracle APEX. For the examples in this section, we assume that the name of your separate host is `myapexhost.example.com`, and that your host is running Linux. The instructions for ORDS 22 differ from the instructions for previous releases.

**To install and configure ORDS 22 and higher for use with Oracle APEX**

1. Go to [Oracle REST data services](http://www.oracle.com/technetwork/developer-tools/rest-data-services/downloads/index.html), and examine the Readme for the ORDS version that you plan to download. Make sure that you have the required version of Java installed.

1. Create a new directory for your ORDS installation.

   ```
   mkdir /home/apexuser/ORDS
   cd /home/apexuser/ORDS
   ```

1. Download the file `ords.version.number.zip` or `ords-latest.zip` from [Oracle REST data services](http://www.oracle.com/technetwork/developer-tools/rest-data-services/downloads/index.html).

1. Unzip the file into the `/home/apexuser/ORDS` directory.

1. Grant the master user the required privileges to install ORDS.

   After the `APEX` option is installed, give the master user the required privileges to install the ORDS schema. You can do this by logging in to the database and running the following commands. Replace `MASTER_USER` with the uppercase name of your master user.
**Important**  
When you enter the user name, use uppercase unless you created the user with a case-sensitive identifier. For example, if you run `CREATE USER myuser` or `CREATE USER MYUSER`, the data dictionary stores `MYUSER`. However, if you use double quotes in `CREATE USER "MyUser"`, the data dictionary stores `MyUser`. For more information, see [Granting SELECT or EXECUTE privileges to SYS objects](Appendix.Oracle.CommonDBATasks.TransferPrivileges.md).

   ```
   exec rdsadmin.rdsadmin_util.grant_sys_object('DBA_OBJECTS', 'MASTER_USER', 'SELECT', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('DBA_ROLE_PRIVS', 'MASTER_USER', 'SELECT', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('DBA_TAB_COLUMNS', 'MASTER_USER', 'SELECT', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('USER_CONS_COLUMNS', 'MASTER_USER', 'SELECT', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('USER_CONSTRAINTS', 'MASTER_USER', 'SELECT', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('USER_OBJECTS', 'MASTER_USER', 'SELECT', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('USER_PROCEDURES', 'MASTER_USER', 'SELECT', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('USER_TAB_COLUMNS', 'MASTER_USER', 'SELECT', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('USER_TABLES', 'MASTER_USER', 'SELECT', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('USER_VIEWS', 'MASTER_USER', 'SELECT', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('WPIUTL', 'MASTER_USER', 'EXECUTE', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('DBMS_SESSION', 'MASTER_USER', 'EXECUTE', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('DBMS_UTILITY', 'MASTER_USER', 'EXECUTE', true);
   
   exec rdsadmin.rdsadmin_util.grant_sys_object('DBMS_LOB', 'MASTER_USER', 'EXECUTE', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('DBMS_ASSERT', 'MASTER_USER', 'EXECUTE', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('DBMS_OUTPUT', 'MASTER_USER', 'EXECUTE', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('DBMS_SCHEDULER', 'MASTER_USER', 'EXECUTE', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('HTP', 'MASTER_USER', 'EXECUTE', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('OWA', 'MASTER_USER', 'EXECUTE', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('WPG_DOCLOAD', 'MASTER_USER', 'EXECUTE', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('DBMS_CRYPTO', 'MASTER_USER', 'EXECUTE', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('DBMS_METADATA', 'MASTER_USER', 'EXECUTE', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('DBMS_SQL', 'MASTER_USER', 'EXECUTE', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('UTL_SMTP', 'MASTER_USER', 'EXECUTE', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('DBMS_NETWORK_ACL_ADMIN', 'MASTER_USER', 'EXECUTE', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('SESSION_PRIVS', 'MASTER_USER', 'SELECT', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('DBA_USERS', 'MASTER_USER', 'SELECT', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('DBA_NETWORK_ACL_PRIVILEGES', 'MASTER_USER', 'SELECT', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('DBA_NETWORK_ACLS', 'MASTER_USER', 'SELECT', true);
   exec rdsadmin.rdsadmin_util.grant_sys_object('DBA_REGISTRY', 'MASTER_USER', 'SELECT', true);
   ```
**Note**  
The preceding commands apply to ORDS 22 and later.

1. Install the ORDS schema using the downloaded `ords` script. Specify directories to contain configuration files and log files. Oracle Corporation recommends not placing these directories inside the directory that contains the ORDS product software.

   ```
   mkdir -p /home/apexuser/ords_config /home/apexuser/ords_logs
   
   /home/apexuser/ORDS/bin/ords \
     --config /home/apexuser/ords_config \
     install --interactive --log-folder /home/apexuser/ords_logs
   ```

   For DB instances running the container database (CDB) architecture, use ORDS 23.3 or higher and pass the `--pdb-skip-disable-lockdown` argument when installing ORDS.

   ```
   /home/apexuser/ORDS/bin/ords \
     --config /home/apexuser/ords_config \
     install --interactive --log-folder /home/apexuser/ords_logs --pdb-skip-disable-lockdown
   ```

   The program prompts you for the following information. The default values are in brackets. For more information, see [Introduction to Oracle REST data services](https://docs.oracle.com/en/database/oracle/oracle-rest-data-services/20.2/aelig/installing-REST-data-services.html#GUID-6F7B4E61-B730-4E73-80B8-F53299123730) in the Oracle documentation.
   + `Choose the type of installation:`

     Choose **2** to install ORDS schemas in the database and create a database connection pool in the local ORDS configuration files.
   + `Specify the database connection type to use. Enter number for [1] Basic [2] TNS [3] Custom URL:`

     Choose the desired connection type. This example assumes that you choose **1**.
   + `Enter the name of the database server [localhost]:` ***DB\$1instance\$1endpoint***

     Choose the default or enter the correct value.
   + `Enter the database listener port [1521]:` ***DB\$1instance\$1port***

     Choose the default **1521** or enter the correct value.
   + `Enter the database service name [orcl]:`

     Enter the database name used by your RDS for Oracle DB instance.
   + `Provide database user name with administrator privileges`

      Enter the master user name for your RDS for Oracle DB instance.
   + `Enter the database password for [username]:`

     Enter the master user password for your RDS for Oracle DB instance.
   + `Enter the default tablespace for ORDS_METADATA and ORDS_PUBLIC_USER [SYSAUX]:`
   + `Enter the temporary tablespace for ORDS_METADATA [TEMP]. Enter the default tablespace for ORDS_PUBLIC_USER [USERS]. Enter the temporary tablespace for ORDS_PUBLIC_USER [TEMP].`
   + `Enter a number to select additional feature(s) to enable [1]:`
   + `Enter a number to configure and start ORDS in standalone mode [1]: `

      Choose **2** to skip starting ORDS immediately in standalone mode.
   + `Enter a number to select the protocol [1] HTTP`
   + `Enter the HTTP port [8080]:`
   + `Enter the APEX static resources location:`

     Enter the path to the Oracle APEX installation files (`/home/apexuser/apex/images`).

1. Set a password for the Oracle APEX `admin` user. To do this, use SQL\$1Plus to connect to your DB instance as the master user, and then run the following commands.

   ```
   1. EXEC rdsadmin.rdsadmin_util.grant_apex_admin_role;
   2. grant APEX_ADMINISTRATOR_ROLE to master;
   3. @/home/apexuser/apex/apxchpwd.sql
   ```

   Replace `master` with your master user name. When the `apxchpwd.sql` script prompts you, enter a new `admin` password. 

1. Run ORDS in standalone mode using the `ords` script with the `serve` command. For production deployments, consider using supported Java EE application servers such as Apache Tomcat or Oracle WebLogic Server. For more information, see [Deploying and Monitoring Oracle REST Data Services](https://docs.oracle.com/en/database/oracle/oracle-rest-data-services/23.1/ordig/deploying-and-monitoring-oracle-rest-data-services.html#GUID-6791F5DF-AC67-4885-BFFA-B80964C17EC9) in the Oracle Database documentation.

   ```
   /home/apexuser/ORDS/bin/ords \
     --config /home/apexuser/ords_config serve \
     --port 8193 \
     --apex-images /home/apexuser/apex/images
   ```

   If ORDS is running but unable to access the Oracle APEX installation, you might see the following error, particularly on non-CDB instances. 

   ```
   The procedure named apex_admin could not be accessed, it may not be declared, or the user executing this request may not have been granted execute privilege on the procedure, or a function specified by security.requestValidationFunction configuration property has prevented access.
   ```

   To fix this error, change the request validation function used by ORDS by running the `ords` script with the `config` command. By default, ORDS uses the `ords_util.authorize_plsql_gateway` procedure, which is only supported on CDB instances. For non-CDB instances, you can change this procedure to the `wwv_flow_epg_include_modules.authorize` package. See the Oracle Database documentation and Oracle Support for best practices on configuring the proper request validation function for your use case.

1. Return to the Oracle APEX administration window in your browser and choose **Administration**. Next, choose **Application Express Internal Administration**. When you are prompted for credentials, enter the following information: 
   + **User name** – `admin` 
   + **Password** – the password you set using the `apxchpwd.sql` script 

   Choose **Login**, and then set a new password for the `admin` user. 

Your listener is now ready for use.

# Upgrading and removing Oracle APEX
<a name="Appendix.Oracle.Options.APEX.UpgradeandRemove"></a>

To upgrade or remove Oracle APEX, follow the instructions in this topic:

**Topics**
+ [Upgrading the Oracle APEX version](#Appendix.Oracle.Options.APEX.Upgrade)
+ [Removing the APEX and APEX-DEV options](#Appendix.Oracle.Options.APEX.Remove)

## Upgrading the Oracle APEX version
<a name="Appendix.Oracle.Options.APEX.Upgrade"></a>

**Important**  
Back up your DB instance before you upgrade Oracle APEX. For more information, see [Creating a DB snapshot for a Single-AZ DB instance for Amazon RDS](USER_CreateSnapshot.md) and [Testing an Oracle DB upgrade](USER_UpgradeDBInstance.Oracle.UpgradeTesting.md). 

To upgrade Oracle APEX with your DB instance, do the following: 
+ Create a new option group for the upgraded version of your DB instance. 
+ Add the upgraded versions of the `APEX` and `APEX-DEV` options to the new option group. Be sure to include any other options that your DB instance uses. For more information, see [Option group considerations](USER_UpgradeDBInstance.Oracle.OGPG.md#USER_UpgradeDBInstance.Oracle.OGPG.OG). 
+ When you upgrade your DB instance, specify the new option group for your upgraded DB instance. 

After you upgrade your version of Oracle APEX, the Oracle APEX schema for the previous version might still exist in your database. If you don't need it anymore, you can drop the old Oracle APEX schema from your database after you upgrade. 

If you upgrade the Oracle APEX version and RESTful services were not configured in the previous Oracle APEX version, we recommend that you configure RESTful services. For more information, see [Configuring RESTful services for Oracle APEX](Appendix.Oracle.Options.APEX.settingUp.md#Appendix.Oracle.Options.APEX.ConfigureRESTful).

In some cases when you plan to do a major version upgrade of your DB instance, you might find that you're using an Oracle APEX version that isn't compatible with your target database version. In these cases, you can upgrade your version of Oracle APEX before you upgrade your DB instance. Upgrading Oracle APEX first can reduce the amount of time that it takes to upgrade your DB instance. 

**Note**  
After upgrading Oracle APEX, install and configure a listener for use with the upgraded version. For instructions, see [Setting up Oracle APEX listener](Appendix.Oracle.Options.APEX.settingUp.md#Appendix.Oracle.Options.APEX.Listener).

## Removing the APEX and APEX-DEV options
<a name="Appendix.Oracle.Options.APEX.Remove"></a>

You can remove the `APEX` and `APEX-DEV` options from a DB instance. To remove these options from your DB instance, do one of the following: 
+ To remove the `APEX` and `APEX-DEV` options from multiple DB instances, remove the options from the option group they belong to. This change affects all DB instances that use the option group. When you remove the options from an option group that is attached to multiple DB instances, a brief outage occurs while the DB instances are restarted. 

  For more information, see [Removing an option from an option group](USER_WorkingWithOptionGroups.md#USER_WorkingWithOptionGroups.RemoveOption). 
+ To remove the `APEX` and `APEX-DEV` options from a single DB instance, modify the DB instance and specify a different option group that doesn't include these options. You can specify the default (empty) option group, or a different custom option group. When you remove the options, a brief outage occurs while your DB instance is automatically restarted. 

  For more information, see [Modifying an Amazon RDS DB instance](Overview.DBInstance.Modifying.md). 

When you remove the `APEX` and `APEX-DEV` options from a DB instance, the APEX schema is removed from your database. 