Translate

Sunday, June 20, 2010

Enabling Resource Governor

This is UI bug which was missed by MS QA team.

Steps to produce

1. Create a classifier function

CREATE FUNCTION dbo.RG_Classifier_2() RETURNS sysname

WITH SCHEMABINDING

AS

BEGIN

DECLARE @grp_name sysname

IF (DB_NAME() = 'Sales')

SET @grp_name = 'GroupSales'

IF (DB_NAME() = 'Reports')

SET @grp_name = 'GroupReports'

IF (SUSER_NAME() LIKE 'DataW')

SET @grp_name = 'GroupDWH'

RETURN @grp_name

END;

GO

-- Register the classifier function with Resource Governor

ALTER RESOURCE GOVERNOR WITH (CLASSIFIER_FUNCTION= dbo.RG_Classifier_2);

GO

-- Start Resource Governor

ALTER RESOURCE GOVERNOR RECONFIGURE;

GO

2. Create another classifier function

CREATE FUNCTION dbo.RG_Classifier_3() RETURNS sysname

WITH SCHEMABINDING

AS

BEGIN

DECLARE @grp_name sysname

IF (DB_NAME() = 'Sales')

SET @grp_name = 'GroupSales'

IF (DB_NAME() = 'Reports')

SET @grp_name = 'GroupReports'

IF (SUSER_NAME() LIKE 'DataW')

SET @grp_name = 'GroupDWH'

RETURN @grp_name

END;

GO

-- Register the classifier function with Resource Governor

ALTER RESOURCE GOVERNOR WITH (CLASSIFIER_FUNCTION= dbo.RG_Classifier_3);

GO

-- Start Resource Governor

ALTER RESOURCE GOVERNOR RECONFIGURE;

GO

3. Go to properties of Resource Governor.

clip_image002

All classifier functions in the drop down while last one is selected with Enable Resource Governor option is selected.

4. Select some other classifier function name and above option is disabled.

5. Select the previous classifier function again where enable resource governor should be enable where as it is disable.

clip_image004

If you cancel the screen and come back to the same dialog box it will be enable as it should be.

No comments:

Post a Comment