Table of contents
Disclaimer
These are notes for myself only. This blog is for entertainment only.
Do not use anywhere near production. I am not a DBA.
About
This guide will give you APEX 22.1 and APEX 21.2 on Docker
Oracle-Base update their scripts with the latest version of APEX. In this approach we will:
Accept that this creates a PDB1 with the latest version (rather than modify their scripts)
Use PDB1 as a base and spawn more PDBs with specific versions of APEX we wish to use.
Assumptions
This blog is going to select Oracle Linux 8 and Enterprise Edition 21 of the DB
The current OL8_21 repository has been updated to APEX 22.1. We are going to use the version of APEX that the repository has been updated with.
Instructions
Install Docker Desktop from docker.com
Download Oracle Base Docker Images Repository and unzip to C:\1\dockerfiles-master
Choose a Oracle Linux + DB version i.e Oracle Linux 8 and Enterprise Edition 21
Obtain all software described in the readme.md and place in the C:\1\dockerfiles-master\database\ol8_21\software folder
Open CMD window and
cd C:\1\dockerfiles-master\database\ol8_21
- Create a network
docker network create my_network
- Build image (this will take a couple of minutes)
docker build -t ol8_21:latest .
- In Docker Desktop, Click Volumes, Create. Im using DB 21 so I will name my Volume as...
OracleDB21Data
- Create the Container from the image
docker run -dit --name ol8_21_con -p 1521:1521 -p 5500:5500 --shm-size="1G" --network=my_network -v OracleDB21Data:/u02 ol8_21:latest
In Docker Desktop, Double Click the ol_21_con Container Name and see the Logs. Allow minimum of 30mins until complete
it should look like this when its finished
When this is complete we can do a connection from the terminal (command below is for SQLcl) that our PDB is running
sql sys/SysPassword1@localhost:1521/cdb1 as sysdba
PDBs
Now we'll create PDBs one for the SAME version of APEX and one ANOTHER version of APEX (im going for the prior version)
Whilst still logged in run the following.
CREATE PLUGGABLE DATABASE APEX221PDB FROM PDB1;
ALTER PLUGGABLE DATABASE APEX221PDB OPEN READ WRITE;
ALTER PLUGGABLE DATABASE APEX221PDB SAVE STATE;
CREATE PLUGGABLE DATABASE APEX212PDB FROM PDB1;
ALTER PLUGGABLE DATABASE APEX212PDB OPEN READ WRITE;
ALTER PLUGGABLE DATABASE APEX212PDB SAVE STATE;
Now lets focus on the current version of APEX i.e the **APEX221PDB **PDB
Look at the software in the README.md of github.com/oraclebase/dockerfiles/tree/mast.. and add it to C:\1\dockerfiles-master\ords\ol8_ords\software
In CMD navigate to C:\1\dockerfiles-master\ords\ol8_ords
Make the build (adjust the numbers to match the version of APEX e.g 221)
docker build -t ol8_ords_221:latest .
- In Docker Desktop, Click Volumes, Create. Im using APEX 221 so I will name my Volume as...
OracleORDS221Data
- Create the container (adjust all the numbers to match the version of APEX e.g 221)
docker run -dit --name ol8_ords_con_221 -p 8221:8080 -p 9221:8443 -e DB_HOSTNAME=ol8_21_con -e DB_SERVICE=APEX221PDB -e PDB_NAME=APEX221PDB --network=my_network -v OracleORDS221Data:/u01/config/instance1 ol8_ords_221:latest
Click the container name in Docker Desktop to check on progress. When complete it will look like this .
Check out the link at localhost:8221/ords .The INTERNAL password is ApexPassword1
Lets install the ANOTHER version of APEX in to the APEX212PDB
In windows explorer unzip C:\1\dockerfiles-master\ords\ol8_ords\software to folder apex_22.1_en
open CMD or terminal and change folder
cd C:\1\dockerfiles-master\ords\ol8_ords\software\apex_22.1_en\apex
- Log on to the PDB and install APEX 21.2 (remember we renamed the zip) this time using SQLPLUS !!! it does not work with SQLcl
sqlplus sys/SysPassword1@localhost:1521/APEX212PDB as sysdba
- Run the following
@apxremov.sql
exit out of SQLPLUS
Delete or rename the apex_22.1_en folder
Download APEX 21.2 from download.oracle.com/otn_software/apex/apex_..
When downloaded, rename the zip file to apex_22.1_en.zip
Move it to C:\1\dockerfiles-master\ords\ol8_ords\software overwriting the current zip
Extract the zip to apex_22.1_en
open CMD or terminal and change folder
cd C:\1\dockerfiles-master\ords\ol8_ords\software\apex_22.1_en\apex
- Log on to the PDB and install APEX 21.2 (remember we renamed the zip) this time using SQLPLUS !!! it does not work with SQLcl
sqlplus sys/SysPassword1@localhost:1521/APEX212PDB as sysdba
- Run the following
@apexins.sql SYSAUX SYSAUX TEMP /i/
- Run the following
@apxchpwd.sql;
ALTER USER APEX_PUBLIC_USER IDENTIFIED BY ApexPassword1 ACCOUNT UNLOCK;
@apex_rest_config.sql; (use password ApexPassword1)
- In CMD navigate to the correct folder
cd C:\1\dockerfiles-master\ords\ol8_ords
- Make the build (adjust the numbers to match the version of APEX e.g 212)
docker build -t ol8_ords_212:latest .
- In Docker Desktop, Click Volumes, Create. I'm using APEX 212 so I will name my Volume as...
OracleORDS212Data
- Create the container (adjust all the 212 numbers to match the version of APEX e.g 212)
docker run -dit --name ol8_ords_con_212 -p 8212:8080 -p 9212:8443 -e DB_HOSTNAME=ol8_21_con -e DB_SERVICE=APEX212PDB -e PDB_NAME=APEX212PDB --network=my_network -v OracleORDS212Data:/u01/config/instance1 ol8_ords_212:latest
Click the container name in Docker Desktop to check on progress. When complete it will look like this
Check out the link at localhost:8212/ords .The INTERNAL password is ApexPassword1
To save memory, probably best to have only one running ORDS Container
handy :
select username from all_users where username like 'APEX%' or username like 'ORDS%'