0
votes

I have installed the python Oracle module cx_Oracle on my Linux machine. The oracle user and root user can both import cx_Oracle and create a database connection using cx_Oracle.Connection(...).

Other users on the server can also import cx_Oracle but when they try to create a connection object the following exception is thrown:

>>> cx_Oracle.Connection('....')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
cx_Oracle.InternalError: No Oracle error?

I have confirmed that the user I am trying to get to work has all the correct system variables set, ORACLE_HOME, LD_LIBRARY_PATH, ORACLE_SID and PATH. This user also has no problem using sqlplus and connecting to databases that way.

I assume this is a file permissions problem since both the oracle and root users have no problems. I am just not sure which file could be causing the issue.

1
When you run the same script as oracle or root, you get no errors at all, is that right? - NullUserException

1 Answers

1
votes

I had the same problem and for me it was the access rights for some Oracle locale files. The problem was solved by making $ORACLE_HOME/nls/data and its content world-readable.

To find the problem, I wrote a small script test_oracle.py:

import cx_Oracle as oracle
conn = oracle.connect("user/pwd@host:port/SID")

and then ran truss python test_oracle.py to find the access problem (on Linux I'd had used strace instead, of course.)