使用client net trace分析问题一例.
接http://www.itpub.net/282912.html
F:>sqlplus system/manager@prod10g
SQL*Plus: Release 9.0.1.0.1 - Production on 星期五 10月 29 11:15:39 2004
(c) Copyright 2001 Oracle Corporation. All rights reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
system@RACA> exit
从Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options中
断开
F:>sqlplus system/manager@prod10g
SQL*Plus: Release 9.0.1.0.1 - Production on 星期五 10月 29 11:15:43 2004
(c) Copyright 2001 Oracle Corporation. All rights reserved.
ERROR:
ORA-12545: 因目标主机或对象不存在,连接失败
在客户端设置跟踪
TRACE_TIMESTAMP_CLIENT = TRUE
TRACE_DIRECTORY_CLIENT = f:traceprod10g
TRACE_LEVEL_CLIENT = 16
trace_unique_client=true
在跟踪文件中发现如下信息
…………………………………….…………………………………….
[01-11月-2004 14:10:08] nsprecv: 00 38 00 00 05 00 00 00 |.8......|
[01-11月-2004 14:10:08] nsprecv: 00 2E 28 41 44 44 52 45 |..(ADDRE|
[01-11月-2004 14:10:08] nsprecv: 53 53 3D 28 50 52 4F 54 |SS=(PROT|
[01-11月-2004 14:10:08] nsprecv: 4F 43 4F 4C 3D 54 43 50 |OCOL=TCP|
[01-11月-2004 14:10:08] nsprecv: 29 28 48 4F 53 54 3D 52 |)(HOST=R|
[01-11月-2004 14:10:08] nsprecv: 41 43 42 29 28 50 4F 52 |ACB)(POR|
[01-11月-2004 14:10:08] nsprecv: 54 3D 31 35 32 31 29 29 |T=1521))|
[01-11月-2004 14:10:08] nsprecv: normal exit
[01-11月-2004 14:10:08] nscon: got NSPTRD packet
[01-11月-2004 14:10:08] nscon: got 46 bytes connect data
[01-11月-2004 14:10:08] nscon: exit (0)
[01-11月-2004 14:10:08] nsdo: nsctxrnk=0
[01-11月-2004 14:10:08] nsdo: normal exit
[01-11月-2004 14:10:08] nscall: redirected
[01-11月-2004 14:10:08] nsclose: entry
[01-11月-2004 14:10:08] nstimarmed: entry
[01-11月-2004 14:10:08] nstimarmed: no timer allocated
[01-11月-2004 14:10:08] nstimarmed: normal exit
………………………………………………………………………………………..
[01-11月-2004 14:10:08] nttgetport: exit
[01-11月-2004 14:10:08] nttbnd2addr: looking up IP addr for host: RACB
[01-11月-2004 14:10:30] nttbnd2addr: *** hostname lookup failure! ***
[01-11月-2004 14:10:30] nttbnd2addr: exit
…………………………………………………………………………………………
初看最后面的错误信息是因为不能解析RACA,但为何有时候可以连接而有时候不能呢?
原因是出在[01-11月-2004 14:10:08] nscall: redirected上面。
nscall: redirected的解析如下:
nscall: redirected
The client has been redirected to a differenct address.
The next step should be to call the new address. The address
should appear in an earlier data packet.
我们先看看客户端的tnsname的配置:
test10g =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = )(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = )(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = )
(FAILOVER_MODE =
(TYPE = SELECT)
(METHOD = BASIC)
(RETRIES = 180)
(DELAY = 5)
)
)
)
RACB把客户端的连接redirect到了RACA,而客户端不能解析RACA因而出错(网络环境没有配置DNS)。
在进一步的实验中发现客户端不能连接到RACA上,客户端配置如下:
prod1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = )(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = )
)
)
出错信息:
SQL*Plus: Release 9.0.1.0.1 - Production on 星期一 11月 1 14:38:10 2004
(c) Copyright 2001 Oracle Corporation. All rights reserved.
ERROR:
ORA-12545: 因目标主机或对象不存在,连接失败
通过设置跟踪发现如下信息:
…………………………………………………………………………………………
[01-11月-2004 14:42:48] nsdo: nsctxrnk=0
[01-11月-2004 14:42:48] nsdo: normal exit
[01-11月-2004 14:42:48] nscall: redirected
[01-11月-2004 14:42:48] nsclose: entry
[01-11月-2004 14:42:48] nstimarmed: entry
[01-11月-2004 14:42:48] nstimarmed: no timer allocated
[01-11月-2004 14:42:48] nstimarmed: normal exit
…………………………………………………………………………………………
[01-11月-2004 14:42:48] nttgetport: exit
[01-11月-2004 14:42:48] nttbnd2addr: looking up IP addr for host: RACB
[01-11月-2004 14:42:50] nttbnd2addr: *** hostname lookup failure! ***
[01-11月-2004 14:42:50] nttbnd2addr: exit
…………………………………………………………………………………………
由于RACA正在import数据,RACA自作聪明的把客户端的连接load balance到RACB上!
在import操作结束后,再次进行连接的时候就成功了:
SQL*Plus: Release 9.0.1.0.1 - Production on 星期一 11月 1 15:01:31 2004
(c) Copyright 2001 Oracle Corporation. All rights reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
system@RACA>
Question:
为何在客户端没有配置负载均衡的情况下oracle仍然尝试redirect到其他node上呢?而且为何其他node不能连接的情况下不能redirect回原始节点呢?
又要啃文档了......
验证了温伯格牵强法则:有时候觉得牵强只是因为短视。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/6906/viewspace-21619/ ,如需转载,请注明出处,否则将追究法律责任。