šŸš€ The Ultimate Guide: Setting Up Oracle XE + APEX + ORDS + Tomcat on Windows

šŸš€ The Ultimate Guide: Setting Up Oracle XE + APEX + ORDS + Tomcat on Windows

Welcome to OracleAPEXHub! If you are looking to build a robust, production-ready development environment without breaking the bank, you have come to the right place.

In this guide, I will walk you through a complete “Full Stack” installation. We are combining the lightweight power of Oracle Database XE with the low-code magic of APEX, served professionally via ORDS and Apache Tomcat.

Whether you are building an HRMS, a blog, or a complex enterprise app, this foundation is exactly what you need.

šŸ—ļø The Architecture

Before we dive into the commands, it helps to understand what we are building. Instead of using the default embedded PL/SQL gateway, we are using a 3-tier architecture for better security and performance.

  • Database:Ā Oracle XE 21.3 (Stores your data and logic)
  • App Logic:Ā Oracle APEX 23.2 (The framework)
  • Listener:Ā ORDS 22.1 (Translates HTTP to Database calls)
  • Web Server:Ā Apache Tomcat 9 (Hosts the Listener)

šŸ“‹ Prerequisites

Before starting, ensure your Windows machine (10 or 11) meets these specs:

  • RAM:Ā 4GB minimum (8GB+ highly recommended)
  • Disk:Ā 10GB free space
  • Access:Ā Administrator privileges

šŸ”§ Phase 1: The Database Layer

Step 1: Install Oracle XE 21.3

First, we need the database engine.

  1. Download:Ā Oracle XE 21.3 for WindowsOracle XE 21.3 for Windows
  2. Install:Ā Extract the zip and runĀ setup.exe.
  3. Important:Ā During installation, you will be asked to set a password for theĀ SYSĀ andĀ SYSTEMĀ users.Ā Write this down!
  4. Note the Path:Ā Remember where you installed it (e.g.,Ā E:\Oracle\DB).

Step 2: Prepare Oracle APEX

  1. Download:Ā Oracle APEX 23.2Oracle APEX 23.2
  2. Extract:Ā Unzip the file to a dedicated folder, for example:Ā E:\Oracle\apex\apex.

Step 3: Configure the Database

Open your Command Prompt as Administrator and navigate to your APEX folder:

cd E:\Oracle\apex\apex
sqlplus / as sysdba

DOS

cd E:\Oracle\apex\apex
sqlplus / as sysdba

Once connected, switch to the pluggable database (PDB) where APEX will live:

ALTER SESSION SET CONTAINER=XEPDB1;

SQL

ALTER SESSION SET CONTAINER=XEPDB1;

Step 4: Create Tablespaces

It is best practice to keep APEX data separate from system data. Run the following SQL to create dedicated storage:

CREATE TABLESPACE appx 
DATAFILE 'E:\Oracle\DB\oradata\XE\XEPDB1\apex.dbf' 
SIZE 2000M 
EXTENT MANAGEMENT LOCAL 
SEGMENT SPACE MANAGEMENT AUTO;

CREATE TEMPORARY TABLESPACE temp0_02 
TEMPFILE 'E:\Oracle\DB\oradata\XE\XEPDB1\temp.dbf' 
SIZE 2000M 
AUTOEXTEND ON;

SQL

CREATE TABLESPACE appx 
DATAFILE 'E:\Oracle\DB\oradata\XE\XEPDB1\apex.dbf' 
SIZE 2000M 
EXTENT MANAGEMENT LOCAL 
SEGMENT SPACE MANAGEMENT AUTO;

CREATE TEMPORARY TABLESPACE temp0_02 
TEMPFILE 'E:\Oracle\DB\oradata\XE\XEPDB1\temp.dbf' 
SIZE 2000M 
AUTOEXTEND ON;

šŸ’” Tip: If you installed Oracle XE in a different location, adjust the file paths above accordingly.

āš™ļø Phase 2: Installing APEX

Step 5: Run the Installer

With your tablespaces ready, run the main installation script. This puts the APEX engine into the database.

@apexins.sql appx appx temp0_02 /i/

SQL

@apexins.sql appx appx temp0_02 /i/

ā˜• Grab a coffee: This step usually takes 15-30 minutes. Once it says “PL/SQL procedure successfully completed,” type EXIT;.

Step 6: Setup the Admin Account

Now we need to create the login for the APEX internal workspace.

  1. Reconnect to SQL Plus:sqlplus / as sysdba ALTER SESSION SET CONTAINER=XEPDB1;DOSsqlplus / as sysdba ALTER SESSION SET CONTAINER=XEPDB1;
  2. Run the password script:@apxchpwd.sqlSQL@apxchpwd.sql
  3. Details:
    • Username:Ā ADMIN
    • Email:Ā Your email address
    • Password:Ā Make it strong (e.g.,Ā Apex@SecurePass2024!)

Step 7: Unlock Users & Configure REST

We need to open the doors for the web server to talk to the database.

Configure REST:

@apex_rest_config.sql

SQL

@apex_rest_config.sql

(Enter passwords when prompted)

Unlock Accounts: Copy and run this block to unlock all necessary accounts:

-- Unlock System Accounts
ALTER USER SYS IDENTIFIED BY [YourPassword] ACCOUNT UNLOCK;
ALTER USER ANONYMOUS IDENTIFIED BY [YourPassword] ACCOUNT UNLOCK;

-- Switch Container
ALTER SESSION SET CONTAINER=XEPDB1;

-- Unlock APEX Service Accounts
ALTER USER APEX_LISTENER IDENTIFIED BY [YourPassword] ACCOUNT UNLOCK;
ALTER USER APEX_PUBLIC_USER IDENTIFIED BY [YourPassword] ACCOUNT UNLOCK;
ALTER USER APEX_REST_PUBLIC_USER IDENTIFIED BY [YourPassword] ACCOUNT UNLOCK;

🌐 Phase 3: The Web Layer (Tomcat & ORDS)

Step 8: Install Java (JDK 17)

Tomcat runs on Java.

  1. Download:Ā JDK 17 InstallerJDK 17 Installer
  2. Install:Ā Default path is usuallyĀ C:\Program Files\Java\jdk-17.
  3. Verify:Ā Open CMD and typeĀ java -version.

Step 9: Install Apache Tomcat 9

  1. Download:Ā Apache Tomcat 9Apache Tomcat 9
  2. Install:Ā Save it toĀ E:\Oracle\Tomcat 9.0.
  3. Service:Ā Ensure you check “Install as Windows Service” so it starts automatically.

Step 10: Install & Configure ORDS

This is the bridge between Tomcat and the Database.

  1. Download:Ā ORDS 22.1ORDS 22.1
  2. Folder Setup:
    • CreateĀ E:\Oracle\ORDS
    • CreateĀ E:\Oracle\ORDS\Config
    • Extract the zip intoĀ E:\Oracle\ORDS
  3. Move Images:
    • Copy theĀ imagesĀ folder from your APEX download (E:\Oracle\apex\apex\images).
    • Paste it into Tomcat’s webapps folder (E:\Oracle\Tomcat 9.0\webapps).
    • RenameĀ the folder fromĀ imagesĀ toĀ i.
  4. Run ORDS Installer:Ā Open CMD, navigate to your JDK bin, and run the installer:cd C:\Program Files\Java\jdk-17\bin java.exe -jar E:\Oracle\ORDS\ords.war installDOScd C:\Program Files\Java\jdk-17\bin java.exe -jar E:\Oracle\ORDS\ords.war install
  5. Wizard Prompts:Ā Follow these inputs carefully:
    • Config Location:Ā E:\Oracle\ORDS\Config
    • Database Server:Ā localhost
    • Port:Ā 1521
    • Service Name:Ā XEPDB1
    • Verify/Install Schema:Ā 1
    • PL/SQL Gateway User:Ā APEX_PUBLIC_USER
    • Passwords:Ā Enter the passwords you set in Step 7.
    • Mode:Ā EnterĀ 2Ā to exit (we will run it via Tomcat, not standalone).

Step 11: Deploy to Tomcat

  1. CopyĀ ords.warĀ from your ORDS folder.
  2. Paste it intoĀ E:\Oracle\Tomcat 9.0\webapps\.
  3. Start theĀ Apache TomcatĀ service from Windows Services.
  4. Wait about 30 seconds for Tomcat to deploy the WAR file.

šŸŽ‰ Success! How to Login

Open your browser and navigate to: šŸ‘‰ http://localhost:8080/ords

  • Workspace:Ā INTERNAL
  • Username:Ā ADMIN
  • Password:Ā The password you created in Step 6.

From here, you can create new workspaces and start building your applications!

šŸ†˜ Troubleshooting Common Issues

  • 404 Not Found:Ā Usually meansĀ ords.warĀ isn’t in theĀ webappsĀ folder, or Tomcat isn’t running. Check the logs atĀ Tomcat 9.0\logs.
  • Images Missing:Ā Did you rename theĀ imagesĀ folder toĀ iĀ insideĀ webapps? Clear your browser cache and try again.
  • Account Locked:Ā If you get login errors, run the SQL unlock commands from Step 7 again.

šŸ’¬ specific Questions?

Did you get stuck on a step? Let me know in the comments below and I’ll help you debug your setup. Happy coding!

If you found this guide helpful for your Oracle journey, consider subscribing to OracleAPEXHub for more tutorials on SQL, PL/SQL, and APEX development.

Love coding? Me too! Let’s keep in touch – subscribe to my website for regular chats on Oracle APEX, PL/SQL,SQL JavaScript, and CSS.

Comments

No comments yet. Why don’t you start the discussion?

    Leave a Reply

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