Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Who created the job? Expand / Collapse
Author
Message
Posted Monday, February 14, 2011 12:18 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 7:08 AM
Points: 1,283, Visits: 2,958

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?
Post #1063777
Posted Monday, February 14, 2011 1:40 PM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Today @ 3:39 PM
Points: 15,618, Visits: 27,998
[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 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1063848
Posted Monday, February 14, 2011 2:45 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 7:08 AM
Points: 1,283, Visits: 2,958
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.

Post #1063883
Posted Monday, February 14, 2011 3:25 PM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Today @ 3:39 PM
Points: 15,618, Visits: 27,998
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 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1063905
Posted Monday, February 14, 2011 9:36 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 7:08 AM
Points: 1,283, Visits: 2,958

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?
Post #1063983
Posted Monday, February 14, 2011 9:44 PM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: 2 days ago @ 9:52 PM
Points: 880, Visits: 4,091

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
Post #1063984
Posted Monday, February 14, 2011 9:49 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 7:08 AM
Points: 1,283, Visits: 2,958
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?
Post #1063986
Posted Monday, February 14, 2011 9:54 PM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: 2 days ago @ 9:52 PM
Points: 880, Visits: 4,091

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
Post #1063988
Posted Tuesday, February 15, 2011 9:12 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 7:08 AM
Points: 1,283, Visits: 2,958
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
Post #1064362
Posted Tuesday, February 15, 2011 11:25 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 12:03 PM
Points: 7,170, Visits: 6,320
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 Administrator

Webpage: http://www.BrandieTarvin.net
LiveJournal Blog: http://brandietarvin.livejournal.com/
On LinkedIn!, Google+, and Twitter.

Freelance Writer: Shadowrun
Latchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.
Post #1064463
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse