It’s a good start in November 2021 because Oracle has just released a new version of Oracle APEX with boatloads of updates and new features. In this article we are going to setup Oracle APEX 21.2 and ORDS on Windows 10 like a pro that we are.

Setting up Oracle APEX in a local machine enables us to test out the new features without fearing any interruptions in the production server and existing APEX webapps if there are things that just does not play well yet. It also makes a great staging ground to test out updates before deploying it in a production setting later on.

If you are more interested in installing an older version of Oracle APEX, here’s a guide on how to install Oracle APEX 20.2 and ORDS on a Windows 10 machine instead.

But before we dive ahead to setup Oracle Apex 21.2, we will need to have a database ready to host the files. For that we will need to install the free and newly released Oracle Database 21c Express Edition first.

Setup Oracle APEX 21.2: Oracle Database 21c installation

Firstly, download your copy of the free Oracle Database 21c XE. Installation is pretty straightforward and do run it with administrator rights if you are on computer attached to a domain. Just follow the installation instruction prompts.

Oracle-21c-Install

Enter the password for the Oracle Database 21c XE instance. The password will be used to login with the SYS, SYSTEM and PDBADMIN accounts. Do jot down or make the password memorable as it is needed during Oracle APEX 21.2 installation on the database

Oracle-21c-DB-Password

Continue with setup and wait for it to finish installing. It tool me around 20 minutes for the installation to complete. Do remember to save a screenshot of the image below as you might need it to access the database web management portal later on.

Oracle-21c-Install-Success

Setup Oracle APEX 21.2: APEX Installation

Now lets continue with the setup by installing Oracle APEX 21.2. If you haven’t gotten the files yet, you can get your hands on it at the APEX download page. There are two versions available, which are the ‘All Languages’ and the ‘English only’ version. Up to your preference, the steps are the same.

Once you have completed the download, please do extract it and then move the APEX folder into the C:\temp folder.

Command used:

1. cd C:\temp\apex

Launch PowerShell and change the directory to C:\temp\apex. Afterwards login to Oracle Database 21c XE by entering the password that you supplied during the database installation.

Then set XEPDB as the pluggable database that we are going to use to install Oracle APEX. Below commands for your reference:

Commands used:

1. sqlplus
2. sys as sysdba
3. show pdbs
4. ALTER SESSION SET CONTAINER = XEPDB1;
powershell-login-oracle-21c-db

In the newest version of Oracle 21c XE, there are no more limits set in the creation of pluggable databases which was restricted to 3 in Oracle 18c XE. But to be straightforward, I am just gonna use the default XEPDB.

The next step to setup Oracle APEX 21.2 is to run the installation script as below:

Command used:

1. @apexins.sql SYSAUX SYSAUX TEMP /i/
Install-APEX21.2

It takes around 10 minutes or so for the Oracle APEX 21.2 installation to finish and you’ll see the status as below. Just enough time for a quick nap if you need one.

Setup-Oracle-APEX-21-2-Completed

Do remember to save a screenshot of the result as maybe you’ll need to refer to it later on.

Next on our to do list to setup Oracle APEX 21 on Windows 10 is to create the APEX administrator account. To achieve this, use the apxchpwd.sql script as below.

Command used:

1. @apxchpwd.sql

Enter your preferred administrator username, e-mail address and password that you want to use to log into our fresh Oracle APEX instance later on.

APEX-Instance-Credentials-Setup

The next step in setup Oracle APEX 21.2 on Windows 10 is to enable the REST services. Run the apex_rest_config.sql script and you will need to provide passwords for the APEX_LISTENER and APEX_REST_PUBLIC_USER.

Command used:

1. @apex_rest_config.sql
APEX-21.2-REST-Services

Then unlock the APEX_PUBLIC_USER account via the following command:

Command used:

1. ALTER USER APEX_PUBLIC_USER ACCOUNT UNLOCK;

You can check the APEX_PUBLIC_USER account status by using the below command:

Command Used:

select username,expiry_date,account_status from dba_users;

Scroll on the list of available accounts to reaffirm the status, you should get something as below if all is correct:

APEX-PUBLIC-USER-OPEN-APEX21.2

Setup Oracle APEX 21.2: Hosting ORDS on Apache Tomcat 9

Oracle recommends using ORDS as the web listener. It also allows the creation of web services in Oracle APEX 21.2. We are going to install ORDS on Apache Tomcat 9.

Older deployments of Oracle APEX were able to use the PL/SQL gateway and if I am not mistaken it was version 18 and below. But do correct me if I am wrong.

So download ORDS and download Apache Tomcat 9 if you haven’t done so yet.

As a prerequisite to this step please download and install Java 8 or later JRE in your Windows 10 machine. JRE is needed to run Java based programs. Do ensure that you have a 64-bit version of Java installed for a successful Oracle APEX setup.

During the Apache Tomcat 9 pre-installation, at the configuration options window you can set which HTTP 1.1 connector port you’d want to use. If you have other applications running on port 8080, you can use port 8181 for example. I will be using the default port 8080. Please set the Tomcat Administrator Login credentials as well so that you’ll be able to manage it later on.

Apache-Tomcat-9-Settings

To check whether your Tomcat 9 runs as intended, launch up your web browser and type in the address below and it will load the Tomcat management page.

http://localhost:8080/ 

*Replace port:8080 with your chosen port if it differs from mine.
Apache-Tomcat-9.0.54-home

Unzip ORDS and copy it to the C:\temp folder. Create a new folder inside the ORDS folder and name it as ‘config‘. This folder is used to hold the ORDS configurations.

FYI, the ORDS version that I am using is: 21.3.1.301.20500.

Launch another PowerShell window and navigate to the directory where ORDS is located. In my case, that would be C:\temp\ords.

Run the command as in number 2 below to start configuring ORDS. It will then inquire for information which you can refer with my configurations below, submitted info for the prompts are in bold and italic.

Commands used:

1. cd C:\temp\ords

2. java -jar ords.war
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\WINDOWS\system32> cd C:\temp\ords
PS C:\temp\ords> java -jar ords.war
This Oracle REST Data Services instance has not yet been configured.
Please complete the following prompts


Enter the location to store configuration data: C:\temp\ords\config
Enter the name of the database server [localhost]: Press 'Enter'
Enter the database listen port [1521]: Press 'Enter'
Enter 1 to specify the database service name, or 2 to specify the database SID [1]: Press 'Enter'
Enter the database service name:XEPDB1
Enter the database password for ORDS_PUBLIC_USER:
Confirm password: Enter your preferred password
Requires to login with administrator privileges to verify Oracle REST Data Services schema.

Enter the administrator username:sys as sysdba
Enter the database password for sys as sysdba: Enter password set for Oracle XE
Confirm password: Enter password set for Oracle XE
Connecting to database user: sys as sysdba url: jdbc:oracle:thin:@//localhost:1521/XEPDB1

Retrieving information.
Enter 1 if you want to use PL/SQL Gateway or 2 to skip this step.
If using Oracle Application Express or migrating from mod_plsql then you must enter 1 [1]: Press 'Enter'
Enter the database password for APEX_PUBLIC_USER: Enter password set for APEX_PUBLIC_USER during Oracle APEX 21.2 installation
Confirm password: Enter password set for APEX_PUBLIC_USER during Oracle APEX 21.2 installation

Enter 1 to specify passwords for Application Express RESTful Services database users (APEX_LISTENER, APEX_REST_PUBLIC_USER) or 2 to skip this step [1]: Press 'Enter'
Enter the database password for APEX_LISTENER: Enter password set for APEX_LISTENER during Oracle APEX 21.2 installation
Confirm password: Enter password set for APEX_LISTENER during Oracle APEX 21.2 installation

Enter the database password for APEX_REST_PUBLIC_USER: Enter password set for APEX_REST_PUBLIC_USER during Oracle APEX 21.2 installation
Confirm password: Enter password set for APEX_REST_PUBLIC_USER during Oracle APEX 21.2 installation


Enter a number to select a feature to enable:
   [1] SQL Developer Web  (Enables all features)
   [2] REST Enabled SQL
   [3] Database API
   [4] REST Enabled SQL and Database API
   [5] None
Choose [1]: 1

2021-02-19T05:35:19.047Z INFO        reloaded pools: []
Installing Oracle REST Data Services version 20.2.1.r2270350
... Log file written to C:\Users\Tech201\ords_install_core_2021-02-19_133519_00284.log
... Verified database prerequisites
... Created Oracle REST Data Services proxy user
... Created Oracle REST Data Services schema
... Granted privileges to Oracle REST Data Services
... Created Oracle REST Data Services database objects
... Log file written to C:\Users\Tech201\ords_install_datamodel_2021-02-19_133540_00347.log
... Log file written to C:\Users\Tech201\ords_install_apex_2021-02-19_133541_00983.log
Completed installation for Oracle REST Data Services version 20.2.1.r2270350. Elapsed time: 00:00:24.655

Enter 1 if you wish to start in standalone mode or 2 to exit [1]: 2
PS C:\temp\ords>

The following step in this guide’s to setup Oracle APEX and ORDS on Windows 10 is to copy the ords.war file located at C:\temp\ords to the Apache Tomcat webapps folder which during my Tomcat installation is set to the following path, C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps.

If you look carefully, it will then generate an ords folder a few seconds later after you have copied over the ords.war file to that location.

Next, create a new folder and rename it as ‘i‘ at C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps. Then copy over all the files and folders from C:\temp\apex\images to the ‘i‘ folder.

Last but not least, you can either go the Windows 10 system tray, locate the Tomcat 9 icon and stop and then start again the service or go to Windows 10 start and then type services.msc, locate the Apache Tomcat 9.0 service name and then restart it.

Now for the moment of truth, if all the configurations are correct you should now be able to load Oracle APEX in your browser by typing the below address:

http://localhost:8080/ords/

*Replace port:8080 with your chosen port if it differs from mine.

Enter the credentials that you set when you ran the apxchpwd.sql script to login into your Oracle APEX instance. For the Workspace field type in INTERNAL.

oracle-apex-ords-install-success

You are now ready to create your own distributed Workspaces and web applications.

oracle-apex-ords-install-success-initial-ws-setup

Setup Oracle APEX 21.2: Conclusion on hosting Oracle APEX and ORDS on Apache Tomcat 9

Setup Oracle APEX 21.2 and ORDS on Windows 10 enables administrators to build web applications swiftly. It can as well be used as a staging ground prior to pushing updates to production servers. This is very useful to avoid disruptions on currently running web apps.

Setup requires a little bit of technical knowledge but it is possible for the layman who are interested in Oracle APEX to install on their Windows 10 powered computers.

If you are using a machine that is attached to a domain, you may need to run Microsoft PowerShell and install the related programs with administrator priviledge.

Furthermore, to makes things easier, I only used two passwords during the installation. One is for the Oracle XE and the other for everything else that was prompted.

One last tip, if you restart your Windows 10 machine and Oracle Apex does not load, launch ‘services.msc‘ and restart the ‘Apache Tomcat 9.0‘ service.

To recap the steps in the guide to setup Oracle APEX and ORDS on Windows 10:

Recap steps:

1. Install Oracle XE 21c database.
2. Install Oracle APEX 21.2.
3. Install Apache Tomcat 9.
4. Configure ORDS.
5. Test installation by loading up Oracle APEX 21.2 in your preferred browser.

After you’ve successfully run Oracle APEX, the next step is to learn about APEX workspaces and how to create them.

Good luck!

Leave a Comment

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

This div height required for enabling the sticky sidebar