adding environment variables in the crontab works
like charm. Steps to check if the cx_Oracle work:
print 'cx_Oracle works'
In your crontab add,print 'cx_Oracle error'
* * * * * python /path/to/test_cx_oracle.py.
Notice that the cron will execute every minute.
You will received error notification in your email
$ tail /var/spool/mail/oracle
Edit your cron:
ORACLE_HOME = '/path/to/db_1'
LD_LIBRARY_PATH = '/path/to/db_1/lib:/lib:/usr/lib'
* * * * * python /path/to/test_cx_oracle.py
Save and exit, wait for cron to fire then check your
mail again. You should received 'cx_Oracle works'
notification. Hope it helps.