Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Classifying Agent jobs in Resource governor

Author  Topic 

nebelhinten
Starting Member

2 Posts

Posted - 2009-09-14 : 10:07:40
Hi,

I try to classify SQL Server Agent workloads in Resource Governor, but I am not able to figure out how to do it:

Alt 1:
Is there any way to control the app name of an SQL job in order to retrive it in the classifier function by the use of APP_NAME()?

Alt 2:
I have tried to run the actual agent job under a dedicated user, but the SUSER_NAME() always returns the user name of the SQL agent user at the time of classification.

Any other ideas?

Can anyone please help me out here?

NebelHinten(=

YellowBug
Aged Yak Warrior

616 Posts

Posted - 2009-09-14 : 18:54:30
What type of job step is it?
Did you try the "Run as user" in the advanced tab?
Go to Top of Page

nebelhinten
Starting Member

2 Posts

Posted - 2009-09-15 : 02:25:57
The step type is "Transact-SQL script (T-SQL)"

When selecting this type it is not possiblie to select anyting in the "Run as" combo of the "General" page, but it is possible to select a specific user in the "Run as user" field of the Advanced page. I have tried this. My Agent runs under user "A" and the job step runs under user "B", but at time of classification the user is still "A". If a check the user by T-SQL in the job step the user is "B". This is strange, the user context must change somehow.

Anyone?

NebelHinten(=
Go to Top of Page

YellowBug
Aged Yak Warrior

616 Posts

Posted - 2009-09-15 : 06:16:04
Ok. I've tried this too. The "Run as user" option in the Advanced tab does a EXECUTE AS USER.
Looks like this impersonation doesn't fire the Resource Governor classification function.

Did you try creating a credential and proxy, and running the job step as an Operating Sytem (CmdExec)?
Does this classify correctly?

Will have a look for other options.

Go to Top of Page

YellowBug
Aged Yak Warrior

616 Posts

Posted - 2009-09-15 : 07:31:37
Have a look at page 23-24 in this document:
http://download.microsoft.com/download/D/B/D/DBDE7972-1EB9-470A-BA18-58849DB3EB3B/ResourceGov.docx

The example uses the APP_NAME() and a lookup table to determine which jobs to govern.

Hope it helps.
Go to Top of Page
   

- Advertisement -