setting up docker with oracle on mac

Once you have docker configured to run locally, see blog post https://sqlkitty.home.blog/2019/12/15/setting-up-docker-with-sql-server-backup-on-mac/ for more details

Then you can setup Oracle in Docker

Login into docker store in web browser – or follow this to use a web browser via ssh – https://superuser.com/questions/139426/accessing-a-url-on-ssh-without-using-a-web-browser

Search for oracle database

Select enterprise db version and accept the terms

Sudo to root

Run docker login

Then enter your docker credentials

Pull the oracle container in terminal
docker pull store/oracle/database-enterprise:12.2.0.1

Run the container
docker run -d -p 8080:8080 -p 1521:1521 –name OracleDB store/oracle/database-enterprise:12.2.0.1

Check that it’s running
docker ps -a

Connect to sql editor
docker exec -it OracleDB bash -c “source /home/oracle/.bashrc; sqlplus /nolog”

Run these two scripts

connect sys as sysdba;

alter session set “_ORACLE_SCRIPT”=true;

And then run this and note the value returned
select value from v$parameter where name=’service_names’;

Then update sys user so you can actually connect to it since the password you type to connect as sys appears to have nothing to do with anything:

alter user sys identified by “new password”;

To quit sql editor use quit
SQL> quit

To use oracle db in dbeaver

Download the oracle jdbc drivers in a zip from this location (you will need an oracle login for this or you can set one up)
https://www.oracle.com/database/technologies/jdbc-upc-downloads.html

Unzip the files and place them in a location you can access on your mac and make sure you don’t delete them later.

You will have to add them into dbeaver in your oracle connection

To create a db which is actually a schema in oracle – run these queries
alter session set “_ORACLE_SCRIPT”=true;
create user dbname identified by dbname;
GRANT CONNECT, RESOURCE, DBA TO dbname;

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.