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...
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.
Related
I am trying to configure a database in Oracle SQL Developer, database is Oracle 21c. Upon initial troubleshooting it seems to be an issue with the listeners. Below are some more details that will help for troubleshooting.
When I try to check status of listener in cmd (admin mode), I get below error:
C:\Windows\System32>lsnrctl status
LSNRCTL for 64-bit Windows: Version 21.0.0.0.0 - Production on 18-NOV-2022 20:24:49
Copyright (c) 1991, 2021, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.207)(PORT=1521)))
TNS-12535: TNS:operation timed out
TNS-12560: TNS:protocol adapter error
TNS-00505: Operation timed out
64-bit Windows Error: 60: Unknown error
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
64-bit Windows Error: 2: No such file or directory
and when I try to start listener, I get below error :
C:\Windows\System32>lsnrctl start
LSNRCTL for 64-bit Windows: Version 21.0.0.0.0 - Production on 18-NOV-2022 20:26:01
Copyright (c) 1991, 2021, Oracle. All rights reserved.
Starting tnslsnr: please wait...
TNSLSNR for 64-bit Windows: Version 21.0.0.0.0 - Production
System parameter file is C:\app\patil\product\21c\homes\OraDB21Home1\network\admin\listener.ora
Log messages written to C:\app\patil\product\21c\diag\tnslsnr\Nisarg\listener\alert\log.xml
Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.207)(PORT=1521)))
TNS-12545: Connect failed because target host or object does not exist
TNS-12560: TNS:protocol adapter error
TNS-00515: Connect failed because target host or object does not exist
64-bit Windows Error: 49: Unknown error
Listener failed to start. See the error message(s) above...
Below is the error we get when we try to connect from Oracle SQL Developer :
There is no problem with the service, screenshot below :
Below thing also helps to confirm that there is no issue with the DB :
Microsoft Windows [Version 10.0.22621.819]
(c) Microsoft Corporation. All rights reserved.
C:\Users\patil>sqlplus / as sysdba
SQL*Plus: Release 21.0.0.0.0 - Production on Fri Nov 18 20:37:34 2022
Version 21.3.0.0.0
Copyright (c) 1982, 2021, Oracle. All rights reserved.
Connected to:
Oracle Database 21c Express Edition Release 21.0.0.0.0 - Production
Version 21.3.0.0.0
SQL> select name, open_mode from v$pdbs;
NAME
--------------------------------------------------------------------------------
OPEN_MODE
----------
PDB$SEED
READ ONLY
XEPDB1
READ WRITE
SQL>
I have a Oracle 19c database installed in windows10 and also I have WSL2 enabled in same laptop.
I would like to access the database from my WSL2- ubuntu distro. is it possible?
I have installed instantclient and sqlplus package in wsl2 but when I try to connect using sqlplus it couldn't able to connect to the windows database.
can someone please help me to connect to that database from WSL2?
sqlplus hr/hr#//172.22.100.119/orcl
SQL*Plus: Release 21.0.0.0.0 - Production on Fri Jul 1 15:52:02 2022
Version 21.6.0.0.0
Copyright (c) 1982, 2022, Oracle. All rights reserved.
ERROR:
ORA-12170: TNS:Connect timeout occurred
Enter user-name:
sqlplus
SQL*Plus: Release 21.0.0.0.0 - Production on Fri Jul 1 15:50:31 2022
Version 21.6.0.0.0
Copyright (c) 1982, 2022, Oracle. All rights reserved.
Enter user-name: spdorcl#orcl
Enter password:
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
Enter user-name:
sqlplus
SQL*Plus: Release 21.0.0.0.0 - Production on Fri Jul 1 15:48:54 2022
Version 21.6.0.0.0
Copyright (c) 1982, 2022, Oracle. All rights reserved.
Enter user-name: SYSTEM
Enter password:
ERROR:
ORA-12162: TNS:net service name is incorrectly specified
Enter user-name: sys
Enter password:
ERROR:
ORA-12162: TNS:net service name is incorrectly specified
Connecting successfully using SQL Developer but when i use sqlplus in Oracle Instant Client then i get following issues
Method 1:
[integrator#a-esb-app01 instantclient_19_8]$ ./sqlplus EGOINT#139.138.267.202:1521:EPROD
SQL*Plus: Release 19.0.0.0.0 - Production on Tue Dec 22 18:14:36 2020
Version 19.8.0.0.0
Copyright (c) 1982, 2020, Oracle. All rights reserved.
Enter password:
ERROR:
ORA-12545: Connect failed because target host or object does not exist
Enter user-name: egoint
Enter password:
ERROR:
ORA-12162: TNS:net service name is incorrectly specified
Method 2:
[integrator#a-esb-app01 instantclient_19_8]$ ./sqlplus EGOINT#139.138.267.202:1521/EPROD
SQL*Plus: Release 19.0.0.0.0 - Production on Tue Dec 22 18:18:13 2020
Version 19.8.0.0.0
Copyright (c) 1982, 2020, Oracle. All rights reserved.
Enter password:
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
Not Sure which of above is correct method and what is issue with connection string or any changes required on server side?
Note: I am able to connect another Oracle Server successfully. So no issue with InstantClient
Fixed using following:
./sqlplus egoint/egoint#(description=(address=(protocol=tcp)(host=139.138.267.202)(port=1521))(connect_data=(sid=EPROD)))
I keep on getting this error . I have corrected ora.listner file as mentioned in other answer of similar problem in stack overflow and I was able to login too but problem start again when I open my window 10 again today.error
listner.ora
Result of lsnrctl status
open listner.ora file without editing and saved it and restart i am able to connect now. Every time i have to do this to connect
Most likely the Oracle service hasn't started. Open up powershell and check it with
get-service OracleService*
If it says it's stopped then you can do
get-service OracleService* | start-service
If it has started then your oracle_sid environment variable hasn't been set or your oracle_home isn't correct.
Unfortnately, I cannot see where you showed the actual sqlplus command, just a screen shot that picks up after sqlplus gets control. But I find the near 100% of the time I see this error, it is because sqlplus is started without specifying a connect descriptor. Doing so means you are asking for a local connection, so the listener, nor any other TNS component is not involved at all. Instead, sqlplus tries to make a local (in memory) connection to the running instance that is specified by the environment variable ORACLE_SID:
TNS Connection:
G:\scripts>sqlplus scott/tiger#edstest
SQL*Plus: Release 12.1.0.2.0 Production on Tue Oct 27 15:46:01 2020
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Last Successful login time: Tue Oct 27 2020 15:45:42 -05:00
Connected to:
Oracle Database 12c Standard Edition Release 12.1.0.2.0 - 64bit Production
SQL>
local connection, check ORACLE_SID first
G:\scripts>echo %ORACLE_SID%
edstest
G:\scripts>sqlplus scott/tiger
SQL*Plus: Release 12.1.0.2.0 Production on Tue Oct 27 15:47:32 2020
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Last Successful login time: Tue Oct 27 2020 15:46:01 -05:00
Connected to:
Oracle Database 12c Standard Edition Release 12.1.0.2.0 - 64bit Production
SQL>
Local connection with ORACLE_SID not set, or improperly set:
G:\scripts>set ORACLE_SID=FUBAR
G:\scripts>echo %ORACLE_SID%
FUBAR
G:\scripts>sqlplus scott/tiger
SQL*Plus: Release 12.1.0.2.0 Production on Tue Oct 27 15:48:57 2020
Copyright (c) 1982, 2019, Oracle. All rights reserved.
ERROR:
ORA-12560: TNS:protocol adapter error
Enter user-name: ^C
G:\scripts>set ORACLE_SID=
G:\scripts>echo %ORACLE_SID%
%ORACLE_SID%
G:\scripts>sqlplus scott/tiger
SQL*Plus: Release 12.1.0.2.0 Production on Tue Oct 27 15:49:59 2020
Copyright (c) 1982, 2019, Oracle. All rights reserved.
ERROR:
ORA-12560: TNS:protocol adapter error
Enter user-name:
And there's your error.
I am trying to connect to Oracle using SQL*Plus from Oracle instant client 12.2 but it keeps failing.
# export LD_LIBRARY_PATH=/root/oracle/instantclient_12_2
# ./sqlplus USERNAME/PASSWORD#remotehost.ancd.com:1881/TEST1.ancd.com
SQL*Plus: Release 12.2.0.1.0 Production on Fri Jan 19 19:04:03 2018
Copyright (c) 1982, 2016, Oracle. All rights reserved.
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
I am not an Oracle expert but my understanding is I don't need a tnsnames.ora in Oracle client 12 for direct connection.
What I am going wrong?