I am trying to connect to Oracle 12c through cx_Oracle module. Login using following code works where no mode is mentioned in cx_Oracle.connect method
import cx_Oracle
ip = 'ip'
port='1521'
SID='orcl'
dsn_tns = cx_Oracle.makedsn(ip, port, SID)
db = cx_Oracle.connect('system', 'password', dsn_tns)
but for following way it shows invalid login error for cx_Oracle.SYSDBA mode.
db = cx_Oracle.connect('system', 'password', dsn_tns, cx_Oracle.SYSDBA)
Error:
cx_Oracle.DatabaseError: ORA-01017: invalid username/password; logon denied
What am I missing here ?? credentials are same. I tried login manually as follows and is successful
>sqlplus system/password as sysdba