Setting up SQL*Plus with the help of an Oracle Docker container

Working with Oracle Database's I like to install the Oracle instant client - probably the biggest reason for me is that it gives me access to SQL*Plus. Personally, I think the installation is very straight forward, but the number one complaint I hear is its too difficult to set up.

So, how can you get access to SQL*Plus without this "difficult" installation process?

Say hello to the Oracle instant client docker container.

If you head over to https://container-registry.oracle.com, navigate to the database section, you will notice 3 repositories:



So, you will see the second one in the list is named "instantclient" - exactly what we need!

side note: this container is a little out of date, being last updated over a year ago, but I'd say the latest version isn't crucial for most needs.

So, if you click into instantclient, you will need to sign in first so that you can accept the license agreement. You will also need to sign into the registry from your shell. Once that is done, we can grab that image with:

docker pull container-registry.oracle.com/database/instantclient:latest

With that installed, you will now want to create an alias on your OS. So, go ahead an run the following in your shell:

alias sqlplus='docker run -ti --rm container-registry.oracle.com/database/instantclient sqlplus'

Now, if you run:

type -a sqlplus

You should see that SQL*Plus is now aliased to run that docker container.

I happen to have a VirtualBox VM running with an Oracle XE database, with the schema vmtest. It is on my local network with the IP address 192.168.0.104. So, now if I run:

sqlplus vmtest/vmtest@//192.168.0.104/xe


I'll be connected to the database, which the following screenshot demonstrates.



How simple is that! I didn't need to go through any rigorous process to install the instant client, and I now have SQL*Plus at my disposal.

Popular posts from this blog

Report row buttons firing a dynamic action

Accessing the last request value from a page submission

Installing Oracle Instant Client on Ubuntu