Can’t change ORACLE_SID for container-registry.oracle.com/database/enterprise

dockeroracle

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:12.2.0.1

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

TNSLSNR for Linux: Version 12.2.0.1.0 - 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
2020-11-14T05:42:36.136965+00:00
    alter pluggable database all save state
Completed:     alter pluggable database all save state
2020-11-14T05:42:36.426957+00:00
ALTER SYSTEM SET encrypt_new_tablespaces='DDL' SCOPE=BOTH;
2020-11-14T05:42:38.664560+00:00

Does anyone know how to change the SID?

Best Answer

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.