oracle / docker-images

Official source of container configurations, images, and examples for Oracle products and projects
https://developer.oracle.com/use-cases/#containers
Universal Permissive License v1.0
6.45k stars 5.4k forks source link

Can DB_DOMAIN in OracleDatabase/SingleInstance? #2764

Closed jnewton03 closed 4 months ago

jnewton03 commented 4 months ago

Hello,

I can see the value here: https://github.com/oracle/docker-images/blob/a79b41c71cc845ad67703be5f1f1646d7c737e23/OracleDatabase/SingleInstance/dockerfiles/19.3.0/dbca.rsp.tmpl#L27

#-----------------------------------------------------------------------------
# Name          : gdbName
# Datatype      : String
# Description   : Global database name of the database
# Valid values  : <db_name>.<db_domain> - when database domain isn't NULL
#                 <db_name>             - when database domain is NULL
# Default value : None
# Mandatory     : Yes
#-----------------------------------------------------------------------------
gdbName=###ORACLE_SID###

But I did not see in the documentation where we could set this value at either build time or run time.

Thanks!

oraclesean commented 4 months ago

You can use an entrypoint script to handle this.

Add a file to the setup directory, for example 01_set_domain.sql, with contents along the lines of:

alter system set db_domain='xxx' scope=spfile sid='*';
shutdown immediate
startup
jnewton03 commented 4 months ago

This is great @oraclesean! Thank you for the quick response!