Solved: Error connecting to the db: ORA-00000: DPI-1047 Golang macOS High Sierra Version 10.13.6

I have added my notes to solve an issue while running go lang microservice in MacOS connecting with Oracle DB.

While working with a microservice in golang (Platform macOS High Sierra Version 10.13.6), which interacts with OracleDB found below issue :

FATA[0012] Error connecting to the db: ORA-00000: DPI-1047: Cannot locate a 64-bit Oracle Client library: “dlopen(libclntsh.dylib, 1): image not found”. See https://oracle.github.io/odpi/doc/installation.html#macos for help

Then Followed Here: https://oracle.github.io/odpi/doc/installation.html#macos, and did following steps which solved the issue :

  1. Downloaded the 18.1 64-bit, Version 18.1.0.0.0 (64-bit) | instantclient-basic-macos.x64-18.1.0.0.0.zip
  2. created dir /opt/oracle
  3. unzip at /opt/oracle
  4. link ~/lib to /opt/oracle

See below command line output :

London:oracle esumit$ sudo unzip instantclient-basic-macos.x64-18.1.0.0.0.zip

London:oracle esumit$ sudo mkdir ~/lib

London:oracle esumit$ sudo ln -s /opt/oracle/instantclient

instantclient-basic-macos.x64-18.1.0.0.0.zip

instantclient_18_1/

London:oracle esumit$ sudo ln -s /opt/oracle/instantclient_18_1/libclntsh.dylib ~/lib/

London:oracle esumit$ pwd

/opt/oracle

London:oracle esumit$

Here is the screenshot :

Cannot locate libcintsh-dylib-sh library
Cannot locate libcintsh-dylib-sh library

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s