Zum Hauptinhalt wechseln

Docker: Install Oracle 23cFREE and APEX 23.1

Wie installiert man Oracle 23cFREE and APEX 23.1 mit Docker?

Konfigurationsmöglichkeiten für Podman (Docker) siehe hier.

Oracle 23cFREE 

docker pull container-registry.oracle.com/database/free:latest
docker volume create --opt type=none --opt o=bind --opt device=<my_local_path> OracleDBData

# docker run -d -it --name 23cfree 
		-p <host port>:1521 -p <host port>:5500 -p <host port>:8080 -p <host port>:8443 
		-v OracleDBData:/opt/oracle/oradata
docker run -d -it --name 23cfree -p 8521:1521 -p 8500:5500 -p 8023:8080 -p 9043:8443 -e ORACLE_PWD=E -v OracleDBData:/opt/oracle/oradata container-registry.oracle.com/database/free:latest

APEX 23.1

1. Enter bash

docker exec -it 23cfree /bin/bash

2. Get APEX

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

3. Unpack and enter APEX

unzip apex-latest.zip
rm apex-latest.zip
cd apex        

4. Let your database settle for at least a few minutes

5. Open SQL*Plus with sqlplus / as sysdba

sqlplus / as sysdba 

6. Run the APEX installer

alter session set container = freepdb1;
@apexins.sql sysaux sysaux temp /i/        

If you get the PLS-00201: identifier ‘SYS.DBMS_DB_VERSION’ must be declared an error, just keep re-trying this step until it works.

7. Unlock the public user account

alter user apex_public_user account unlock;
alter user apex_public_user identified by E;

8. Change the password


9. Create the following folders

mkdir /home/oracle/software
mkdir /home/oracle/software/apex
mkdir /home/oracle/software/ords
mkdir /home/oracle/scripts    

10. Copy the APEX images & change the folder

cp -r /home/oracle/apex/images /home/oracle/software/apex
cd /home/oracle/       

11. Install sudo & nano

dnf update
dnf install sudo -y
dnf install nano -y        

12. Edit the sudo list

nano /etc/sudoers

In the Defaults section, add: 

Defaults !lecture

At the very end of the file add: 



13. Install Java

dnf install java-17-openjdk -y      

14. Setup ORDS folders & check JAVA

mkdir /etc/ords
mkdir /etc/ords/config
mkdir /home/oracle/logs
chmod -R 777 /etc/ords
java -version        

openjdk version "17.0.7" 2023-04-18 LTS

15. Whilst still as su, install ORDS

yum-config-manager --add-repo=http://yum.oracle.com/repo/OracleLinux/OL8/oracle/software/x86_64
dnf install ords -y        

16. Configure ORDS

export _JAVA_OPTIONS="-Xms512M -Xmx512M"
ords --config /etc/ords/config install        

 The configuration you should use looks like this:

Installation Type > Choose option [2] Enter
Connection Type > Choose option [1] Enter
host name > Enter
listen port > Enter
service name > Enter
administrator username > SYS
password > E
default tablespace > Enter
temp tablespace > Enter
features > Enter
Start ORDS > [1] Enter <-- Standalone Mode
protocol > [1] < http
port > [1] <-- 8080
Static Resources > /home/oracle/software/apex/images   

Oracle REST Data Services version : 23.1.3.r1371032 Oracle REST Data Services server info: jetty/10.0.12 Oracle REST Data Services java info: OpenJDK 64-Bit Server VM 17.0.7+7-LTS

17. Do a quick test and close ORDS


18. Create a start_ords.sh file

nano /home/oracle/scripts/start_ords.sh
export ORDS_HOME=/usr/local/bin/ords
export _JAVA_OPTIONS="-Xms512M -Xmx512M"
LOGFILE=/home/oracle/logs/ords-`date +"%Y""%m""%d"`.log
nohup ${ORDS_HOME} --config /etc/ords/config serve >> $LOGFILE 2>&1 & echo "View log file with : tail -f $LOGFILE"

19. Create a stop_ords.sh file

nano /home/oracle/scripts/stop_ords.sh
kill `ps -ef | grep [o]rds.war | awk '{print $2}'`  

manual run via

sh /home/oracle/scripts/start_ords.sh
sh /home/oracle/scripts/stop_ords.sh

20. Create an ORDS startup script

nano /opt/oracle/scripts/startup/01_auto_ords.sh    
sudo sh /home/oracle/scripts/start_ords.sh     

21. Exit from root and docker bash


23. If you are using Docker on Unix, enable linger

Prevent user processes from being killed once the session is completed 

sudo loginctl enable-linger $UID

24. Stop your Docker container, and then start it again

docker restart 23cfree        

25. Wait a moment, and try logging in


Workspace > INTERNAL
Username > ADMIN
Password > Your Complex Password     


Quelle: https://pretius.com/blog/oracle-apex-docker-ords


Noch keine Kommentare zu diesem Beitrag.