Client fails to connect to new DB server with "TNS-03505: Failed to resolve name" [message #679793] |
Sat, 28 March 2020 10:41 |
Andrey_R
Messages: 441 Registered: January 2012 Location: Israel
|
Senior Member |
|
|
Hi all,
After installing the database 12c on OEL 7.7 ( described in this thread ==> http://www.orafaq.com/forum/t/206586/ ),
I cannot connect to it from a client that is in the same domain.
I can see the listener listening on port 1521 on the db server, service name is MYDB :
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 28-MAR-2020 19:06:49
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date 28-MAR-2020 18:45:17
Uptime 0 days 0 hr. 21 min. 31 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/12.1.0.2/dbhome/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/MY_ORCALE_MACHINE/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.1.140.70)(PORT=1521)))
Services Summary...
Service "MYDB" has 1 instance(s).
Instance "MYDB", status READY, has 1 handler(s) for this service...
Service "MYDBXDB" has 1 instance(s).
Instance "MYDB", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@MY_ORACLE_MACHINE admin]$
My client is a Windows Server 2012 machine.
I installed Oracle 12c client on it.
Then configured tnsnames.ora like this:
MYDB =
(description =
(address = (protocol = tcp)(host = 10.1.140.70)(port = 1521))
(connect_data = (service_name = MYDB))
)
I can successfully connect to port 1521 with TELNET ( it is entering the telnet interface when I press enter, which is an indication of successful connection ) :
C:\Users\user1>telnet 10.1.140.70 1521
However, when I try to tnsping or connect with sqlplus , I get the following error:
C:\Users\user1>
C:\Users\user1>tnsping MYDB
TNS Ping Utility for 32-bit Windows: Version 12.1.0.2.0 - Production on 28-MAR-2020 17:34:49
Copyright (c) 1997, 2014, Oracle. All rights reserved.
Used parameter files:
D:\oracle\app\oracle\product\12.1.0\client_1\network\admin\sqlnet.ora
TNS-03505: Failed to resolve name
C:\Users\user1>
I have checked that the service name is MYDB in v$services, or the Linux OS of MYDB.
What can be the issue with connectivity between client and server ?
What else should I check ?
Many thanks in advance,
Andrey
[Updated on: Sat, 28 March 2020 10:42] Report message to a moderator
|
|
|
|
|
Re: Client fails to connect to new DB server with "TNS-03505: Failed to resolve name" [message #679796 is a reply to message #679794] |
Sat, 28 March 2020 11:33 |
Andrey_R
Messages: 441 Registered: January 2012 Location: Israel
|
Senior Member |
|
|
BlackSwan wrote on Sat, 28 March 2020 19:08>I cannot connect to it from a client that is in the same domain.
Please SHOW us using COPY & PASTE what actually happens when you try to connect from a client that is in the same domain
Here:
C:\Users\user1>sqlplus system/Newproj2020@MYDB
SQL*Plus: Release 12.1.0.2.0 Production on Sat Mar 28 18:28:35 2020
Copyright (c) 1982, 2014, Oracle. All rights reserved.
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
Enter user-name:
ERROR:
ORA-12560: TNS:protocol adapter error
Enter user-name:
ERROR:
ORA-12560: TNS:protocol adapter error
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
C:\Users\user1>
C:\Users\user1>
C:\Users\user1>
C:\Users\user1>whoami
my-domain\user1
C:\Users\user1>
|
|
|
|
Re: Client fails to connect to new DB server with "TNS-03505: Failed to resolve name" [message #679798 is a reply to message #679795] |
Sat, 28 March 2020 11:43 |
Andrey_R
Messages: 441 Registered: January 2012 Location: Israel
|
Senior Member |
|
|
John Watson wrote on Sat, 28 March 2020 19:32What if you try this:sqlplus username/password@10.1.140.70:1521/mydb
This worked.
But I don't understand why the result was different with using TNSNAMES entry as mentioned above...
I thought that it had to do with authentication method from SQLNET.ORA but it seems fine:
# sqlnet.ora Network Configuration File: D:\oracle\app\oracle\product\12.1.0\client_1\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.
# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file wont exist and without the native
# authentication, they will not be able to connect to the database on NT.
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
|
|
|
|
Re: Client fails to connect to new DB server with "TNS-03505: Failed to resolve name" [message #679800 is a reply to message #679793] |
Sat, 28 March 2020 11:56 |
|
BlackSwan
Messages: 26766 Registered: January 2009 Location: SoCal
|
Senior Member |
|
|
Andrey_R wrote on Sat, 28 March 2020 08:41Hi all,
After installing the database 12c on OEL 7.7 ( described in this thread ==> http://www.orafaq.com/forum/t/206586/ ),
I cannot connect to it from a client that is in the same domain.
I can see the listener listening on port 1521 on the db server, service name is MYDB :
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 28-MAR-2020 19:06:49
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date 28-MAR-2020 18:45:17
Uptime 0 days 0 hr. 21 min. 31 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/12.1.0.2/dbhome/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/MY_ORCALE_MACHINE/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.1.140.70)(PORT=1521)))
Services Summary...
Service "MYDB" has 1 instance(s).
Instance "MYDB", status READY, has 1 handler(s) for this service...
Service "MYDBXDB" has 1 instance(s).
Instance "MYDB", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@MY_ORACLE_MACHINE admin]$
My client is a Windows Server 2012 machine.
I installed Oracle 12c client on it.
Then configured tnsnames.ora like this:
MYDB =
(description =
(address = (protocol = tcp)(host = 10.1.140.70)(port = 1521))
(connect_data = (service_name = MYDB))
)
TNSNAMES.ORA above looks different from sample below; some () appear to be lacking
<addressname> =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(Host = <hostname>)(Port = <port>))
)
(CONNECT_DATA =
(SERVICE_NAME = <service_name>)
)
)
[Updated on: Sat, 28 March 2020 11:57] Report message to a moderator
|
|
|
Re: Client fails to connect to new DB server with "TNS-03505: Failed to resolve name" [message #679801 is a reply to message #679799] |
Sat, 28 March 2020 11:58 |
Andrey_R
Messages: 441 Registered: January 2012 Location: Israel
|
Senior Member |
|
|
John Watson wrote on Sat, 28 March 2020 19:53What is your D:\oracle\app\oracle\product\12.1.0\client_1\network\admin\tnsnames.ora file?
My D:\oracle\app\oracle\product\12.1.0\client_1\network\admin\tnsnames.ora file was actually D:\oracle\app\oracle\product\12.1.0\client_1\network\admin\tnsnames.ora.txt
As a default, extension is not shown, and as I named tnsnames.ora file, I didn't pay attention that I initially created it as a text file, but I did not remove the .txt suffix,
As at that time it wasn't visible to me..
So - problem was indeed in tnsnames.ora file..
After removing the bad suffix - it works fine..
Many thanks to you and BlackSwan for your time and efforts.
Best Regards,
Andrey
[Updated on: Sat, 28 March 2020 11:59] Report message to a moderator
|
|
|
|
|
|
|