How To Install Oracle Database in Docker

This article provides information about how to install oracle database in docker and oracle usage in docker.

For detailed information about Docker before installation, please refer to my article “What is Docker? Docker Installation and Usage“.

Install Oracle Database in Docker

To install oracle in the docker environment, first you need to register at “hub.docker.com”.

After the registration operation, the required oracle database must be found with search and the required usage agreement must be accepted.

After the required registration and contract operations are done, log in to the user account from the command interpreter as follows.

Download Oracle Database Docker Image

After login, download the image.

You can copy the above code from the below screen.

The Oracle database also has a slim version that does not include tools such as APEX.

At least 20GB of free space is required to install oracle in the Docker environment.

Create Oracle Database Container From Docker Image

Create the container using the downloaded image.

It is important for later use to give the appropriate name with the -name parameter.

To use the Oracle APEX tool, the APEX port must also be allowed.

Oracle Usage in Docker Environment

After the installation is complete, you can connect to the Oracle SQL Plus tool to create users and grant the necessary permissions as follows.

Connect to Oracle as sysdba in Docker

Create Oracle User in Docker

Grant Permission to User in Docker

NOTE: You can grant permissions for certain privileges ​​such as SELECT, INSERT, UPDATE, CREATE TABLE instead of ALL PRIVILEGES.

Connect To SQL Developer in Docker

Find Oracle Service Name From SQL Plus

You can execute the following query in SQL Plus to find the Oracle service name value.

Start and Stop Oracle in Docker

Oracle restarts at the start of each operating system using the container name that you provided with the -name parameter during installation.

NOTE: We assumed that we set the -name parameter as oracle.

After Oracle installation and user creation process, Oracle database can be managed through Oracle SQL Developer tool according to user permission.

Have a good day.