# ora 12170 TNS Connect timeout occured

**URL:** <https://forums.toadworld.com/t/ora-12170-tns-connect-timeout-occured/9633>\
**Category:** Toad for Oracle & DevOps Toolkit\
**Created:** [June 25, 2010, 10:08am UTC](https://forums.toadworld.com/t/ora-12170-tns-connect-timeout-occured/9633 "2010-06-25T10:08:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![TOADTECH](https://avatars.discourse-cdn.com/v4/letter/t/f14d63/32.png) [@TOADTECH](https://forums.toadworld.com/u/TOADTECH)\
**Post date:** [June 25, 2010, 10:08am UTC](https://forums.toadworld.com/t/ora-12170-tns-connect-timeout-occured/9633/1 "2010-06-25T10:08:56Z")

</div>

Hello  
I have a user that got a new pc, used a file and settings transfer to copy data and settings to the new pc.  
old pc XP  
Toad 8.6  
SQL server 2005  
oracle 9

new pc Vista ( no local admin rights to the pc for the user)  
Toad 9.6  
sql server 2005  
oracle 10g  
had to copy over the TNS names file so the sites show on the right hand window in toad

---

<div class="post-metadata">

**Author:** ![TOADTECH](https://avatars.discourse-cdn.com/v4/letter/t/f14d63/32.png) [@TOADTECH](https://forums.toadworld.com/u/TOADTECH)\
**Post date:** [June 25, 2010, 10:11am UTC](https://forums.toadworld.com/t/ora-12170-tns-connect-timeout-occured/9633/2 "2010-06-25T10:11:51Z")

</div>

did not see how to edit my post…  
forgot to mention toad was installed after the settings and data software was run. Did not see toad when I was seeing what apps they had on their old pc.

---

<div class="post-metadata">

**Author:** ![HillbillyToad](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/hillbillytoad/32/190_2.png) [@HillbillyToad](https://forums.toadworld.com/u/HillbillyToad)\
**Post date:** [June 25, 2010, 10:11am UTC](https://forums.toadworld.com/t/ora-12170-tns-connect-timeout-occured/9633/3 "2010-06-25T10:11:51Z")

</div>

Have you tested to see if the oracle installation is the weak link on your new  
Vista PC?

Can you tnsping your database from the command line? If you get the TNS Timeout  
there, it’s not Toad.

---

<div class="post-metadata">

**Author:** ![TOADTECH](https://avatars.discourse-cdn.com/v4/letter/t/f14d63/32.png) [@TOADTECH](https://forums.toadworld.com/u/TOADTECH)\
**Post date:** [June 28, 2010, 10:54pm UTC](https://forums.toadworld.com/t/ora-12170-tns-connect-timeout-occured/9633/4 "2010-06-28T22:54:30Z")

</div>

I know how to ping, I know I have to copy the tns names file over , not sure what for , I think it might have the database addresses ??? so how do I do a tns ping of the datbases.

---

<div class="post-metadata">

**Author:** ![NormTeamT](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/normteamt/32/53_2.png) [@NormTeamT](https://forums.toadworld.com/u/NormTeamT)\
**Post date:** [June 29, 2010, 2:14am UTC](https://forums.toadworld.com/t/ora-12170-tns-connect-timeout-occured/9633/5 "2010-06-29T02:14:51Z")

</div>

Morning William,

> > I know how to ping, I know I have to copy the tns names file  
> > over , not sure what for , I think it might have the  
> > database addresses ???  
> > There are many ways to get from user/password@database\_alias to  
> > host=server\_name, port=port\_number, sid (or service) = Database Sid, or  
> > service. Tnsnames.ora is probably the easiest and simplest of them all  
> > and it works with all versions of Oracle.

> > so how do I do a tns ping of the databases.  
> > Here's one from my session.

in a DOS box, or Shell on Unix:

C:\>tnsping perf10g

TNS Ping Utility for 32-bit Windows: Version 9.2.0.8.0 - Production on  
29-JUN-2010 08:02:58

Copyright (c) 1997, 2006, Oracle Corporation. All rights reserved.

Used parameter files:  
c:\oracle\ora9i\network\admin\sqlnet.ora

Used TNSNAMES adapter to resolve the alias  
Attempting to contact (DESCRIPTION = (SOURCE\_ROUTE = OFF) (ADDRESS\_LIST  
= (ADDRE  
SS = (PROTOCOL = TCP)(HOST = [greenbird.ea.gov](http://greenbird.ea.gov))(PORT = 1521)))  
(CONNECT\_DATA = (S  
ID = perf10g) (SRVR = DEDICATED)))  
OK (20 msec)

The last line says that it took 20 milliseconds to contact the listener  
and get the details back. All that this tells me is that:

- My name resolution system is set up correctly; and

- A listener is indeed listening on the host (server) and port that was  
returned from the name resolution; and

It doesn't tell me that the listener is actually listening for my  
particular database though.

What happens is the following:

- You type tnsping, or use Toad, SQLPlus, your application etc to  
connect to a database "alias".

- SQLNet (Oracle's networking system) looks in certain places to find  
sqlnet.ora (in %TNS\_ADMIN%, then in %ORACLE\_HOME%\network\admin).

- Sqlnet.ora tells SQLNet where to look, and in what order to resolve  
the alias name supplied: "NAMES.DIRECTORY\_PATH= (onames, tnsnames)" in  
my case.

- In my case, Oracle Names is checked first then TNSNAMES.ORA if Oracle  
Names fails. Tnsnames.ora is looked for in the same locations as  
sqlnet.ora above.

- Either way, the list is scanned until a hit on the database alias is  
found. The connection details are returned: (DESCRIPTION =  
(SOURCE\_ROUTE = OFF) (ADDRESS\_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST =  
[greenbird.ea.gov](http://greenbird.ea.gov))(PORT = 1521))) (CONNECT\_DATA = (SID = perf10g) (SRVR =  
DEDICATED))).

- These details are used to connect to the database in the event of a  
login.

- In the event of a tnsping, the details are used to contact a listener.  
If a listener is found, you get the OK message, otherwise not. However,  
as mentioned above, the listener is all that is checked, not the  
connectivity to the actual database itself. You can successfully tnsping  
a database alias and get an OK message, but connecting to it will give  
you a message that the listener isn't actually listening for that  
database! Confusing!

In my tnsping example above, the database I'm looking for is not in  
Oracle Names, so I see this prompt "Used TNSNAMES adapter to resolve the  
alias".

HTH

Cheers,  
Norm. [TeamT]

Information in this message may be confidential and may be legally privileged. If you have received this message by mistake, please notify the sender immediately, delete it and do not copy it to anyone else. We have checked this email and its attachments for viruses. But you should still check any attachment before opening it. We may have to make this message and any reply to it public if asked to under the Freedom of Information Act, Data Protection Act or for litigation. Email messages and attachments sent to or from any Environment Agency address may also be accessed by someone other than the sender or recipient, for business purposes. If we have sent you information and you wish to use it please read our terms and conditions which you can get by calling us on 08708 506 506. Find out more about the Environment Agency at [www.environment-agency.gov.uk](http://www.environment-agency.gov.uk)

Information in this message may be confidential and may be legally privileged. If you have received this message by mistake, please notify the sender immediately, delete it and do not copy it to anyone else.

We have checked this email and its attachments for viruses. But you should still check any attachment before opening it.  
We may have to make this message and any reply to it public if asked to under the Freedom of Information Act, Data Protection Act or for litigation. Email messages and attachments sent to or from any Environment Agency address may also be accessed by someone other than the sender or recipient, for business purposes.

If we have sent you information and you wish to use it please read our terms and conditions which you can get by calling us on 08708 506 506. Find out more about the Environment Agency at [www.environment-agency.gov.uk](http://www.environment-agency.gov.uk)

---

<div class="post-metadata">

**Author:** ![Mark\_Lerch](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/mark_lerch/32/33_2.png) [@Mark\_Lerch](https://forums.toadworld.com/u/Mark_Lerch)\
**Post date:** [July 6, 2010, 4:00pm UTC](https://forums.toadworld.com/t/ora-12170-tns-connect-timeout-occured/9633/6 "2010-07-06T16:00:04Z")

</div>

command prompt optional, because as with so many other things with Toad, “It’s  
in there”  
 ![image001.png](https://global.discourse-cdn.com/quest/original/2X/0/0dc195db46bddd77f253b6a4b208c5be74e161a5.png)

---

<div class="post-metadata">

**Author:** ![rjndra](https://avatars.discourse-cdn.com/v4/letter/r/8491ac/32.png) [@rjndra](https://forums.toadworld.com/u/rjndra)\
**Post date:** [January 19, 2016, 3:05am UTC](https://forums.toadworld.com/t/ora-12170-tns-connect-timeout-occured/9633/7 "2016-01-19T03:05:25Z")

</div>

Disable Antivirus and try. If connecting add it to Antivirus accepting list.
