SELECT db.[name] AS [Database Name] ,db.recovery_model_desc AS [Recovery Model] ,db.log_reuse_wait_desc AS [Log Reuse Wait Description] ,ls.cntr_value AS [Log Size (KB)] ,lu.cntr_value AS [Log Used (KB)] ,CAST(CAST(lu.cntr_value AS FLOAT) / CAST(ls.cntr_value AS FLOAT) AS DECIMAL(18, 2)) * 100 AS [Log Used %] ,db.[compatibility_level] AS [DB Compatibility Level] ,db.page_verify_option_desc AS [Page Verify Option] FROM sys.databases AS db INNER JOIN sys.dm_os_performance_counters AS lu ON db.NAME = lu.instance_name INNER JOIN sys.dm_os_performance_counters AS ls ON db.NAME = ls.instance_name WHERE lu.counter_name LIKE 'Log File(s) Used Size (KB)%' AND ls.counter_name LIKE 'Log File(s) Size (KB)%';
Labels
- Differences (38)
- MongoDB (13)
- MySQL (10)
- Oracle (6)
- ORACLE DBA (1)
- Performance Tuning (13)
- PTuning (3)
- Scenarios (4)
- Scripts (35)
- SQLDBA (99)
- SQLDeveloper (66)
- SSIS (5)
- SSRS (8)
- Troubleshooting (37)
Thursday, 24 November 2016
Script to find what is causing transaction log file fill in SQL Server
Labels:
Scripts
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment