SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

New DMF sys.dm_db_log_stats in SQL Server 2017

By Jayendra Viswanathan,

I would like to share few of the attributes available for sys.dm_db_log_stats. This was the extract from my SQL Server machine. Since sys.dm_db_log_stats return table, I use CROSS APPLY to extract the matched data. Below are the few columns showed as examples. sys.dm_db_log_stats  can be used to display lots of data useful for SQL DBA's and SQL Developers.

Output for First Set : 

Name is the database name.

total_vlf_count  is the Total number of virtual log files (VLFs) in the transaction log.

log_truncation_holdup_reason is NOTHING in my example.

log_backup_time is the last BACKUP time from the SQL Server.

active_vlf_count is the total active VLF counts.

active_log_size_mb float Total active transaction log size in MB.

Output for Second Set : 

Name is the database name 
s.recovery_model is the database recovery model , 1 is for FULL , 3 is for SIMPLE.
collation_name is SQL_Latin1_General_CP1_CI_AS
user_access_desc is MULTI_USER
recovery_model_desc 

Total article views: 214 | Views in the last 30 days: 4
 
Related Articles
FORUM

Modeling relational databases

Modeling relational databases

BLOG

MS DTC and sys.dm_tran_active_transactions

A  sql reindex command was being blocked by two active transactions in MS DTC.   Use sys.dm_tran_ac...

FORUM

Question on Row Count

Row Count from sys.dm_db_partition_stats

FORUM
FORUM

How do I count Analysis Services Databases?

Counting Databases

 
Contribute