Score:0

How to connect oracle database docker image

cn flag

I have registered with the docker image of oracle database and got below link to pull the image.

docker pull store/oracle/database-enterprise:12.2.0.1

No other tags available to see on the page. But some how I got information about 12.1.0.2

With 12.2.0.1, I am able to run a database and connect to it. But with 12.1.0.2, the database is not connecting.

docker service create --with-registry-auth --network=oracle_net --name Oracledb_39 -p target=1521 store/oracle/database-enterprise:12.2.0.1

The above container is working but if I trey with below tag, the database is not connecting.

docker service create --with-registry-auth --network=oracle_net --name Oracledb_39 -p target=1521 store/oracle/database-enterprise:12.1.0.2

The 12.1.0.2 with dbeaver client to connect:

connectivity with 12.1.0.2

But able to connect with 12.2.0.1

connectivity with 12.2.0.1

Please suggest how to connect to 12.1.0.2 or any of 12.1.x

And also please share how to see all the tags available for oracle database docker image.

I have deployed it in swarm to test, same result with direct docker run also.

docker exec -it Oracledb_38.1.k3who8un6hs9vulwljwvhx4x4 sqlplus sys@ORCLCDB

Inside container:

[root@bf9581972c5a /]# ps -ef
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 12:07 ?        00:00:00 /bin/bash /home/oracle/setup/dockerInit.sh
root        34     1  0 12:09 ?        00:00:00 tail -f /home/oracle/setup/log/dockerInit.log
root        40     0  0 19:09 pts/0    00:00:00 bash
root        60    40  0 19:10 pts/0    00:00:00 ps -ef

[root@bf9581972c5a /]# sqlplus
bash: sqlplus: command not found

The container logs:

[ec2-user@ip-172-31-47-251 ~]$ docker logs Oracledb_38.1.k3who8un6hs9vulwljwvhx4x4
User check : root.
Setup Oracle Database
Oracle Database 12.1.0.2 Setup
Tue Aug 3 12:07:09 UTC 2021

Check parameters ......
log file is : /home/oracle/setup/log/paramChk.log
paramChk.sh is done at 0 sec

untar DB bits ......
log file is : /home/oracle/setup/log/untarDB.log
untarDB.sh is done at 153 sec

config DB ......
log file is : /home/oracle/setup/log/configDB.log
grep: /home/oracle/setup/log/configDBora.log: No such file or directory
configDB.sh is done at 153 sec

Done ! The database is ready for use .
Tue Aug 3 12:07:09 UTC 2021
User check : root.
Setup Oracle Database

The container is in running state only, but not able to connect to it when I tried with dbeaver or any other oracle client applications.

Score:1
ph flag

You better check whether DB is running at all by checking your container status.

This link has a lot of information about Oracle in container (credits to chuck and his comment).

https://www.toadworld.com/platforms/oracle/b/weblog/archive/2017/06/21/modularization-by-using-oracle-database-containers-and-pdbs-on-docker-engine

wrt tags, seems like this is an old image, check docker inspect ... to see when it was produced. You may see other tags as well.

For a newer version you can check instructions how to build by yourself at: https://github.com/3scale/oracle-database

Update: link to more official instructions for building Oracle images https://github.com/oracle/docker-images

Sara June avatar
cn flag
I added details can you please check the new data
ph flag
@SaraJune, I'm not an oracle expert. But it looks like images you are using are rather old. Better go with the newer images I gave you a link to. Or directly check https://github.com/oracle/docker-images . Or use `12.2.0.1` which in store is listed as the latest. Even though `12.2.0.2` tag exists, it doesn't mean it worked for anybody.
Sara June avatar
cn flag
We need 12.1.0.2, old version. To support a specific customer. 12.2.0.1 is working.But we need 12.1.0.2, not 12.2.0.2
Sara June avatar
cn flag
Even I tried buiding custom images from the link you shared.But it seems, the credentials are not working for that and getting same error. Even passed as env variables while creating container
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.