0

I am trying to connect to 2 Oracle databases in a single Python script and am having some trouble connecting to the second database. The error I am receiving is:

"DatabaseError: ORA-01017: invalid username/password; logon denied"

My login information is correct so I am confused on why it is not allowing me to access the second database. Any insight would be appreciated.

Sample code below:

dsnStr = cx_Oracle.makedsn("database1", "port_for_db1", "sid_for_db1") 
conn = cx_Oracle.connect("myusername","password_db1",dsn=dsnStr)  

dsnStr2 = cx_Oracle.makedsn("database2", "port_for_db2", "sid_for_db2") 
conn2 = cx_Oracle.connect("myusername","password_db2",dsn=dsnStr)    

Thank you!

1
  • try to connect it other database applications, like dbeaver or Navicat Commented Aug 22, 2018 at 13:47

1 Answer 1

2

You made a mistake dsn=dsnStr

  dsnStr2 = cx_Oracle.makedsn("database2", "port_for_db2", "sid_for_db2") 
    conn2 = cx_Oracle.connect("myusername","password_db2",dsn=dsnStr2)   
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.