In this survey I'd like to see what the distribution of the number of log files per database is for your servers. I'm planning to do similar surveys through the rest of the year around data files and filegroups too.

Please run the following code (with example output):

    DISTINCT [LogFiles],
    COUNT (*) AS [Databases]
        COUNT (*) AS [LogFiles]
    FROM sys.master_files
    WHERE [type_desc] = N'LOG'
    GROUP BY [database_id]) [LogFilesCounts]
GROUP BY [LogFiles];

LogFiles    Databases
———– ———–
1           28
2           1

And send me the results for as many servers as you want. You can either email me plaintext or a spreadsheet or append the results as a comment to this post. Please do not add any more info to the results (like server name, version etc.) as it's not relevant for this survey and adds a bunch of time to the results processing.

Note that the script will only work on 2005 onwards.

I'll editorialize the results in a week or two.