BrentOzarULTD / SQL-Server-First-Responder-Kit

sp_Blitz, sp_BlitzCache, sp_BlitzFirst, sp_BlitzIndex, and other SQL Server scripts for health checks and performance tuning.
http://FirstResponderKit.org
Other
3.37k stars 997 forks source link

sp_Blitz: Should we be actively recommending Trace Flag 3226? #3540

Closed ReeceGoding closed 4 months ago

ReeceGoding commented 4 months ago

Is your feature request related to a problem? Please describe.

3527 and particularly the PR #3539 raise the idea that we should actively be recommending Trace Flags. I've yet to encounter a server that didn't benefit from Trace Flag 3326, so I say we should add a check. Unless there is some Azure or SQL Server version magic that I don't know about, this should be trivial to add.

Describe the solution you'd like See below.

Describe alternatives you've considered Maybe make it check how many databases you have and only give the recommendation if you're over a certain limit, maybe 10?

Are you ready to build the code for the feature? Pretty trivial.

IF NOT EXISTS ( SELECT  1
        FROM    #TraceStatus T
        WHERE   [T].[TraceFlag] = '3226' )

        BEGIN
            INSERT  INTO #BlitzResults
                ( CheckID ,
                  Priority ,
                  FindingsGroup ,
                  Finding ,
                  URL ,
                  Details
                )
                SELECT  74 AS CheckID ,
                    200 AS Priority ,
                    'Informational' AS FindingsGroup ,
                    'Recommended Trace Flag Off' AS Finding ,
                    'https://github.com/ktaranov/sqlserver-kit/blob/master/SQL%20Server%20Trace%20Flag.md#recommended-trace-flags' AS URL ,
                    'Trace Flag 3226 not enabled globally. It keeps the event log clean by not reporting successful backups.' AS Details                
                FROM    #TraceStatus T
        END;
BrentOzar commented 4 months ago

I try to keep the sp_Blitz results focused on things that'll actually make a difference. I totally understand where you're coming from, but I don't universally recommend putting in trace flags, especially on stuff like Amazon RDS, so let's steer clear of this for now.