2

I pulled the image from this docker pull store/oracle/database-enterprise:12.2.0.1 Also I can run the database by docker run -d -it --name <Oracle-DB> store/oracle/database-enterprise:12.2.0.1

In my docker status, this container is up, running on port 1521 and healthy. I can also access the db from inside the container.

When I tried to access the db from sql developer from my local inside. I get the error Status : Failure - Test failed: IO Error :The Network adapter could not establish the connection

Username : dummy Password : dummy Hostname : localhost Port : 1521

I use Ubuntu 16.04.

What steps are more needed to access db running on docker?

Edit 1: sql developer runs on local machine, outside the docker container.

S Khandelwal
  • 199
  • 2
  • 13

1 Answers1

1

Make sure your listener is running on the docker container, your listener.ora is configured correctly, and make sure your 'Hostname' in your connection details is the hostname of the docker container, not 'localhost' (assuming you are running SQL Developer from a different host or container, it's not clear from your question).

MplsDBA
  • 86
  • 4
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Sep 28 '21 at 22:19
  • I am using local ip in tnsnames.ora file and it's path is set in TNS_ADMIN env variable. Additionally this is path pointed in advance settings of sqldeveloper. – S Khandelwal Sep 29 '21 at 10:18
  • _"I am using local ip in tnsnames.ora file"_ tells us nothing useful and does not confirm that you have the correct setting. You need to update your question show the output (please copy and paste text from command window) the output of 'lsnrctl status'. That - and _only_ that, will _confirm_ what the correct setting _should_ be. – EdStevens Sep 29 '21 at 23:02
  • Based on your edit, you are running SQL Developer outside of your docker container. If this is the case, you can't simply use 'localhost' because your Oracle DB isn't running on the local 'host', it's running in your container. The easiest thing to try is to start your docker container and map the DB Listener port so that it is accessible from the local host. In your case you would start the container with the "-p 1521:1521" which should work, as it makes port 1521 in the docker container available on the local host as port 1521. – MplsDBA Oct 11 '21 at 21:37