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 :
- Downloaded the 18.1 64-bit, Version 18.1.0.0.0 (64-bit) | instantclient-basic-macos.x64-18.1.0.0.0.zip
- created dir /opt/oracle
- unzip at /opt/oracle
- 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 :
