AWS Lambda cannot connect to Oracle Instant Client

↘锁芯ラ 提交于 2019-12-10 10:57:51

问题


I have a basic requirement of connecting an on premise Oracle database to Redshift.

I need to use AWS Lambda to connect to both the databases using python. While I achieved connection to Redshift by exporting Linux libraries of psycopg2, I am facing issues with the Oracle database.

Below are the steps followed to try to connect to Oracle on premise DB :

  1. Installed cx_Oracle which came up with cx_Oracle.cpython-36m-x86_64-linux-gnu.so and psycopg2-2.7.4.dist-info
  2. Installed basic oracle client lite 64 bit for linux
  3. Set LD_LIBRARY_PATH to point to the lib files of the instant client package

When we zip our python file with the dependencies of cx_Oracle and Instant client, AWS Lambda fails with below error :

"DPI-1047: 64-bit Oracle Client library cannot be loaded: \"libclntsh.so: cannot open shared object file: No such file or directory\"


回答1:


From within your lib folder, do:

ln -s libclntsh.so.12.1 libclntsh.so

(or similar, depending what versions you're using).



来源:https://stackoverflow.com/questions/49124271/aws-lambda-cannot-connect-to-oracle-instant-client

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!