last day (15 days later) » 

9:33 PM
0
Q: ORA-12541 TNS :no listener on 1 specific remote database, but not on others

krazyito65Some context: I'm setting up an environment to run some Ruby code our Lead wrote to connect to some remote Databases. I'm using Win10 and have WSL installed. I have installed SQL*Plus, docker, and Ruby, and am sure I have installed all the dependent gems (actually at this point I know for a fac...

 
I think you get the no listener error if you can't connect to a listener on the port and host that you reference, port 999 and host1 in your example. You could try using ping to see if you can connect to host1.
 
But wouldn't that cause other people as well to fail? I've had several other people successful connect to the database via SQL Developer.
Ping works fine: >$ ping host1 PING host1.tech.company (ip.address) 56(84) bytes of data. 64 bytes from host1.tech.company (ip.address): icmp_seq=1 ttl=57 time=27.7 ms 64 bytes from host1.tech.company (ip.address): icmp_seq=2 ttl=57 time=25.9 ms 64 bytes from host1.tech.company (ip.address): icmp_seq=3 ttl=57 time=26.7 ms 64 bytes from host1.tech.company (ip.address): icmp_seq=4 ttl=57 time=26.0 ms ^C --- host1.tech.company ping statistics --- 27 packets transmitted, 27 received, 0% packet loss, time 26018ms
 
Could a firewall be blocking port 999 but letting the ping through?
 
But its working with other people? The only thing in that regard I could think of is the VPN i am connecting through, though there are others using the same set up as me with the VPN and they can connect just fine. The hosts are different, but they are set up by the same set of DBA admins, so all their infrastructure should be the same, regardless of the ports, so it does not explain why I can connect to 1 DB but not the other. I have a strong feeling it is probably something to do with my local config, I just don't know what it is.
 
I bet it is your tnsnames.ora and/or sqlnet.ora file. Try this command: sqlplus user/password@"(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hos‌​t1)(PORT=999))(CON‌​NE‌​CT_DATA=(SID=W-WORK-‌​DB.tech.company)))"
 
9:33 PM
More context for that: I tried without having any of those files: i get the result i posted above. I got a tnsnames.ora file from the internal network on a working machine, same result. Its only when I add a sqlnet.ora file from the internal network where it fails for every DB: ERROR: ORA-12154: TNS:could not resolve the connect identifier specified
 
Here are some possible values for those two files: tnsnames.ora HOST1.WORLD = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(Host = HOST1)(Port = 999)) ) (CONNECT_DATA = (SID = W-WORK-DB.tech.company) ) ) sqlnet.ora names.default_domain = world name.default_zone = world
The sqlnet.ora defines the domain. The tnsnames.ora has an entry that relates a name to the host, port, and sid.
 
tnsnames defines SERVICE_NAME instead of SID, but I think that should be fine.. This file seems to have TNS definitions for the whole company. ---- sqlnet.ora has: NAMES.DIRECTORY_PATH= (LDAP,TNSNAMES); NAMES.DEFAULT_DOMAIN = tech.company
ERROR: ORA-12154: TNS:could not resolve the connect identifier specified --- when i use the sqlnet.ora for all connections.
 
I would take LDAP out of your sqlnet.ora and try it with your tnsnames.ora file.
 
Same error. ORA-12154: TNS:could not resolve the connect identifier specified
 
The 12154 error means it can't find the name in the file. You should be able to do sqlplus user/password@host1 if host1.tech.company is in the tnsnames.ora file. It would have an entry like host1.tech.company = followed by stuff in parentheses.
 
9:33 PM
What is the format for more than 1 entry? I can for sure see the entry in the tnsnames.ora file, its just surrounded by MANY other entires as well (its on line 400) --- W-WORK-DB.tech.company =(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = host72-vip)(PORT = 1601)) (ADDRESS = (PROTOCOL = TCP)(HOST = host73-vip)(PORT = 1601)) (LOAD_BALANCE = yes)(FAIL OVER = ON) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = W-WORK-DB.tech.company) (failover_mode = (type = select)(method = basic)(retries = 180)(delay = 5)))) (host72 / 73 are me just removing the hostname)
 
Should be able to connect as user/password@W-WORK-DB if tech.company is the domain in the sqlnet.ora.
 
Right, I should. But currently, with the sqlnet.ora file in place, I get: ORA-12154: TNS:could not resolve the connect identifier specified for anything I attempt to connect to. When I remove that file, I get ORA-12541 TNS :no listener on the database I actually care about, but am able to connect to other databases.
 
I guess I would create a tnsnames.ora file with just the problem database in it and no sqlnet.ora.
 
I can try that.
 
You could also try just one vip at a time without all the load balancing and failover stuff. W-WORK-DB.tech.company =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(Host = host72-vip)(Port = 1601))
)
(CONNECT_DATA = (SERVICE_NAME = W-WORK-DB.tech.company))
)
 
9:46 PM
sqlplus user/password@W-WORK-DB.tech.company
 
How do you connect to it with sqlplus?
Maybe it is trying the wrong vip and not handling the load balancing/failover right.
 
sqlplus user/password@W-WORK-DB.tech.company
 
also
 
should work if the tnsnames.ora entry is right.
 
9:48 PM
sqlplus user/password@host72-vip:1601/W-WORK-DB.tech.company
im about to just give you the real values
one sec
let me try with the single vip
 
I think you should.
 
WINFR1ED.swacorp.com = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(Host = xldodb72-vip)(Port = 1601)) ) (CONNECT_DATA = (SERVICE_NAME = WINFR1ED.swacorp.com)))

#WINFR1ED.swacorp.com =(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = xldodb72-vip)(PORT = 1601)) (ADDRESS = (PROTOCOL = TCP)(HOST = xldodb73-vip)(PORT = 1601)) (LOAD_BALANCE = yes)(FAI LOVER = ON) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = WINFR1ED.swacorp.com) (failover_mode = (type = select)(method = basic)(retries = 180)(delay = 5))))
thats the tns:no listner one
still getting that now
with both commands
 
Did you try xldodb73-vip also? With just it in the tnsnames.ora entry?
 
just did, same thing no listener with the short, long, and with the 73 in the long sqlplus commands
$ sqlplus itest_user/itest_password@xldodb-virt-21-scan:1550/CSSFOEI.swacorp.com

this one works
but its not the db i need
 
You can ping 72 and 73 and other people can connect using the original tnsnames.ora file?
 
9:56 PM
So, everyone else is using SQL developer to connect
and Sql Developer doens't work for me either.
I'm only using SQL plus becasue the Ruby script im going to be working on was using it
 
Do they people who work use a tnsnames.ora file?
 
I don't think so.
$ ping xldodb73-vip
PING xldodb73-vip.swacorp.com (10.33.10.80) 56(84) bytes of data.
64 bytes from xldodb73-vip.swacorp.com (10.33.10.80): icmp_seq=1 ttl=57 time=35.5 ms
64 bytes from xldodb73-vip.swacorp.com (10.33.10.80): icmp_seq=2 ttl=57 time=28.1 ms
64 bytes from xldodb73-vip.swacorp.com (10.33.10.80): icmp_seq=3 ttl=57 time=26.4 ms
^C
--- xldodb73-vip.swacorp.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2001ms
pings work
I even tried using a listener.ora file
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = SY4-BZW9YV1.LUV.AD.SWACORP.com)(PORT = 1521))
)
)
 
listener.ora goes on the database server.
 
ok
I wonder if that is something I can talk to my DBA about
 
If other people can login then the listener.ora is ok on the database server.
 
10:03 PM
I could try using the sqlnet.ora and tnsnames.ora file on the DB host
 
It's up to you. I'm not sure what more I can say. Seems to me that either port 1601 is blocked by a firewall or the other people are using different connection information like host, port, and service name.
 
jdbc:oracle:thin:@ldap://vdlbldap05a:389/winfr1ed,cn=OracleContext -- this is the connection string we use
so the sqlnet.ora file from the host DB seems valid
im able to get the same results from having it and not having it..
but im still getting no listener =/
im just confused why this is only happening on my machine for that one service
im wondering if theres another tnsnames file somewhere
but my TND_ADMIN environment varialbe is pointing to the right location
TNS*
Thanks for your help anyway.. IF you get any more ideas, feel free to msg me or e-mail me (krazyito65@gmail.com)
 
Ok. Seems like there may be complexities to your environment that the people there would have to help you with.
 
(Also, the other people that connect, I gave them all the information for how to connect so they should have the same as I do in that regard, other than my environment)
Eh.. I probably did something myself.. This is basically all my doing I would think, since I just got onto a new team, with the same laptop, and I was just trying to get the base script to run before i start working on it some more.
Thinking I may need to have some kind of clean start somewhere.
and try again
 

last day (15 days later) »