问题
I am able to connect to oracle DB using following commands in sqlplus
sqlplus user/pass@pdw1s_default
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
and tnsping works properly
tnsping pdw1s_default
I tried to connect to oracle using python and i tried below connection strings. But I am getting same error. Both Oracleclient and python is 32bit version.
Driver={Oracle in OraClient12Home1};dbq = pdw1s_default;Uid=user;Pwd=pass;
Driver={Oracle in OraClient12Home1};DBQ={(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host)(PORT=port)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=pdw1s_default)))};Uid=user;Pwd=pass;
Driver={Oracle in OraClient12Home1};Server={(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host)(PORT=port)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=pdw1s_default)))};Uid=user;Pwd=pass;
I also set TNS_ADMIN in the environment variables and TNS_HOME in the registry
. Can anyone please help me and provide the list of registry
values which I have to create.
Error:
pyodbc.Error: ('HY000', '[HY000] [Oracle][ODBC][Ora]ORA-12560: TNS:protocol adapter error\n (12560) (SQLDriverConnect);
来源:https://stackoverflow.com/questions/57405385/pyodbc-error-ora-12560-tnsprotocol-adapter-error-12560-sqldriverconnect-i