samuraiY
samuraiY

Reputation: 35

TNS:Protocol Adapter Error

I am attempting to connect to an Oracle 11.2.0.2 64 bit database from a Win 7 and Win 8.1 machine with the Oracle 11.2.0.4 32 bit client. I can successfully ping the server and TNSPing the listener on both machines. But when I try to log into SQLPLus using system and my password I receive ORA-12560 TNS:Protocol Adapter Error. I can log into SQLPlus on the server. Any ideas? DB has been restarted as well as the listener. ORACLE_SID is set. I'm stuck...

Upvotes: 1

Views: 2710

Answers (1)

Alex Poole
Alex Poole

Reputation: 191235

If I'm following what you're seeing, it sounds like you just want to set the LOCAL enviroment variable on your Windows boxes to the TNS alias; then you don't have to supply that as you try to connect.

This is with the 12c instant client but the effect is the same with the 11g client. Specifying an alias as the connect strings works (the ORA-01017 is still coming from the DB):

c:\Program Files\instantclient_12_1>sqlplus -l x/y@abcd

SQL*Plus: Release 12.1.0.2.0 Production on Mon Feb 23 17:12:34 2015

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

ERROR:
ORA-01017: invalid username/password; logon denied

Connecting without the alias gets your ORA-12560:

c:\Program Files\instantclient_12_1>sqlplus -l x/y

SQL*Plus: Release 12.1.0.2.0 Production on Mon Feb 23 17:11:58 2015

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

ERROR:
ORA-12560: TNS:protocol adapter error

But if I set LOCAL then I can connect as if I had specified the alias:

c:\Program Files\instantclient_12_1>set LOCAL=abcd

c:\Program Files\instantclient_12_1>sqlplus -l x/y

SQL*Plus: Release 12.1.0.2.0 Production on Mon Feb 23 17:14:23 2015

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

ERROR:
ORA-01017: invalid username/password; logon denied

You don't need to have ORACLE_SID set as that is only used for bequeath connections where the client and server are on the same box.

Upvotes: 1

Related Questions