Connecting to Oracle RDS

巧了我就是萌 提交于 2019-12-01 06:13:25

This post was much helpful for me to use cx_Oracle using Lambda functions. It worked as expected. Thanks for creating this post @Sayed Zainul Abideen

But i got another error from lambda stating 'cx_Oracle.DatabaseError: ORA-24454: client host name is not set'

I got it resolved by adding the below lines in my python code:

import os

with open('/tmp/HOSTALIASES', 'w') as hosts_file:
    hosts_file.write('{} localhost\n'.format(os.uname()[1]))

After which i added below ENVIRONMENTAL VARIABLE to my Lambda function:

HOSTALIASES = /tmp/HOSTALIASES

Hope it helps somebody.

Please add comments if any issues relating to cx_Oracle. I would be happy to help as i struggled a lot to fix this.

I solved this by simply zipping the files properly with the symbolic links

First I created three symbolic links (with respect to above dir structure):

ln -s ./lib/libaio.so.1.0.1 ./lib/libaio.so.1

ln -s ./lib/libaio.so.1.0.1 ./lib/libaio.so

ln -s ./lib/libaio.so.1.0.1 ./libaio.so.1.0.1

ln -s ./lib/libclntsh.so.12.1 ./lib/libclntsh.so

then i was zipping it incorretly I did it like this:

zip --symlinks -r9 ~/lamda.zip *

it worked! properly then.Hope it helps somebody.

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