sqlrx logo
SQLRx® Tip of the Month
 

March 2014
______________________________________________________________________________
SQL 2008   
SQL Server Administration: Find SQL Agent jobs not owned by the SA account. Jobs that are owned by domain users can stop working if the users account is dropped or disabled. Jobs with this problem can be fixed by simply changing the job owner to SA. Use the query below to find jobs that are not owned by SA. The last column is the statement needed to change the job owner via T-SQL or it can be changed using SSMS.

 

 

USE msdb

GO

--Find jobs not owned by SA

SELECT [name] AS JobName,

       [description] AS JobDescription,

       SUSER_SNAME(owner_sid) AS JobOwner,

       'EXEC msdb.dbo.sp_update_job @job_name = ''' + name + ''', @owner_login_name = ''sa'';' AS ChangeJobOwnerCommand

FROM msdb.dbo.sysjobs

WHERE SUSER_SNAME(owner_sid) <>('sa')

GO

 

change to SA 

 

 

______________________________________________________________________________
 
SQLRx has worked hard to minimize the impact of monitoring SQL Servers to the point that we are able to monitor high transaction systems with little impact (1% load) on the target system. Contact us today to help you monitor your SQL servers!    
As always, don't forget to regularly monitor the 11 VitalSigns  used by SQLRx to debug performance bottlenecks.

If you have a SQL question you'd like us to answer, and possibly use for the next SQLRx Tip of the Month, email it to us!  If you missed any of our previous tips, you can view them here.

For assistance or more information on optimizing your SQL Server Environment, visit us at www.sqlrx.com or email Lori Brown at lorib@isi85.com.


Sincerely,

 

Lori Brown | SQLRx Senior Consultant | Integrated Services, Inc.
4144 N. Central Expwy, Suite 430  |  Dallas, TX  75204
Phone: 214.526.7680 x 113 | 800.85.SQLRx

 

 

Integrated Services, Inc.                                    
2008 winner logo small
Turning Data Into Profit

 

25 Years of Credibility & Trust

 

Join our email list          Check out our events          SQLRx Downloads