Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Who created the job?


Who created the job?

Author
Message
curious_sqldba
curious_sqldba
SSCommitted
SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)

Group: General Forum Members
Points: 1543 Visits: 3573
I want to setup a standard where all the jobs are running under a dedicated service account. Mentioned below are my questions, please advice

i)lets say usera creates a job and assigns owner as " sa", is there a place where i can go and look to find who actually created a job?
ii) i have a job which is running under a disabled windows account and still the job runs fine. How is this possible? The job owner is a disabled account, how is the job running?
Grant Fritchey
Grant Fritchey
SSCoach
SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)

Group: General Forum Members
Points: 17617 Visits: 32267
[url=http://msdn.microsoft.com/en-us/library/ms175513.aspx][/url]For a) you want to take a look at the default trace. That's how you can tell who made structural changes to the system.

As far as b) goes, if the user is still there, the jobs are running under that security context since that user is the owner. I don't know what would happen if you deleted the user. I suspect the job would fail.

----------------------------------------------------
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore Roosevelt

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
curious_sqldba
curious_sqldba
SSCommitted
SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)

Group: General Forum Members
Points: 1543 Visits: 3573
Grant Fritchey (2/14/2011)
[url=http://msdn.microsoft.com/en-us/library/ms175513.aspx][/url]For a) you want to take a look at the default trace. That's how you can tell who made structural changes to the system.

As far as b) goes, if the user is still there, the jobs are running under that security context since that user is the owner. I don't know what would happen if you deleted the user. I suspect the job would fail.


Thanks Grant

a) Doesn't really help because gives data from default trace about few days back. I was expecting to query a table to find " who created" sql job.
Grant Fritchey
Grant Fritchey
SSCoach
SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)

Group: General Forum Members
Points: 17617 Visits: 32267
sqldba_icon (2/14/2011)
Grant Fritchey (2/14/2011)
[url=http://msdn.microsoft.com/en-us/library/ms175513.aspx][/url]For a) you want to take a look at the default trace. That's how you can tell who made structural changes to the system.

As far as b) goes, if the user is still there, the jobs are running under that security context since that user is the owner. I don't know what would happen if you deleted the user. I suspect the job would fail.


Thanks Grant

a) Doesn't really help because gives data from default trace about few days back. I was expecting to query a table to find " who created" sql job.



It might be in the agent tables in MSDB. It's not something I've looked for before, but that's where I'd look if the default trace isn't going to help.

----------------------------------------------------
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore Roosevelt

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
curious_sqldba
curious_sqldba
SSCommitted
SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)

Group: General Forum Members
Points: 1543 Visits: 3573
As far as i know there are no tables inside MSDB which will give the name of the "creator" of the job. I am so surprised that sql server doesn't have a way to findout the creator of the job?
crazy4sql
crazy4sql
SSC Eights!
SSC Eights! (931 reputation)SSC Eights! (931 reputation)SSC Eights! (931 reputation)SSC Eights! (931 reputation)SSC Eights! (931 reputation)SSC Eights! (931 reputation)SSC Eights! (931 reputation)SSC Eights! (931 reputation)

Group: General Forum Members
Points: 931 Visits: 4424

ii) i have a job which is running under a disabled windows account and still the job runs fine. How is this possible? The job owner is a disabled account, how is the job running?


could be the possibility that same job is created in some other server as remote job with some other account.
You can query in msdb sysjobs to get the name of the job and then using where condition you can find out which other server have the same job. If you have many database server then you can use cursor to run through all your listed server and get the required information.

----------
Ashish
curious_sqldba
curious_sqldba
SSCommitted
SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)

Group: General Forum Members
Points: 1543 Visits: 3573
crazy4sql (2/14/2011)

ii) i have a job which is running under a disabled windows account and still the job runs fine. How is this possible? The job owner is a disabled account, how is the job running?


could be the possibility that same job is created in some other server as remote job with some other account.
You can query in msdb sysjobs to get the name of the job and then using where condition you can find out which other server have the same job. If you have many database server then you can use cursor to run through all your listed server and get the required information.



Thanks. Not sure what are you trying to get by saying "could be the possibility that same job is created in some other server as remote job with some other account."...if even there are jobs with same name and account on other server..so what?
crazy4sql
crazy4sql
SSC Eights!
SSC Eights! (931 reputation)SSC Eights! (931 reputation)SSC Eights! (931 reputation)SSC Eights! (931 reputation)SSC Eights! (931 reputation)SSC Eights! (931 reputation)SSC Eights! (931 reputation)SSC Eights! (931 reputation)

Group: General Forum Members
Points: 931 Visits: 4424

if even there are jobs with same name and account on other server..so what?


I no where said that job is created with same account. What I said was same job and then use query to find out which server have that job and obvioulsy you will get the details who is running the job.

----------
Ashish
curious_sqldba
curious_sqldba
SSCommitted
SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)

Group: General Forum Members
Points: 1543 Visits: 3573
crazy4sql (2/14/2011)

if even there are jobs with same name and account on other server..so what?


I no where said that job is created with same account. What I said was same job and then use query to find out which server have that job and obvioulsy you will get the details who is running the job.



Still doesn't makes sense to me, i just want to know is there a table or view or some sort of sysfunction where i can find the creator of the job. Having the same job at a different server will only be a "guess" as who created the job. Thanks
Brandie Tarvin
Brandie Tarvin
SSCertifiable
SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)

Group: General Forum Members
Points: 7806 Visits: 8745
SQL Server does NOT track who created jobs, just the current owner of the jobs.

However, the work around is to create your own DDL trigger (if Create Job is one of the options) to log the information into a table of your own and reference that. The only issue is that it wouldn't back track the information. You'd only be able to record it going forward.

Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search