DBO*_*BOn 3 sql-server transaction-log sql-server-2014
我想监控事务日志的使用情况,涉及以下所有方面:
什么 Task\Job\Query 使它填充驱动器\文件。
日志文件使用百分比。
交易发生的时间。
任何经过测试的相关方法都会有所帮助。
最简单的方法是购买现成的监控工具。它们都为您提供此类信息 - Idera SQL DM、Quest Spotlight、SentryOne SQL Sentry 以非常低的影响执行此类操作。
下一个最简单的方法是自己构建一些东西。如果您要走那条路,我首先将sp_WhoIsActive记录到表中 - 特别是使用@get_transaction_info = 1开关。
如果您尝试自行处理的方法,您需要注意查询并不是导致事务日志增长的唯一因素。例如,如果您使用复制、数据库镜像或 Always On 可用性组,则 SQL Server 需要在其中一个副本脱机时保留历史记录。要了解有关导致这种情况的原因的更多信息,请查看log_reuse_wait_desc:
SELECT name, log_reuse_wait_desc FROM sys.databases;
Run Code Online (Sandbox Code Playgroud)
Windows Performance Monitor will display a graph showing the percentage of the transaction log currently in use against time for each SQL Server database. The counter is called "Percent Log Used" and it's in the "SQL Server:Databases" category.
It is useful for monitoring how quickly the log is filling up, and also detecting auto-grow events. It gives an intuitive visual indication of transaction log activity.
归档时间: |
|
查看次数: |
7791 次 |
最近记录: |