Pages

Wednesday, June 29, 2016

Installing Oracle Express 11g using Docker on Ubuntu

Installation of Oracle database on a Linux system for learning purposes is a huge hassel since there are so many steps to follow to get Oracle database is up and running. Furthermore, since I'm running on Ubuntu Linux which is a Debian based system, things are much more complicated than working on a RPM based system. Due to these reasons, I was strugging to get Oracle databse up and running on my system for a while. Finally I found a nice way to use it. Without going through the overhead of installing it, I found a docker image which I can to directly run on my Ubuntu Linux platform. Following are the steps I followed to get it done on my Ubuntu 16.04 LTS system.

Preparing the system for Docker

These steps are needed if you didn't have docker configured in your system like me initially. I found these steps from here [1].

(3) We can see the status of the running docker container using the following commands.

# to see the running docker processessudo docker ps

# to see the things running inside a particular docker image, we can use the following command. The value we passed to the '-f' parameter is the contained ID which we can findout using the above command.

sudo docker logs -f 6ab14881419c

(4) We can get a bash terminal for our docker running Oracle XE using the following command. There also we have used the container ID as a parameter.

sudo docker exec -it 6ab14881419c /bin/bash

Preparing sqlplus tool for using Oracle XE 11g

Now that we have started running oracle xe as a docker image and got a root shell for this docker container, we can start interacting with the database server using the 'sqlplus' client program. Let's do some preliminary things to enable the sample database schema called HR and a user account to use it called HR account.

(1) Login to the database using 'sqlplus' tool with username 'system' and password 'oracle'.

(3) We should see the output as 'User altered.' Now, 'exit' from the 'sqlplus' and then login again but this time with the unlocked user account where the username is 'system' and password is 'password'.

(4) Now in the SQL prompt, type the following query and see whether we get a proper output. If so, we have unlocked our HR account and the HR schema is now available to us.