Using Trace Flags

  • Comments posted to this topic are about the item Using Trace Flags

  • beside the "default" (at least before SQL 2016) Trace Flags 1117 / 1118 (Grow all Files in a FileGroup equally / prevent mixted extends) I'm using:
    1222 (allows Deadlock monitoring), 2371(Changes the fixed auto update statistics threshold to dynamic auto update statistics threshold. - not necessary on 2016) and Trace Flag 3226 (Function: By default, every successful backup operation adds an entry in the SQL Server error log and in the system event log. If you create very frequent log backups, these success messages accumulate quickly, resulting in huge error logs in which finding other messages is problematic. With this trace flag, you can suppress these log entries. This is useful if you are running frequent log backups and if none of your scripts depend on those entries)

    God is real, unless declared integer.

  • t.franz - Friday, March 17, 2017 1:44 AM

    beside the "default" (at least before SQL 2016) Trace Flags 1117 / 1118 (Grow all Files in a FileGroup equally / prevent mixted extends) I'm using:
    1222 (allows Deadlock monitoring), 2371(Changes the fixed auto update statistics threshold to dynamic auto update statistics threshold. - not necessary on 2016) and Trace Flag 3226 (Function: By default, every successful backup operation adds an entry in the SQL Server error log and in the system event log. If you create very frequent log backups, these success messages accumulate quickly, resulting in huge error logs in which finding other messages is problematic. With this trace flag, you can suppress these log entries. This is useful if you are running frequent log backups and if none of your scripts depend on those entries)

    Very nice list. Also I suggest for SQL Server 2012 necessarily using Trace Flag 272:

    Trace Flag: 272
    Function: Generates a log record per identity increment. Can be used to convert SQL 2012 back to old style Identity behavior
    Link: http://www.big.info/2013/01/how-to-solve-sql-server-2012-identity.html
    Link: https://connect.microsoft.com/SQLServer/feedback/details/739013/failover-or-restart-results-in-reseed-of-identity
    It prevent identity gap after restarting SQL Server instance, critical for developers that used for identity column tinyint and smallint datat types or want to get sequence of numbers in identity column.

    Simple demo for repeat this issue on SQL Server 2012 you can find here: https://github.com/ktaranov/sqlserver-kit/blob/master/Errors/Identity_gap_sql_server_2012.sql

  • Just chiming in to reiterate what t.franz has already mentioned.  -T1117 and -T1118  so that tempdb behaves well with multiple data files prior to 2016.  Also a big thank you to K. Taranov for the original listing of trace flags. Great list.
    Thanks
    Jeff Bennett

  • There may be some of you that have never heard or, or used, a trace flag in your career. That's fine, though I hope you use today to a) let us know, and b) educate yourself to ensure you know how to enable a flag you need one. If nothing else, add one to a test instance, and ensure you have the skills to actually make the change.

    Given the context of the editorial, perhaps more important than learning how to enable a flag would be learning how to tell if one is enabled, and if necessary, how to disable it.

    Leonard
    Madison, WI

  • chudman - Friday, March 17, 2017 7:52 AM

    Just chiming in to reiterate what t.franz has already mentioned.  -T1117 and -T1118  so that tempdb behaves well with multiple data files prior to 2016.  Also a big thank you to K. Taranov for the original listing of trace flags. Great list.
    Thanks
    Jeff Bennett

    Thanks for thanks, you can contribute any time here: https://github.com/ktaranov/sqlserver-kit/pulls or create issue if find some typos.

  • phonetictalk - Friday, March 17, 2017 12:09 PM

    There may be some of you that have never heard or, or used, a trace flag in your career. That's fine, though I hope you use today to a) let us know, and b) educate yourself to ensure you know how to enable a flag you need one. If nothing else, add one to a test instance, and ensure you have the skills to actually make the change.

    Given the context of the editorial, perhaps more important than learning how to enable a flag would be learning how to tell if one is enabled, and if necessary, how to disable it.

    Published this week: Enabling trace flags

  • Trace flags have always been a little theoretical to me. Often I am not allowed to configure such settings (no bad thing as least privileges required etc.) but I do try and keep abreast of such things. I think that awareness of this type of thing is essential for all of us. Even us simple devs :hehe:

    Gaz

    -- Stop your grinnin' and drop your linen...they're everywhere!!!

  • Thanks for the list. 3226 is essential for me. I can't stand wading through a list of successful backups when I'm trying to find something in the error log. I

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply