Essential Docker Commands for Oracle Database Administration

How to Check and Manage Oracle DB in Docker

Commands to manage the Oracle database running in Docker

Link to install the docker image from Oracle container registry: How to login in Docker for download the images from Oracle Registry

Check the running status of Oracle database container with docker command

docker ps

ubuntu01@ubuntu01-VirtualBox:~/Desktop$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
36ede553a527 container-registry.oracle.com/database/enterprise:latest “/bin/sh -c ‘exec $O…” 10 days ago Up About an hour (healthy) 0.0.0.0:1521->1521/tcp, [::]:1521->1521/tcp oracledb

Login with Docker Bash Shell using SQL*Plus to Oracle Database

Note: oracledb is container name running in docker

docker exec -it oracledb bash

Example:

ubuntu01@ubuntu01-VirtualBox:~/Desktop$ docker exec -it oracledb bash
bash-4.4$ sqlplus / as sysdba

SQL*Plus: Release 23.26.1.0.0 – Production on Fri Feb 20 11:38:18 2026
Version 23.26.1.0.0

Copyright (c) 1982, 2025, Oracle. All rights reserved.

Connected to:
Oracle AI Database 26ai Enterprise Edition Release 23.26.1.0.0 – Production
Version 23.26.1.0.0

SQL>

Check if the Oracle database is running.

docker ps -a shows all running and stopped containers.

ubuntu01@ubuntu01-VirtualBox:~/Desktop$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
36ede553a527 container-registry.oracle.com/database/enterprise:latest “/bin/sh -c ‘exec $O…” 10 days ago Up About an hour (healthy) 0.0.0.0:1521->1521/tcp, [::]:1521->1521/tcp oracledb

Stop the Oracle DB container or stop the Oracle database

ubuntu01@ubuntu01-VirtualBox:~/Desktop$ docker stop oracledb
oracledb

Check the database log using a Docker command.

docker log oracledb

docker log oracledb
— you can see the alert log directly
2026-02-20T11:41:52.001694+00:00
Stopping change tracking
Database closed.
Database dismounted.
2026-02-20T11:41:52.173929+00:00
Thread 1 closed at log sequence 2
Successful close of redo thread 1
Completed: ALTER DATABASE CLOSE NORMAL
2026-02-20T11:41:52.426231+00:00
ALTER DATABASE DISMOUNT
Completed: ALTER DATABASE DISMOUNT
2026-02-20T11:41:52.543410+00:00
JIT: pid 2641 requesting stop
JIT: pid 2641 requesting stop
ORACLE instance shut down.

Start the Oracle database Docker container.

Before starting the Oracle database service, check if the OracleDB container is not in a running or exited state by using the docker ps -a command. You can verify running instances of OracleDB with the docker ps command.

ubuntu01@ubuntu01-VirtualBox:~/Desktop$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
36ede553a527 container-registry.oracle.com/database/enterprise:latest “/bin/sh -c ‘exec $O…” 10 days ago Exited (143) 4 minutes ago oracledb

ubuntu01@ubuntu01-VirtualBox:~/Desktop$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ubuntu01@ubuntu01-VirtualBox:~/Desktop$

— Start the database container
ubuntu01@ubuntu01-VirtualBox:~/Desktop$ docker start oracledb
oracledb
ubuntu01@ubuntu01-VirtualBox:~/Desktop$

Now we will check the logs, its open or nor

#docker logs oracledb

23.26.1.0.0 – Production
Version 23.26.1.0.0
The Oracle base remains unchanged with value /opt/oracle
DB is in good health on startup
The Oracle base remains unchanged with value /opt/oracle
#########################
DATABASE IS READY TO USE!
#########################
The following output is now a tail of the alert.log:
2026-02-20T11:54:05.670123+00:00
CLID: P
PDB$SEED(2):Autotune of undo retention is turned on.
2026-02-20T11:54:12.246423+00:00
PDB$SEED(2):Opening pdb with no Resource Manager plan active
ORCLPDB1(3):Autotune of undo retention is turned on.
2026-02-20T11:54:18.242310+00:00
ORCLPDB1(3):Opening pdb with no Resource Manager plan active
Completed: Pluggable database ORCLPDB1 opened read write
Completed: alter database open