Connecting To Oracle Database

From Alpine Linux
Revision as of 12:11, 20 October 2020 by Pojntfx (talk | contribs) (Use correct tags for commands)

Connecting to a Oracle database directly 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 as well, 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:

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)))'"

Connecting with SQL Plus

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

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)))'