HiveBrain v1.2.0
Get Started
← Back to all entries
snippetMinor

How can I find the VLF count for a SQL 2005 database without running dbcc loginfo?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
vlfcanthewithouthowloginfosqldbccdatabase2005

Problem

Is it possible to find the number of VLFs in a database's transaction log without running DBCC LOGINFO? DBCC LOGINFO seems a little heavy and verbose when count is the only information my t-sql script needs from it.

Solution

I went and checked the POSH script I had that tied to an Excel spreadsheet:

http://www.simple-talk.com/sql/database-administration/monitoring-sql-server-virtual-log-file-fragmentation/

And you mentioned that DBCC LOGINFO was 'verbose', which makes me want to ask, have you tried using the WITH NO_INFOMSGS option?

Context

StackExchange Database Administrators Q#4204, answer score: 5

Revisions (0)

No revisions yet.