Connecting To Oracle Database

From Alpine Linux
Revision as of 12:07, 20 October 2020 by Pojntfx (talk | contribs) (Add Oracle database connection instructions)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Connecting to a Oracle database does not seem to be possible due to the driver being compiled for GNU libc and it being proprietary. It is possible to connect to a database using Docker however. The image is proprietary, so a docker login is required and the "Proceed to Checkout" on https://hub.docker.com/_/oracle-instant-client has to be went through.

Connecting with okli

okcli is a libre CLI to access a Oracle database. You can connect using it with the following command:

<source lang="bash">
docker run -it -e LC_CTYPE=en_US.UTF-8 store/oracle/database-instantclient:12.2.0.1 sh -c "yum install -y python3-pip && pip3 install okcli && okcli 'myusername/mypassword@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=141.62.75.20)(Port=1521))(CONNECT_DATA=(SID=DB1)))'"
</source>

Connecting with SQL Plus

SQL Plus is the proprietary CLI to access a Oracle database. You can connect using it with the following command:

<source lang="bash">
docker run -it -e LC_CTYPE=en_US.UTF-8 store/oracle/database-instantclient:12.2.0.1 sqlplus 'myusername/mypassword@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=141.62.75.20)(Port=1521))(CONNECT_DATA=(SID=DB1)))'
</source>