How to determine SQLAgent Job Name from Activity Monitor?

  • AVB

    SSChampion

    Points: 11399

    I was reviewing activity thru the activity monitor trying to determin why my CPU is @ 99%....anyways I noticed a process with a large wait time. This process shows it was a SQL Agent JOb running however the name is in hexidecimal format so I have no idea what the actual job is.

    Here is the name:

    SQLAgent - TSQL JobStep (Job 0xF1CA1968020D2647B0E1D42483AA2695 : Step 1)

    I've searched the titles of all my jobs (some of which use an alphanumeric name) but none match this or any part of it.

    Do I need to run the DTSRun command such as:

    DTSRun /~0xF1CA1968020D2647B0E1D42483AA2695 !X !C ??

  • Bru Medishetty

    SSC-Insane

    Points: 23606

    Look in the Job Activity Monitor under SQL Server Agent node. That must show you the jobs that are running and that may help you.


    Bru Medishetty

    Blog -- LearnSQLWithBru

    Join on Facebook Page Facebook.comLearnSQLWithBru

    Twitter -- BruMedishetty

  • AVB

    SSChampion

    Points: 11399

    Bru,

    That's where I was looking. Thanks for the reply though.

  • Bru Medishetty

    SSC-Insane

    Points: 23606

    AVB (11/20/2009)


    I was reviewing activity thru the activity monitor trying to determin why my CPU is @ 99%....anyways I noticed a process with a large wait time. This process shows it was a SQL Agent JOb running however the name is in hexidecimal format so I have no idea what the actual job is.

    Here is the name:

    SQLAgent - TSQL JobStep (Job 0xF1CA1968020D2647B0E1D42483AA2695 : Step 1)

    I've searched the titles of all my jobs (some of which use an alphanumeric name) but none match this or any part of it.

    Do I need to run the DTSRun command such as:

    DTSRun /~0xF1CA1968020D2647B0E1D42483AA2695 !X !C ??

    AVB (11/20/2009)


    Bru,

    That's where I was looking. Thanks for the reply though.

    Your initial post says you are using Activity Monitor and I am suggesting you to look at the Job Activity Monitor.

    Activity Monitor and Job Activity Monitor are 2 separate Monitoring tools in SSMS.


    Bru Medishetty

    Blog -- LearnSQLWithBru

    Join on Facebook Page Facebook.comLearnSQLWithBru

    Twitter -- BruMedishetty

  • AVB

    SSChampion

    Points: 11399

    Bru,

    Yes you are correct... however there can be many jobs running at any one given time. I could see what jobs are running by using the Job Activity Monitor but I need to know the specific one that is causing the high wait time.

  • Joie Andrew

    One Orange Chip

    Points: 27271

    In the Jobs tab of Enterprise Manager or the Job Activity Monitor of SSMS, what jobs does it show actively running at the time you were experiencing the high CPU usage?

    Joie Andrew
    "Since 1982"

  • Bru Medishetty

    SSC-Insane

    Points: 23606

    AVB (11/20/2009)


    Bru,

    Yes you are correct... however there can be many jobs running at any one given time. I could see what jobs are running by using the Job Activity Monitor but I need to know the specific one that is causing the high wait time.

    Yes I agree...

    I found a work around which might not be the best possible one. Currently working on it, will post here as soon as I am done.


    Bru Medishetty

    Blog -- LearnSQLWithBru

    Join on Facebook Page Facebook.comLearnSQLWithBru

    Twitter -- BruMedishetty

  • Bru Medishetty

    SSC-Insane

    Points: 23606

    AVB (11/20/2009)


    Bru,

    Yes you are correct... however there can be many jobs running at any one given time. I could see what jobs are running by using the Job Activity Monitor but I need to know the specific one that is causing the high wait time.

    Hi,

    Please follow the link below to my article on this topic. It would have been a huge reply, so I made an article and I am providing link below.

    Find a SQL Agent Job Name based on the Activity Monitor[/url]

    Edited to inlcude the new URL for the blog...


    Bru Medishetty

    Blog -- LearnSQLWithBru

    Join on Facebook Page Facebook.comLearnSQLWithBru

    Twitter -- BruMedishetty

  • AVB

    SSChampion

    Points: 11399

    Bru,

    Interesting article and script. I am not in front of SQL again till monday however I will give this a go as soon as I can. If I get some down time this weekend I may tackle it then. Thank you. I'll post back here soon...

  • AVB

    SSChampion

    Points: 11399

    Bru,

    I had a chance to run your script and it does work. One word of advice is you should run that procedure as soon as you see the offending Process. I waited too long the first time and I couldn't retrieve the name. However I was ready the next time around!

    I'm assuming your not running SQL 2000. Is that correct? I had to edit the proc to run on 2000. You had "master.sys.sysprocesses" I had to change it to "master.dbo.sysprocesses". Aside from that it worked well.

    Good work and Thanks again! Now I have to dig into your procedure to understand the inner workings.

  • Bru Medishetty

    SSC-Insane

    Points: 23606

    Thanks,

    I am actually planning to improve that Stored Proc and make it a list for all SQL Agent Jobs instead of passing a parameter.

    So sometime later next week check my site or I would update here about it.


    Bru Medishetty

    Blog -- LearnSQLWithBru

    Join on Facebook Page Facebook.comLearnSQLWithBru

    Twitter -- BruMedishetty

  • Bru Medishetty

    SSC-Insane

    Points: 23606

    AVB (11/23/2009)


    Bru,

    I'm assuming your not running SQL 2000. Is that correct? I had to edit the proc to run on 2000. You had "master.sys.sysprocesses" I had to change it to "master.dbo.sysprocesses". Aside from that it worked well.

    Yes, I was working on my SQL Server 2005 system.

    It was late on Friday night (around 1 30 AM Saturday) and I had no time to test it on SQL 2000.


    Bru Medishetty

    Blog -- LearnSQLWithBru

    Join on Facebook Page Facebook.comLearnSQLWithBru

    Twitter -- BruMedishetty

  • shell_l_d

    Ten Centuries

    Points: 1385

    How to link sysprocesses to sysjobs 🙂

    Re:

    sysprocesses.program_name 'SQLAgent - TSQL JobStep (Job 0xF1CA1968020D2647B0E1D42483AA2695 : Step 1)'

    but how to match it to relevant sysjobs.job_id

    There is a simpler way to get the same results... found a post from another user 🙂

    -- link sysprocesses to sysjobs and sysjobsteps

    select

    p.spid,

    p.program_name,

    j.job_id,

    job_name = coalesce(j.[name], ''),

    jobstep_id = coalesce(js.[step_id], ''),

    jobstep_name = coalesce(js.[step_name], '')

    from master.dbo.sysprocesses p

    --left outer join msdb.dbo.sysjobs j on substring(p.program_name,32,32) = substring(master.dbo.fn_varbintohexstr(j.job_id),3,100)

    left outer join msdb.dbo.sysjobs j on master.dbo.fn_varbintohexstr(j.job_id) = substring(p.program_name,30,34)

    left outer join msdb.dbo.sysjobsteps js on j.job_id = js.job_id and js.step_id = substring( p.program_name, 72, len(p.program_name)-72 )

    where

    p.spid >= 50

    and p.status <> 'sleeping'

    and p.spid <> @@spid

    Per:

    http://www.sqlservercentral.com/Forums/Topic233404-110-1.aspx#bm829591

    http://www.sqlservercentral.com/Forums/Topic829628-8-1.aspx#bm829636

    http://www.sqlservercentral.com/Forums/FindPost837738.aspx

Viewing 13 posts - 1 through 13 (of 13 total)

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