Installing oracle database is a very tedious task. But with the help of Docker Containers, it can be easily done. With this solution, it gives developers the flexibility to work with multiple databases without the hassle.
Prerequisites
- Docker Installation
- Docker Hub Account
- Oracle Account (for downloading SQL Developer)
Head into Oracle Database Enterprise Edition & agree to terms & conditions.
Installation
Open Windows Terminal & run the following commands
- Login to Docker Hub
docker login
- Download Oracle Image
docker pull store/oracle/database-enterprise:12.2.0.1
- Run Image
docker run -d -p 1521:1521 --name oracle store/oracle/database-enterprise:12.2.0.1
- Connect to container
docker exec -it oracle bash -c "source /home/oracle/.bashrc; sqlplus /nolog"
Once the above command executes it will connect you to the SQL Plus terminal. Execute following commands to create the user to work on
connect sys as sysdba;
Above command will prompt you to enter the password. Enter Oradoc_db1 as default password
Next, run the below commands one by one
alter session set "_ORACLE_SCRIPT"=true;
create user <username> identified by <password>;
GRANT ALL PRIVILEGES TO <username>;
Now we can connect to the above created Oracle schema using Oracle SQL Developer
Use the following values when login
Property | Value |
---|---|
Username | entered user |
Password | entered password |
Hostname | localhost |
Port | 1521 |
Service Name | ORCLCDB.localdomain |
Happy Coding 😀
Top comments (1)
Thanks a lot for the write up. It helped me a lot. However, it seems the docker image isn't available on docker hub anymore.
I wrote a tutorial here also shows how to get the image from Oracle docker registry:
datmt.com/backend/how-to-install-o...