TNSPING 非常慢

 

 

猜测:是不是网络通信问题?

           如果是网络通信异常,那么我去虚拟机上easyconnect一下,应该要正常才对,结果是跟windows客户端连接一样慢。

尝试重启监听也卡半天然后报错。

 

监听日志有这么一条WARNING: Subscription for node down event still pending异常记录

 

 

无奈的求助百度,谷歌。。。 

1.防火墙                  ---早都已经关闭了

2.修改/etc/hosts文件,把不用的注释掉               ---并没有什么用,虚拟机是新装的,里面也没有什么多余信息

3.尝试ping 主机                                                  ---非常快

4.listener.log日志过大(超过4G)                      ---刚刚安装的数据库,日志文件很小

5.查看v$session  看是不是有大量会话接入或者有没有定时job        ---然并没有,毕竟自己的虚拟机,也只有一台windows在连

6.重启监听                                                          --试过了,并没有用,就连查看状态都非常卡

。。。

看了好多帖子,发现都帮不到我

在最后发现一根救命稻草:服务器本身的DNS起作用了,DNS一起作用,hosts就有问题了

修改/etc/resolv.conf,里面内容都注释掉(你也可以把这个文件mv到别的地方做备份,直接把原来路径下的删掉)

再次测试

果然问题出在这里,再次用windows端工具去连,速度也是非常快了

使用

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我也做了文中提到的修改。

posted @ 2021-11-10 09:12  胡子&小猿  阅读(607)  评论(0编辑  收藏  举报