DEV Community

Cover image for Run Oracle19c Database in Mac M1/M2 using Docker
Devashish Roy
Devashish Roy

Posted on

Run Oracle19c Database in Mac M1/M2 using Docker

Running Oracle 19c on Mac (M1/M2) isn’t straightforward. Unlike Windows or Linux, Oracle doesn’t provide a native installer, which can be a huge blocker for students and developers.

During my MTech 2nd semester Database Security Lab, I had to use Oracle 19c for practicals—but on my Mac, there was no direct installer available. Initially, I wasted a lot of time trying different hacks and workarounds just to get it running.

The breakthrough came when I used Docker. By containerizing Oracle 19c, I could run it seamlessly on macOS without hitting compatibility issues.

Repository Link: https://github.com/roydevashish/path-to-software-engineer

Documentation Link: https://github.com/roydevashish/path-to-software-engineer/blob/main/oracle19c-in-mac-m1-m2-using-docker.md

If you’re on macOS and struggling to run Oracle databases, this setup can save you hours of frustration.

Curious to know — have you ever used Docker as a workaround to bypass OS compatibility issues?

Prerequisite

Steps to follow

1. Download the Oracle Database 19c for LINUX ARM (aarch64) file

Go to the page -> Database Software Downloads | Oracle India and download Oracle Database 19c for LINUX ARM (aarch64) file.


2. Clone Repository oracle/docker-images

git clone github.com/oracle/docker-images
Enter fullscreen mode Exit fullscreen mode

3. Copy or Move the file

Copy or Move the download file LINUX.ARM64_1919000_db_home.zip to docker-images/OracleDatabase/SingleInstance/dockerfiles/19.3.0.


4. Build the Image

Use terminal and navigate to docker-images/OracleDatabase/SingleInstance/dockerfiles.

Build the docker image by running the shell script:

./buildContainerImage.sh -v 19.3.0 -e
Enter fullscreen mode Exit fullscreen mode

where

  • v: for version
  • e: for enterprise edition

5. List to check the images

docker images
Enter fullscreen mode Exit fullscreen mode

The list must have an image docker/database with tag 19.3.0-ee.


6. Run the Docker Container

Run a docker container using the image:

docker run -d --name oracle19 -e ORACLE_PWD=mypassword1 -p 1521:1521 oracle/database:19.3.0-ee
Enter fullscreen mode Exit fullscreen mode

where

  • -name: Name of the container
  • ORACLE_PWD: Password of your oracle database
  • p: Port mapping

7. Check the status of the container

Check the status of the container:

docker ps
Enter fullscreen mode Exit fullscreen mode

The status should be healthy that means the container is up and running.


8. Download the VS Code Extension

Download the Oracle SQL Developer Extension for VSCode.

  • Create a New Connection with the following properties

    Name: SYS
    (You can give anything, but I like to keep the connection name as the username, so that I know which user is using this connection.)
    
    Role: SYSDBA
    Username: SYS
    Password: mypassword1
    
    Hostname: localhost
    Port: 1521
    Type: Service Name
    Service Name: ORCLCDB
    
  • Click on Test to check the connection

  • Click on Save to save the connection

  • Click on the connection name to connect, it will ask for the password

  • Open a worksheet and run the SQL commands


References

Top comments (0)