Resource Governor is a good feature giving tremendous power and flexibility to DBAs to control resource usage, primarily CPU & Memory. As of this writing, in SQL Server 2008 & R2, you can only configure CPU & Memory resources. The concept of Pools and workload groups needs to be understood & tested well before you implement Resource Governor in your Production environment. Failing to do so, you can wreak havoc !! The purpose of this post is not to go in to the details of Pools and Workload groups as that might require a long explanation with examples – and if you are really interested in knowing more, just drop a comment on this blog. In this post, I want to talk about enabling & disabling Resource Governor and trace flag 8040.
Resource Governor has to be enabled before it can be used. You can enable it using the GUI or using T-SQL.
ALTER RESOURCE GOVERNOR RECONFIGURE
Similarly, you can disable Resource Governor using GUI and T-SQL:
ALTER RESOURCE GOVERNOR DISABLE
Now the interesting part is disabling it permanently (somewhat). As mentioned earlier that your junior DBA can wreak havoc if he enables Resource Governor without configuring it correctly. Why not use the trace flag 8040 and disable it permanently – which means that if you start your SQL Server instance with trace flag 8040; Resource Governor is always disabled – which means if this trace flag is used Resource Governor is always OFF and any attempt to enable/RECONFIGURE it fails.
Register for my SQL Server Performance Tuning Master Class!