首页 > 数据库 > 数据库开发技术 > 監控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


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博客 ” ,链接:,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录


  • 博文量
  • 访问量