Who created the job?

  • 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?

  • 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

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Grant Fritchey (2/14/2011)


    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.

  • sqldba_icon (2/14/2011)


    Grant Fritchey (2/14/2011)


    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

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • 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?

  • 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

  • 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?

  • 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

  • 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

  • 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/[/url]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.

  • I know this thread is a bit old, but you might be able to find out who was connected/logged in, through the event viewer. If you look at the creation date of the job, you can look through the event viewer for users logged in to the server/instance on that day, at the time of creation. The user/account would have to have sufficient permissions to create the job. All these aspects together can, at least, suggest who may have created the job... of course this is not 100% accurate, but can be helpful.

Viewing 11 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic. Login to reply