Run Oracle Database on your Mac.
-> Via Docker and Oracle Database Enterprise Edition Image with few steps in minutes.
Install Docker CE for Mac and log in to Docker Hub.
- Register a Docker ID if you don't have.
- Skip this step if Docker already installed on your Mac and you already logged in Docker Hub.
- Run the command below to starting an Oracle Database Server Instance as a Docker container named "Oracle-DB" and mapping port 1521 from the container to port 1521 on your Docker host (your Mac). This will take you a few minutes to download the image and Starting the container.
Pull and run Oracle Database Enterprise Edition Image from Docker Hub.
- Search for "Oracle Database Enterprise Edition" in Docker Hub and Checkout the document for more details.- Run the command below to starting an Oracle Database Server Instance as a Docker container named "Oracle-DB" and mapping port 1521 from the container to port 1521 on your Docker host (your Mac). This will take you a few minutes to download the image and Starting the container.
docker run -d -it --name Oracle-DB -p 1521:1521/tcp store/oracle/database-enterprise:12.2.0.1
- Ok, So now you already have an instance of Oracle Database server in your Mac for testing or development. When you don't want the instance running and saving your Mac performance, you can stop the container or want to start the instance again as below:
- If your project is done and you don't want to use the instance any more, you should stop the container and delete the image as below:
- And remove unused volume:
docker volume prune
Error Notes: When you connect from Oracle SQL Developer Tool to the Oracle Database Server Instance, if you get a message "Status: Failure -Test failed: IO Error: Got minus one from a read call" or "Status: Failure -Test failed: Listener refused the connection with the following error:
ORA-12505, TNS: listener does not currently know of SID given in connect descriptor" -> So please wait in moments, the instance is preparing in the container, you can connect success very soon after that, don't worry :). Good luck and fun.References:
- https://docs.docker.com
- https://hub.docker.com/_/oracle-database-enterprise-edition?tab=resources
How can i use TCPS in docker
ReplyDeleteI've just wrote a post for this question from you, hope that it helful.
Deletehttps://koacervate.blogspot.com/2019/07/quickstart-how-to-connect-to-oracle.html
Regards,
My requirement is to connect through TCPS connection instead of TCP. How can i achieve this in docker. I am trying to connect the DB as below.When i use TCP its working fine but its failing when i use TCPS. I am aware pointing the SQL developer to local installed oracle client and then change in listeners and TNSname.ora etc. but how can i achieve this in Docker, is there a way.
ReplyDeleteLet me know the steps in Docker.
jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCLCDB.localdomain)))
Hi,
Delete1) You should download Oracle Client (instantclient-basic-macos.x64-18.1.0.0.0.zip
) from "https://www.oracle.com/database/technologies/instant-client/macos-intel-x86-downloads.html#license-lightbox", then extract to a folder in your Mac.
2) You should follow this article "https://oracle-base.com/articles/misc/configure-tcpip-with-ssl-and-tls-for-database-connections" to configure Exchange certificates and enable support Protocol TCPS from your Mac to Docker Container Oracle-DB as client/server.
3) You will connect from SQL Developer or SQLPlus (instantclient-sqlplus-macos.x64-18.1.0.0.0.zip) to the container via Oracle client, please follow this article: "https://www.thatjeffsmith.com/archive/2014/01/oracle-sql-developer-4-and-the-oracle-client/".
If have any trouble please let me know.
Regards,
Koacervate
I've just wrote a post for this question from you, hope that it helful.
Deletehttps://koacervate.blogspot.com/2019/07/quickstart-how-to-connect-to-oracle.html
Regards,
Hello, could you help me? I do not if it is for my system but when I run the command docker container ps, the status of my docker is unhealthy. And the SQL Developer does not connect. I have a M1 chip
ReplyDeleteHi Jey, I think latest version of Docker support for M1 chip. Please make sure your "Docker Desktop is running" on your Mac first. You can find the icon of Docker in your "Applications" and open it. If you have get any error message when you run command docker container ps, please post it here. Regards,
Delete