I'm running oracle database in docker like this

docker run -d --rm --name oracle_online -e ORACLE_SID=xxx -e ORACLE_PDB=xxx -e ORACLE_PWD=xxx -v /home/data/oracle:/opt/oracle/oradata -it -p 1521:1521 container-registry.oracle.com/database/enterprise:

When it's started, the ORACLE_SID is unchanged, it's always ORCLCDB:

TNSLSNR for Linux: Version - Production
System parameter file is /u01/app/oracle/product/12.2.0/dbhome_1/admin/ORCLCDB/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/95c1ad3d33bd/listener/alert/log.xml


#ip-address : IP address of the host where the container is running.
#port       : Host Port that is mapped to the port 1521 of the container.
# The mapped port can be obtained from running "docker port <container-id>"
# ===========================================================================
Completed:     alter pluggable database ORCLPDB1 open
    alter pluggable database all save state
Completed:     alter pluggable database all save state
ALTER SYSTEM SET encrypt_new_tablespaces='DDL' SCOPE=BOTH;

Does anyone know how to change the SID?

2 Answers 2


Sure, you need to change pfile/spfile and set ORACLE_SID before the startup of the database to change the name of the instance. Meaning you need to change how the docker image starts the database, if you want this done automatically.

Simply passing some environment variables through docker after the database was started will not change anything.


Oracle provides only 12.X and latest (19.X at this moment), I've took at look at the docker entrypoint and the conclusion is:

  1. For 12.X use -e DB_SID=XXX -e DB_PASSWD=XXX to change SID and password (From paramChk.sh)
  2. For latest version use -e ORACLE_SID=XXX -e ORACLE_PWD=XX (From setPassword.sh)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.