Reputation: 41
I'm using an AWS Lambda function (in Python) to connect to an Oracle database (RDS) using cx_Oracle library. But it is giving me the below error - "DPI-1047: Cannot locate a 64-bit Oracle Client library: "libclntsh.so: cannot open shared object file: No such file or directory".
Steps I've followed -
conn = cx_Oracle.connect(user="user-name", password="password", dsn="DB-Endpoint:1521/"database-name",encoding="UTF-8")
Please help me in resolving this issue.
Upvotes: 0
Views: 594
Reputation: 41
The reason I faced this issue was that I just downloaded cx_Oracle library. In order to connect to the Oracle database from the Lambda function, we need to download the Oracle client and libaio libraries as well and club them with cx_Oracle to create a Lambda Layer. Once I followed these steps, I was able to connect to the Oracle database and query its tables. I've created a video for this process, so that others need not go through the issues I faced. Hope it will be helpful to all - https://youtu.be/BYiueNog-TI
Upvotes: 0
Reputation: 7086
Set the environment variable DPI_DEBUG_LEVEL
to the value 64
and then rerun your code. The debugging output should help you figure out what is being searched. Note that you need to have the 64-bit instant client installed as well!
Upvotes: 1