TNSPING 非常慢

环境:

redhat5   X64     11GR2_X64

无事安装了一个oracle,版本11.2.0.1.0。东西安装了很多回了,觉得不会出现任何事了,没想到还是有问题了。

使用

conn  / as sysdba 连接很快

conn hr/hr@tns 非常慢,要5分钟

查了很多资料,会有影响的地方有:

sqlnet.ora 参数(我的机器上没有这个文件)

listener.log过大(我的是新的,很小)

tnsping 很慢。 我试验了一下,本机tnsping慢的让人抓狂。多方查找资料,解决:资料如下,参考

http://blogs.oracle.com/longchun/2009/12/ebs_r121_for_linux.html

详细内容请看如下

故障现象:

- tnsping VIS 延时很长,不能忍受的地步

- 应用层面启动不成功

分析过程:

- 检查/etc/hosts, 把IP6的相关内容注释掉,因为根本没用到IP6

- ping localhost 很快

- ping hostname 很快,并且能够解析

- cd $ORACLE_HOME/nework/context_name/admin/tnsnames.ora,sqlnet.ora,lisenter.ora 文件检查,试图把hostname 换成IP,结果还是不理想

- telent hostname 1521 速度很快

- server 上sqlplus "/as sysdba"速度很快

- server sqlplus system/oracle@VIS速度很慢

%100 确定监听出了问题

- tracerouter hostname 就一跳 ,,应该没问题

- metlink上查找相关文件,怀疑有BUG存在..

- 找到类似的 What was changed between the two is the way Oracle resolves hostnames to IPs, more specifically the system call used to do that.

Oracle 11g use now getaddrinfo() while 10g used gethostbyname().

These system functions requires different configuration in /etc/nsswitch.conf.

gethostbyname() require the use of keyword "hosts" while getaddrinfo() the use the keyword "ipnodes"


This happens even if Name Server Switch configuration (nsswitch) specifies the hosts file prior to dns lookups:

/etc/nsswitch.conf
hosts: files [NOTFOUND=continue] dns
or only:
hosts: files 这样的DOC..

- 看来是因为Server 本身的DNS起作用了,DNS一起作用,hosts就有问题了

- /etc/resolv.conf

;generated by /usr/sbin/oraclevm-template
#search hostname

#options timeout:15
#options timeout:15
#nameserver hostname

全去掉,或者干脆把resolv.conf move 掉

- 最后把/etc/sysconfig/network中IP6相关的东西都去掉了


再测试,就OK了

我的是修改了/etc/resolv.conf后OK。 /etc/sysconfig/network我也做了文中提到的修改。

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

转载于:http://blog.itpub.net/12807983/viewspace-695003/

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值