oci/otlv4的OCIStmtFetch函数获取oracle表数据失败,pstack卡在read,抓包看到客户端zerowindowprobeack

jimyokl 2017-08-06 03:09:32
内存数据库应用从oracle数据库加载一张表的数据,几百万条,2服务器在同网段时能成功加载

跨网段时(一个IP221.12.1.254,一个124.160.12.234)出现无法加载表数据到内存,抓包看到出现zerowindow问题,内存数据库服务器滑动窗口为0,无法接收传过来的数据,之后传输终止
pstack信息:

#0 0x00000035c520e56d in read () from /lib64/ libpthread.so
#1 0x00002b99efa3f36f in snttread () from /data/ora11c/oracle/lib/ libclntsh.so
#2 0x00002b99efa37540 in nttfprd () from /data/ora11c/oracle/lib/ libclntsh.so
#3 0x00002b99ef8edeb4 in nsbasic_brc () from /data/ora11c/oracle/lib/ libclntsh.so
#4 0x00002b99ef8f0bfb in nsbrecv () from /data/ora11c/oracle/lib/ libclntsh.so
#5 0x00002b99ef7ababe in nioqrc () from /data/ora11c/oracle/lib/ libclntsh.so
#6 0x00002b99f04d9fc6 in ttcdrv () from /data/ora11c/oracle/lib/ libclntsh.so
#7 0x00002b99ef7daf72 in nioqwa () from /data/ora11c/oracle/lib/ libclntsh.so
#8 0x00002b99f04a7e0e in upirtrc () from /data/ora11c/oracle/lib/ libclntsh.so
#9 0x00002b99f04b578e in kpurcsc () from /data/ora11c/oracle/lib/ libclntsh.so
#10 0x00002b99f04b2c2f in kpufch0 () from /data/ora11c/oracle/lib/ libclntsh.so
#11 0x00002b99f04b127c in kpufch () from /data/ora11c/oracle/lib/ libclntsh.so
#12 0x00002b99f04a8ac2 in OCIStmtFetch () from /data/ora11c/oracle/lib/ libclntsh.so
#13 0x0000000000417047 in otl_tmpl_select_stream<otl_exc, otl_conn, otl_cur, otl_var, otl_sel, otl_datetime>::otl_tmpl_select_stream(otl_select_struct_override*, int, char const*, otl_tmpl_connect<otl_exc, otl_conn, otl_cur>&, int, char const*) ()
#14 0x0000000000417d8a in otl_stream::open(int, char const*, otl_connect&, char const*, char const*) ()
#15 0x000000000042204b in otl_stream::otl_stream(int, char const*, otl_connect&, char const*, char const*) ()
#16 0x000000000041c48c in CGlobalMgr::initMDBFromOraDB(CStartInfo&) ()
#17 0x000000000041dec3 in CGlobalMgr::init() ()
#18 0x0000000000434458 in main ()

WireShark抓包信息:5次0窗口确认后和oracle数据库断开连接


先谢谢各位帮忙,很奇怪为什么在同网段可以,但跨网段就出错,而且看情况是从oracle数据库传过来的数据在缓冲区没取走?
...全文
552 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
赵4老师 2017-08-07
  • 打赏
  • 举报
回复
建议先把 demo\*.* 下面的例子代码 Program Name Features Illustrated cdemo81.c Using basic SQL processing with release 8 and later functionality. cdemo82.c Performing basic processing of user-defined objects. cdemocor.c Using complex object retrieval (COR) to improve performance. cdemodr1.c,cdemodr2.c,cdemodr3.c Using INSERT/UPDATE/DELETE statements with RETURNING clause used with basic datatypes, LOBs and REFs. cdemodsa.c Describing information about a table. cdemodsc.c Describing information about an object type. cdemofo.c Registering and operating application failover callbacks. cdemolb.c Create and insert LOB data and then read, write, copy, append and trim the data. cdemolb2.c Writing and reading of CLOB/BLOB columns with stream mode and callback functions. cdemolbs.c Writing and reading to LOBs with the LOB buffering system. cdemobj.c Pinning and navigation of REF object. cdemorid.c Using INSERT, UPDATE, DELETE statements and fetches to get multiple rowids in one round-trip. cdemoses.c Using session switching and migration. cdemothr.c Using the OCIThread package. cdemosyev.c Registering predefined subscriptions and specifying a callback function to be invoked for client notifications (for more information about Advanced Queuing, see Oracle Streams Advanced Queuing User’s Guide and Reference). ociaqdemo00.c,ociaqdemo01.c,ociaqdemo02.c Advanced queuing. cdemodp.c,cdemodp_lip.c Loading data with the direct path load functions. cdemdpco.c Loading a column object with the direct path load functions. cdemdpno.c Loading a nested column object with the direct path load functions. cdemdpin.c Loading derived type (inheritance) - direct path. cdemdpit.c Loading an object table with inheritance - direct path. cdemdpro.c Loading a reference with the direct path load functions. cdemdpss.c Loading SQL strings with the direct path load functions. cdemoucb.c,cdemoucbl.c Using static and dynamic user callbacks. cdemoupk.c,cdemoup1.c,cdemoup2.c Using dynamic user callbacks with multiple packages. cdemodt.c Datetime and interval example. cdemosc.c Scrollable cursor. cdemol2l.c Accesses LOBs using the LONG API. cdemoin1.c Inheritance demo which modifies an inherited type in a table and displays a record from the table. cdemoin2.c Inheritance demo to do attribute substitutability. cdemoin3.c Inheritance demo that describes an object, inherited types, object tables, and a sub-table. cdemoanydata1.c Anydata demo. Inserts and selects rows to and from anydata table. cdemoanydata2.c Anydata demo. Creates a type piecewise using OCITypeBeginCreate() and then describes the new type created. cdemosp.c Session pooling. cdemocp.c Connection pooling. cdemocpproxy.c Connection pooling with proxy functionality. cdemostc.c Statement caching. cdemouni.c Program for OCI UTF16 API. nchdemo1.c Shows nchar implicit conversion feature and codepoint feature. 全部编译链接调试一遍。
jimyokl 2017-08-07
  • 打赏
  • 举报
回复
好的 谢谢赵老师提醒
赵4老师 2017-08-07
  • 打赏
  • 举报
回复
参考 demo 目录下所有.cpp文件: mdemo1o.cpp occiproc.cpp mdemo1.cpp occipool.cpp occicoll.cpp occidesc.cpp occidml.cpp occiinh.cpp occiobj.cpp occistre.cpp occiclob.cpp occiblob.cpp occipobj.cpp 注意用try捕获所有该捕获的异常。
jimyokl 2017-08-07
  • 打赏
  • 举报
回复
谢谢 zhao4zhong1 赵老师的回复,我还听过您的课呢 我待会把demo运行一下看有没有问题 但这个程序,如果在和oracle服务器一个网段的主机上运行就能加载过来 不同网段中间用路由器连接就加载不过来,又让我感觉奇怪 还是我对oci不熟,得多练习 再次谢谢回复

65,187

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧