简体   繁体   中英

Connect Oracle12c using python(Error while trying to retrieve text for error ORA-01804)

I have tried to connect oracle12c database using python, below are the steps which I performed:

  1. Installed cx_Oracle on anaconda prompt.

    pip install cx_Oracle

  2. below is the code which I wrote in python script.

     import cx_Oracle dsnStr = cx_Oracle.makedsn("192.168.1.92", "1521", "orcl") con = cx_Oracle.connect(user="xxxxx", password="xxxxx", dsn=dsnStr)``` 

after running above commands in Spyder, I am getting below error:

DatabaseError: Error while trying to retrieve text for error ORA-01804

Oracle and PostgreSQL, both are installed on Windows 10 Machine.

Any help would be appreciated.

There are several causes for the ORA-01804 error:

  • Check to make sure the following paths are set correctly in your environment:

LD_LIBRARY_PATH ORACLE_HOME NLS_LANG

  • Your oracle client may be missing some timezone dat files in the $ORACLE_HOME directory. You should have a separate ORACLE_HOME for each release of Oracle.

  • Check that the permissions are set to allow reads (chmod 444) for the files in the OCCI library.

Source

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM