# Oracle Database Setup: Linux

This is step by step guide to set up and start working with Oracle Database on Linux

> Step 1: Install Docker
> 
> For Fedora/RHEL distros:
> 
> ```bash
> sudo yum install docker.io
> ```
> 
> For Ubuntu/debian distros
> 
> ```bash
> sudo apt install docker.io
> ```

> Step 2: Now pull the docker image of the Oracle database container
> 
> ```bash
> sudo docker pull container-registry.oracle.com/database/express:latest
> ```

> Step 3: Now run the Oracle database docker container
> 
> ```bash
> sudo docker run -d --name oracle-db -p 1521:1521 container-registry.oracle.com/database/express:21.3.0-xe
> ```

Now let's see if our docker container is up and working!

> Step 4: sudo docker ps | grep health

you should be able to see the output like this

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691849799376/1d8981aa-c8d8-4e70-af09-0e56e3fa8408.png align="center")

or

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691850688771/36df25b3-a305-468c-b015-e86a038ea131.png align="center")

> Step 5: A little tweaking in the configuration of the container is needed to make it ready to connect to the SQL developer tool
> 
> * Run the following commands to add a line to setup connection between the container and the SQL developer tool
>     
> 
> ```bash
> sudo docker ps
> ```
> 
> ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691851994472/a392cab3-c36f-4c78-a633-e33b17dd956a.png align="center")
> 
> ```bash
> sudo docker exec -it [CONTAINER ID] bash
> ```
> 
> Replace "\[CONTAINER ID\]" with the first 4 digits of the container ID
> 
> ```bash
> echo "DISABLE_OOB=ON" >> /opt/oracle/oradata/dbconfig/XE/sqlnet.ora
> ```
> 
> * Now to set the password of the oracle database
>     
> 
> ```bash
> sudo docker exec [CONTAINER ID] ./setPassword.sh [new password]
> ```

### We have completed the DBMS installation.

### Let's install SQL developer tools

> Step 6: Download the .rpm file irrespective of the distro
> 
> [Download here](https://www.oracle.com/database/sqldeveloper/technologies/download/)
> 
> Now install the packages by following the below steps
> 
> For Debian/Ubuntu distros
> 
> ```bash
> sudo apt update
> sudo apt install alien 
> alien --to-deb [file_name.rpm]
> sudo apt install ./[file_name.deb]
> ```
> 
> For Fedora/RHEL
> 
> ```bash
> sudo rpm -i [file_name.rpm]
> ```

We have reached the installation of the Oracle database and SQL Developer tools!

### The final step.

Tighten up your sleeves, this is the part we will face turbulence.

> * Open the SQL developer tool GUI
>     
> 
> ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691853464898/2e487fc6-1ca4-4b30-b479-7f14c3af7baa.png align="center")
> 
> * Set the sid to 'xe'
>     
> 
> enter username as 'SYS'

And you should be able to work in worksheet!

Everytime you boot up your machine run the Database container

```bash
sudo docker run -d --name oracle-db -p 1521:1521 [image name]
```
