Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想创建一个程序来存储每周在数据库中发生多少死锁的数据,并将这个输出存储在一个表中——这是最好的方法吗?
我尝试使用扩展日志,但如何将 XML 输出存储在表中?
先感谢您
最好的方法是为数据库创建探查器跟踪。您应该查看过滤捕获的死锁(例如通过应用程序或数据库或用户)。在运行跟踪的任何时间之后,您都可以使用 fn_trace 方法将数据导入表中:
SELECT * INTO tracetable FROM ::fn_trace_gettable('c:\deadlock.trc', default)