SQL Server Disable Resource Governor permanently (somewhat)

Hi Friends,

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.

GUI:

1_SQL_Server_Disabling_Resource_Governor_permanently_somewhat

TSQL:

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.

 

 

Data Platform Virtual Summit 2020

Subscribe to SQLServerGeeks YouTube channel. If you want more learning content in your inbox, subscribe to SQLServerGeeks Bulletin.

SQLServerGeeks YouTube | SQLServerGeeks Bulletin | SQLServerGeeks Twitter

Amit Bansal

About Amit Bansal

Amit Bansal is always brainstorming around SQL Server. Despite working with SQL since 1997, he is amazed that he keeps learning new things every single day. SQL Server is AB's first love, and his wife does not mind that. He tries to share as much and spreads the SQL goodness. Internals and Performance Tuning excites him, and also gives him sleepless nights at times, simply because he is not a genius, but quite a hard worker and does not give up. It has been a long and exciting journey since 1997, you can read here: http://sqlmaestros.com/amit-bansal/ He is on Twitter: https://www.twitter.com/A_Bansal

View all posts by Amit Bansal →

2 Comments on “SQL Server Disable Resource Governor permanently (somewhat)”

Leave a Reply

Your email address will not be published. Required fields are marked *