For Day 3 of this series, we are up to Query #5<\/strong>, which is Global Trace Flags. This query simply runs a DBCC command to determine what global trace flags are currently in effect for your current instance of SQL Server. Query #5 is shown in Figure 1.<\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/div>\n<\/div>\n Figure 1: Query #5 Global Trace Flags<\/strong><\/p>\n Global trace flags affect the performance and behavior of the entire instance of SQL Server. It is always a good idea to know what global trace flags are in effect on your SQL Server instance, since this can help explain unexpected behavior that you may be seeing. It also gives you an idea about whether whoever setup and\/or has been maintaining this instance of SQL Server really knows what they are doing or not. If I see an instance of SQL Server with no global trace flags enabled, that is usually a pretty good indicator that you will find lots of other issues with the instance.<\/p>\n There are certain trace flags that I think should be enabled pretty much in all cases, regardless of your workload. These include:<\/p>\n <\/p>\n <\/p>\n These should be enabled as global trace flags, and as startup trace flags<\/a>, using SQL Server Configuration Manager, so that they will go into effect whenever SQL Server is restarted.<\/p>\n 1:<\/span> -- Returns a list of all global trace flags that are enabled (Query 5) (Global Trace Flags)<\/span><\/pre>\n 2:<\/span> DBCC<\/span> TRACESTATUS (-1);<\/pre>\n 3:<\/span> <\/pre>\n 4:<\/span> -- If no global trace flags are enabled, no results will be returned.<\/span><\/pre>\n 5:<\/span> -- It is very useful to know what global trace flags are currently enabled as part of the diagnostic process.<\/span><\/pre>\n 6:<\/span> <\/pre>\n 7:<\/span> -- Common trace flags that should be enabled in most cases<\/span><\/pre>\n 8:<\/span> -- TF 3226 - Supresses logging of successful database backup messages to the SQL Server Error Log<\/span><\/pre>\n 9:<\/span> -- The behavior of TF 1118 and 2371 are enabled in SQL Server 2016 by default<\/span><\/pre>\n 10:<\/span> <\/pre>\n 11:<\/span> <\/pre>\n 12:<\/span> -- SQL Server query optimizer hotfix trace flag 4199 servicing model<\/span><\/pre>\n 13:<\/span> -- https:\/\/support.microsoft.com\/en-us\/kb\/974006<\/pre>\n\n
\n
\n