ITPub博客

首页 > 数据库 > 数据库开发技术 > 監控sql server會調用sp_primary_keys_rowset,sp_indexes_rowset過程,why

監控sql server會調用sp_primary_keys_rowset,sp_indexes_rowset過程,why

原创 数据库开发技术 作者:Derek-Zeng 时间:2006-05-22 16:55:27 0 删除 编辑

現跟蹤sql server,會時不時會調用
exec sp_primary_keys_rowset N'table', NULL
exec sp_indexes_rowset N'table', NULL, NULL
過程,不知它在什么情況會調用,正有查...

http://www.itpub.net/553384.html

[@more@]

The following shows sample output from a SQL Profiler trace:

Event Class Event Sub Class Text Connection ID SPID
+DTCTransaction enlisting 05fd00a7-3b2a-11d5-aea6-0080c7c71171 1158468 9
+DTCTransaction active 05fd00a7-3b2a-11d5-aea6-0080c7c71171 1158468 9
+DTCTransaction propagate transaction 05fd00a7-3b2a-11d5-aea6-0080c7c71171 1158468 9
+SQL:BatchCompleted SELECT au_lname from authors GROUP BY au_lname 1158468 9
Connect 1158472 10
ExistingConnection 1158472 10
+SQL:BatchCompleted SET NO_BROWSETABLE ON 1158472 10
+RPC:Starting sp_prepare @P1 output, NULL, N'SELECT * FROM Authors', 1 select @P1 1158472 10
+RPC:Completed sp_prepare @P1 output, NULL, N'SELECT * FROM Authors', 1 select @P1 1158472 10
Disconnect 1158472 10
Connect 1158473 10
ExistingConnection 1158473 10
DTCTransaction get address 1158473 10
+DTCTransaction idle 05fd00a5-3b2a-11d5-aea6-0080c7c71171 1158473 10
DTCTransaction propagate transaction 1158473 10
+RPC:Starting [pubs]..sp_primary_keys_rowset N'Authors', NULL 1158473 10
+RPC:Completed [pubs]..sp_primary_keys_rowset N'Authors', NULL 1158473 10
+DTCTransaction drain abort 05fd00a7-3b2a-11d5-aea6-0080c7c71171 1158473 10
+DTCTransaction aborting 05fd00a7-3b2a-11d5-aea6-0080c7c71171
+DTCTransaction idle 05fd00a7-3b2a-11d5-aea6-0080c7c71171 1158473 10
+DTCTransaction propagate transaction 05fd00a7-3b2a-11d5-aea6-0080c7c71171

This shows that a simple SELECT statement with a GROUP BY clause is executed on a session. It is briefly prepared (in an attempt to collect meta data), and then a new connection is made for requesting primary key information from the table. The new connection is (incorrectly) enlisted in the transaction, which aborts immediately after the sp_primary_keys_rowset call is made.

After the drain abort entry, the application stops responding for the length of the transaction timeout.

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

上一篇: SQL SERVER监测
请登录后发表评论 登录
全部评论

注册时间:2008-09-13

  • 博文量
    12
  • 访问量
    72291