reduce tns look up time

Reviewer: A reader

Hi I just asked about meaning of connect_timeout... I wanted to ask somthing
more, in some servers when I try to connect such as

scott/tiger@test

if test is not defined in tnsnames.ora I get an error straight away however in
some servers it takes ages to tell me the error

which parameter defines that interval?


Followup:
look in your sqlnet.ora -- there is an entry like:

NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)


so, for me, if tnsnames.ora lookup fails (no test), it'll try Oracle names
server, if that fails, it'll try the default hostname (connect to a machine
named test on a known port and try to connect to a sid named test)

that could take a while, just reduce it to tnsnames and it would fail straight
away.

实例: 

我们可以看到, 在修改sqlnet.ora的tns lookup策略之后, 在look up不存在的service_name的时候, 速度有了很大的提高.

real 0m33.083s
user 0m0.010s
sys 0m0.000s

real 0m0.015s
user 0m0.010s
sys 0m0.000s



[oracle@TzdbDataAnal ]$ more product/9.2.4/network/admin/sqlnet.ora
NAMES.DIRECTORY_PATH= (TNSNAMES,ONAMES,HOSTNAME)
[oracle@TzdbDataAnal ]$ time tnsping tes

TNS Ping Utility for Linux: Version 9.2.0.4.0 - Production on 01-APR-2005 09:45:35

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

Used parameter files:
/oracle/product/9.2.4/network/admin/sqlnet.ora

TNS-03505: Failed to resolve name

real 0m33.083s
user 0m0.010s
sys 0m0.000s
[oracle@TzdbDataAnal ]$ echo "NAMES.DIRECTORY_PATH= (TNSNAMES)" >
-bash: syntax error near unexpected token `newline'
[oracle@TzdbDataAnal ]$ echo "NAMES.DIRECTORY_PATH= (TNSNAMES)" >
> product/9.2.4/network/admin/sqlnet.ora
[oracle@TzdbDataAnal ]$ more product/9.2.4/network/admin/sqlnet.ora
NAMES.DIRECTORY_PATH= (TNSNAMES)
[oracle@TzdbDataAnal ]$ time tnsping tes

TNS Ping Utility for Linux: Version 9.2.0.4.0 - Production on 01-APR-2005 09:48:03

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

Used parameter files:
/oracle/product/9.2.4/network/admin/sqlnet.ora

TNS-03505: Failed to resolve name

real 0m0.015s
user 0m0.010s
sys 0m0.000s
[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/94317/viewspace-794625/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/94317/viewspace-794625/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值