Skip to content

Latest commit

 

History

History
195 lines (132 loc) · 3.22 KB

File metadata and controls

195 lines (132 loc) · 3.22 KB

Setting up APEX in a Second PDB (FREEPDB2) and Exposing via ORDS

1. Download and Prepare APEX

Go to home directory:

cd ~

Download the latest APEX distribution (overwrite if file exists):

curl -L -o apex-latest.zip https://download.oracle.com/otn_software/apex/apex-latest.zip

Backup existing folder (if present):

mv apex-latest apex-latest.bak_$(date +%Y%m%d_%H%M%S) 2>/dev/null

Unzip into a clean directory:

mkdir -p ~/apex-latest
unzip apex-latest.zip -d ~/apex-latest

Switch to APEX root:

cd ~/apex-latest/apex

⚠️ Do not trust existing /home/oracle/apex folder in the VM — it may not contain a full or valid APEX distribution.


2. Install APEX into FREEPDB2

Use either sql (preferred in newer environments) or sqlplus:

sql / as sysdba

Then:

alter session set container = FREEPDB2;

Run the silent installer:

@apxsilentins.sql SYSAUX SYSAUX TEMP /i/ oracle oracle oracle oracle

3. Verify Installation

The installer creates log files in the current directory, e.g.:

configureYYYY-MM-DD_HH-MM-SS.log
installYYYY-MM-DD_HH-MM-SS.log

Check both for errors:

grep -E "SP2-|ORA-" install*.log
grep -E "SP2-|ORA-" configure*.log

If anything is returned → installation is not valid.


4. Set / Reset APEX ADMIN Password

If login fails or admin creation fails due to password policy, run:

@apxchpwd.sql

Then log in:

  • Workspace: INTERNAL
  • User: ADMIN

(Optional, for lab use):

begin
  apex_instance_admin.set_parameter('PASSWORD_MIN_LENGTH', 6);
  apex_instance_admin.set_parameter('PASSWORD_COMPLEXITY_CHECK', 'N');
  commit;
end;
/

5. Configure ORDS for FREEPDB2

Backup config:

cp -a /home/oracle/ords_config /home/oracle/ords_config.bak_$(date +%Y%m%d_%H%M%S)

Run ORDS installer:

/home/oracle/ords/bin/ords --config /home/oracle/ords_config install

Choose:

  • Create or update a database pool
  • Create additional database pool

Set:

  • Pool name: ords2
  • Connection type: basic
  • Host: localhost
  • Port: 1521
  • Service name: FREEPDB2
  • User: ORDS_PUBLIC_USER
  • PL/SQL gateway mode: proxied

6. Verify ORDS Configuration

cat /home/oracle/ords_config/databases/ords2/pool.xml

Expected key parameters:

<entry key="db.servicename">FREEPDB2</entry>
<entry key="db.username">ORDS_PUBLIC_USER</entry>
<entry key="plsql.gateway.mode">proxied</entry>

7. Restart ORDS

pkill -f "ords.war.*serve --port 8080"

nohup /home/oracle/ords/bin/ords \
  --config /home/oracle/ords_config \
  serve --port 8080 \
  --apex-images /home/oracle/apex_images \
  >/home/oracle/ords/ords.log 2>&1 &

8. Test APEX

Original PDB:

http://localhost:8080/ords/

New PDB:

http://localhost:8080/ords/ords2/apex

Landing page:

http://localhost:8080/ords/ords2/_/landing

Notes / Lessons Learned

  • Do not rely on pre-existing APEX folders in Oracle VM images
  • Always validate install logs (SP2-, ORA-)
  • APEX install can “complete” while being broken
  • ORDS maps PDBs via pools: /ords/<pool_name>/
  • One apex_images directory is shared across all PDBs