Tag: ORDS

  • Installing Oracle APEX 26.2 and ORDS 26.3 on Oracle AI Database 26ai: A Home-Lab Walkthrough

    Alhamdulillah. After the 19c to 26ai upgrade in my home lab, the next step was Oracle APEX. This post covers installing APEX 26.2 into a 26ai pluggable database, putting ORDS 26.3 in front of it, creating a workspace, running a sample application, and making ORDS start on its own after a reboot. Everything used public downloads, with no My Oracle Support account. Hostnames, IP addresses and passwords are masked.

    Lab environment

    ItemValue
    VMlabhost26, Oracle Linux 9.8 on VirtualBox
    DatabaseOracle AI Database 26ai EE 23.26.1, CDB26 with PDB26
    APEX26.2.0 (apex-latest.zip)
    ORDS26.3.1 (ords-latest.zip), standalone mode on port 8080
    JavaOpenJDK 17.0.21 (OS package)
    Install targetPDB26 only

    APEX is a no-cost feature of the database. The base release download is the full product. What needs a support contract is the Patch Set Bundle from My Oracle Support, which comes up again at the end.

    Step 1: Confirm APEX is not already there

    SHOW PDBS
    SET LINESIZE 150
    COL comp_id FORMAT a10
    COL version FORMAT a15
    COL status FORMAT a10
    ALTER SESSION SET CONTAINER=PDB26;
    SELECT comp_id, NVL(version,'-') version, status FROM dba_registry WHERE comp_id='APEX';
        CON_ID CON_NAME                       OPEN MODE  RESTRICTED
    ---------- ------------------------------ ---------- ----------
             2 PDB$SEED                       READ ONLY  NO
             3 PDB26                          READ WRITE NO
    
    no rows selected

    No APEX component in PDB26, so this is a fresh install.

    Step 2: Download and unzip APEX

    The VM had internet access, so I pulled the zip straight onto it:

    cd /u01/stage
    curl -sSL -o apex-latest.zip https://download.oracle.com/otn_software/apex/apex-latest.zip
    ls -lh apex-latest.zip
    mkdir -p /u01/app/oracle/apex_install
    cd /u01/app/oracle/apex_install
    unzip -q /u01/stage/apex-latest.zip
    cat apex/images/apex_version.txt
    -rw-r--r--. 1 oracle oinstall 322M Nov 19 19:10 apex-latest.zip
    Oracle APEX Version: 26.2

    Step 3: Install APEX into PDB26

    I ran apexins.sql under nohup so a dropped PuTTY session would not interrupt it. It has to be started from the apex directory.

    cd /u01/app/oracle/apex_install/apex
    nohup sqlplus -s / as sysdba > apexins_run.out 2>&1 <<'EOF' &
    ALTER SESSION SET CONTAINER=PDB26;
    @apexins.sql SYSAUX SYSAUX TEMP /i/
    EXIT
    EOF
    • SYSAUX: tablespace for the APEX schema
    • SYSAUX: tablespace for uploaded files
    • TEMP: temporary tablespace
    • /i/: virtual path for static images. Keep /i/ to make later upgrades simpler.
    The structure of the link to the Oracle APEX Administration Services is as follows:
    http://host:port/ords/apex_admin
    The structure of the link to the Oracle APEX development environment is as follows:
    http://host:port/ords/apex
    timing for: Complete Installation
    Elapsed: 6.00

    Six minutes on this VM. One thing to watch when checking the log: a plain grep -i error returns a lot of noise, because many APEX objects have “error” in their names (wwv_flow_error_api, wwv_install_error$ and so on). Anchoring the search on the message prefixes gives a real answer:

    grep -E "^ORA-|^PLS-|^SP2-" /u01/app/oracle/apex_install/apex/install*.log

    No output, so no errors.

    Step 4: Instance administrator and APEX_PUBLIC_USER

    ALTER SESSION SET CONTAINER=PDB26;
    @apxchpwd.sql
    Enter the administrator's username [ADMIN]
    User "ADMIN" does not yet exist and will be created.
    Enter ADMIN's email [ADMIN]
    Enter ADMIN's password []
    Created instance administrator ADMIN.

    The password needs upper and lower case letters, a digit and a punctuation character.

    APEX_PUBLIC_USER is created locked with a random password. The installation guide also warns that with the default profile the password expires after 180 days, after which APEX stops working until it is changed. For the lab I gave it a profile without password expiry:

    CREATE PROFILE apex_nolimit LIMIT PASSWORD_LIFE_TIME UNLIMITED;
    ALTER USER APEX_PUBLIC_USER PROFILE apex_nolimit;
    ALTER USER APEX_PUBLIC_USER IDENTIFIED BY "<password>" ACCOUNT UNLOCK;
    SELECT comp_id, NVL(version,'-') version, status FROM dba_registry WHERE comp_id='APEX';
    COMP_ID VERSION STATUS
    ---------- --------------- ----------
    APEX 26.2.0 VALID

    Step 5: Java, ORDS download and firewall

    # as root
    dnf -y install java-17-openjdk-headless
    java -version
    mkdir -p /u01/app/oracle/ords /u01/app/oracle/ords_config
    cd /u01/app/oracle/ords
    curl -sSL -o /u01/stage/ords-latest.zip https://download.oracle.com/otn_software/java/ords/ords-latest.zip
    unzip -q /u01/stage/ords-latest.zip
    chown -R oracle:oinstall /u01/app/oracle/ords /u01/app/oracle/ords_config
    firewall-cmd --permanent --add-port=8080/tcp
    firewall-cmd --reload
    openjdk version "17.0.21" 2026-10-20 LTS
    Oracle REST Data Services 26.3.1.r3031615

    Running ords --version without --config printed a warning that the configuration folder was inside the product folder. That only applies to that one command. I kept the configuration in its own directory, /u01/app/oracle/ords_config, so ORDS can be replaced later without touching the configuration.

    Step 6: Install ORDS into PDB26

    A non-interactive install, with both passwords read from stdin so they do not end up in shell history. The first line is the SYS password, the second the new ORDS_PUBLIC_USER password.

    export CFG=/u01/app/oracle/ords_config
    export PATH=/u01/app/oracle/ords/bin:$PATH
    read -s -p "SYS password: " SYSPW; echo
    read -s -p "New ORDS_PUBLIC_USER password: " ORDSPW; echo
    printf "%s\n%s\n" "$SYSPW" "$ORDSPW" | ords --config $CFG install \
    --log-folder $CFG/logs \
    --admin-user SYS \
    --db-hostname localhost --db-port 1521 --db-servicename pdb26 \
    --feature-db-api true --feature-rest-enabled-sql true --feature-sdw true \
    --gateway-mode proxied --gateway-user APEX_PUBLIC_USER \
    --proxy-user \
    --password-stdin
    INFO Installing Oracle REST Data Services version 26.3.1.r3031615 in PDB26
    INFO ... Verified database prerequisites
    INFO ... Created Oracle REST Data Services proxy user
    INFO ... Created Oracle REST Data Services schema
    INFO ... Granted privileges to Oracle REST Data Services
    INFO ... Created Oracle REST Data Services database objects
    INFO Completed installation for Oracle REST Data Services version 26.3.1.r3031615. Elapsed time: 00:00:15.445
    INFO Completed configuring PL/SQL gateway user for Oracle REST Data Services version 26.3.1.r3031615.

    With --gateway-mode proxied, ORDS connects as ORDS_PUBLIC_USER and proxies to APEX_PUBLIC_USER for APEX requests.

    Step 7: Static images and first start

    ords --config $CFG config set standalone.static.path /u01/app/oracle/apex_install/apex/images
    nohup ords --config $CFG serve > $CFG/logs/ords_serve.out 2>&1 &
    ss -ltnp | grep 8080
    curl -s -o /dev/null -w "HTTP %{http_code}\n" http://localhost:8080/ords/apex
    The global setting named: standalone.static.path was set to: /u01/app/oracle/apex_install/apex/images
    INFO Oracle REST Data Services initialized
    Oracle REST Data Services version : 26.3.1.r3031615
    Oracle REST Data Services server info: jetty/12.0.37
    LISTEN 0 50 *:8080 *:* users:(("java",pid=xxxx,fd=7))
    HTTP 302

    The 302 is the redirect to the APEX sign-in page. From the Windows host, http://<vm-ip>:8080/ords/apex_admin opened the Administration Services login.

    Step 8: Workspace

    As ADMIN in Administration Services, I created a workspace through Create Workspace:

    WorkspaceLAB
    SchemaNew schema LAB_APEX, 100 MB quota
    Workspace administratorLABADMIN

    Two small things on the way. The email field rejected a value that was not a full address, and after the error the password field was cleared, so it had to be typed again. A normal format such as name@example.com was accepted. APEX then created a dedicated tablespace and datafile for the new schema in PDB26:

    Workspace LAB provisioned with administrator LABADMIN. Database user LAB_APEX created
    with default tablespace APEX_1494828056200061 using datafile
    /u01/oradata/CDB26/PDB26/APEX_1494828056200061.dbf

    On the first sign-in to the LAB workspace, APEX required LABADMIN to change the password, which is expected for a new workspace administrator.

    Step 9: A sample application as an end-to-end test

    From Gallery, Sample Apps, I installed the Brookstrut Sample App into the LAB workspace. It creates its own tables and seed data, so it is a quick way to confirm the whole chain: database, APEX engine, ORDS, and static files. The app ran as App 100 with its icons and styling loading correctly, which confirmed the static path setting.

    After running “Generate 100 Transactions” a few times, the Sales Dashboard showed $238,687 in sales, 28,381 units and 5,200 transactions, with a daily chart covering the seeded history from mid-October up to the generated data. The workspace home then showed 1 application and 8 tables in LAB_APEX.

    Step 10: Start ORDS at boot with systemd

    ORDS was still running under nohup, so it would not survive a reboot. The database on this VM already starts through a systemd unit, oracle-cdb26.service. In my earlier 26ai install, SELinux blocked systemd from executing a script directly under /u01, so I used the same approach here: a small wrapper in /usr/local/bin.

    cat > /usr/local/bin/ords_start.sh <<'EOF'
    #!/bin/bash
    export JAVA_HOME=/usr/lib/jvm/jre-17
    exec /u01/app/oracle/ords/bin/ords --config /u01/app/oracle/ords_config serve
    EOF
    chmod 755 /usr/local/bin/ords_start.sh
    cat > /etc/systemd/system/ords.service <<'EOF'
    [Unit]
    Description=Oracle REST Data Services (APEX)
    After=network-online.target oracle-cdb26.service
    Wants=oracle-cdb26.service
    [Service]
    User=oracle
    Group=oinstall
    ExecStart=/usr/local/bin/ords_start.sh
    Restart=on-failure
    RestartSec=30
    [Install]
    WantedBy=multi-user.target
    EOF
    systemctl daemon-reload
    systemctl enable ords
    pkill -u oracle -f "ords.*serve"; sleep 5
    systemctl start ords
    ● ords.service - Oracle REST Data Services (APEX)
    Loaded: loaded (/etc/systemd/system/ords.service; enabled; preset: disabled)
    Active: active (running) since Thu 2026-11-19 19:50:59 IST; 40s ago
    LISTEN 0 50 *:8080 *:* users:(("java",pid=xxxx,fd=7))

    After=oracle-cdb26.service orders the start after the database unit, and Restart=on-failure with a 30 second delay covers the case where the database is not fully open yet when ORDS starts. After a test reboot the APEX page was not available straight away. It came up within a couple of minutes, once the database and ORDS had both started, and the workspace and sample app data were all there.

    Two notes from the workspace home page

    • “Patch Set 1 is available”. APEX Patch Set Bundles are downloaded from My Oracle Support. With only a personal Oracle account, the lab stays on the base 26.2.0 release.
    • “Enable Generative AI”. This needs an AI service and its credentials configured in APEX. I left it off for now.

    Lessons learned

    • Install APEX into the PDB you need. Here only PDB26 got APEX, and the CDB root stayed clean.
    • When checking apexins logs, search for ^ORA-, ^PLS- and ^SP2-, not the word “error”.
    • Give APEX_PUBLIC_USER a profile that suits your password policy. With the default 180-day expiry, APEX stops working on the day the password expires.
    • Keep the ORDS configuration folder outside the ORDS product folder.
    • Read passwords from stdin for the non-interactive ORDS install rather than typing them on the command line.
    • Set standalone.static.path to the APEX images directory, and use a sample app to confirm that pages render with their styling.
    • Move ORDS to systemd before calling the setup finished, and test with a real reboot.

    ما شاء الله, the lab now has 26ai, APEX 26.2 and ORDS 26.3 starting together on boot, with a working workspace and sample app. A natural next step is repeating the 19c to 26ai upgrade with APEX installed in the source database, to see how AutoUpgrade handles the APEX component.