Home > Enterprise >  Starting an Oracle DB using Docker Compose
Starting an Oracle DB using Docker Compose

Time:09-02

I'm starting an oracle DB in docker (on OS Windows 10) with the following command:

docker run -d --env-file C:\(...)\ora_db_env.dat -p 9445:1521 --name oracle-std --shm-size="8g" container-registry.oracle.com/database/standard

Works fine. Now I want to do the same using docker compose. https://www.composerize.com/ gives me the following docker-compose.yml file, so it is missing the informations for 'shm-size' and all from my 'ora_db_env.dat', (see below):

    version: '3.3'
    services:
        oracle-std-service:
            ports:
                - '9445:1521'
            container_name: oracle-std-service-container
            image: container-registry.oracle.com/database/standard

(...other services...)

Contents of 'ora_db_env.dat':

DB_SID=OraDoc
DB_PASSWD=MyPasswd123
DB_DOMAIN=my.domain.com
DB_BUNDLE=basic

I tried including those missing informations...

version: "3.9"
services:
    oracle-std-service:
        container_name: oracle-std-service-container
        ports:
            - '9445:1521'
        image: container-registry.oracle.com/database/standard
        environment:
            shm-size: 8g
            DB_SID: OraDoc
            DB_PASSWD: MyPasswd123
            DB_DOMAIN: my.domain.com
            DB_BUNDLE: basic

...but I only get the following output:

config DB failed, please check log /home/oracle/setup/log/configDB.log for details

Not knowing (also after googling it) where to find this file in Windows, I don't know what to do.

CodePudding user response:

Can't be sure 100% about this, due to lack of logs, but this can be failing due to shm-size configuration
SHM_SIZE is a docker config and so should be declared at service level and not as environment.
Like

version: "3.9"
services:
    oracle-std-service:
        shm_size: 8g
        container_name: oracle-std-service-container
        ports:
            - '9445:1521'
        image: container-registry.oracle.com/database/standard

See SHM_SIZE in docker compose

Log location is inside the container, you can use docker exec to access it if the container is still running, find its name by using docker ps -a

docker exec --it <oracle container name> bash

And if it is stopped already then you will have to start it and access using exec

CodePudding user response:

Yes...being able to see the logs with help from Arun Sa i confirm that the problem was the shm_size parameter being at the wrong position in docker-compose.yml. Problem solved, tahnk you very much:

version: "3.9"
services:
    oracle-std-service:
        shm_size: '8gb'
        container_name: oracle-std-service-container
        ports:
            - '9445:1521'
        image: container-registry.oracle.com/database/standard
        environment:            
            DB_SID: OraDoc
            DB_PASSWD: MyPasswd123
            DB_DOMAIN: my.domain.com
            DB_BUNDLE: basic
  • Related