|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Wednesday, May 11, 2011 5:16 AM
Points: 24,
Visits: 51
|
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, May 01, 2013 10:49 AM
Points: 160,
Visits: 155
|
|
Joseph's tips are always excellent but practicle as well (I would also recommend his book SQL 2000 Fast Answers)
paul warwick
paul warwick
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Wednesday, May 11, 2011 5:16 AM
Points: 24,
Visits: 51
|
|
Just an addendum to my article - for the "INSERT #Errors EXEC xp_readerrorlog", this extended proc is in the master database... So change it to:
INSERT #Errors EXEC master..xp_readerrorlog
Also - remember to drop the temp table.
DROP TABLE #Errors
Thanks!
|
|
|
|
|
SSC-Dedicated
           
Group: Administrators
Last Login: Today @ 1:14 AM
Points: 31,433,
Visits: 13,746
|
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Thursday, May 06, 2004 11:03 AM
Points: 109,
Visits: 1
|
|
Thank you for all but the coolest one is the SQL log script :)
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 8:07 AM
Points: 229,
Visits: 257
|
|
For the script that is looking for jobs still running I think an easyer script will be
msdb.dbo.sp_get_composite_job_info @execution_status = 1
since the rest of parameters has a default NULL.
Ionel
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, March 01, 2005 9:51 AM
Points: 2,
Visits: 1
|
|
This is a great article. My only suggestion would be to use master..xp_readerrorlog in the script in tip # 7.
Thanks, Biva
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Yesterday @ 3:27 PM
Points: 2,692,
Visits: 1,075
|
|
Just what I was looking for to drive my ASP status report.
One other tip for #7, I modified the SELECT statement to be like this,
SELECT TOP 50 CONVERT(datetime, LEFT(vchMsg, 23), 121) as MsgDate , SUBSTRING(vchMsg, 24, 10) as MsgSource , SUBSTRING(vchMsg, 33, 800) as MsgText FROM #Tmp WHERE vchMsg NOT LIKE '%Log backed up%' AND vchMsg NOT LIKE '%.TRN%' AND vchMsg NOT LIKE '%Database backed up%' AND vchMsg NOT LIKE '%.BAK%' AND vchMsg NOT LIKE '%Run the RECONFIGURE%' AND vchMsg NOT LIKE '%Copyright (c)%' AND LTRIM(RTRIM(LEFT(vchMsg, 1))) <> CHAR(9) AND ID = 0 ORDER BY CONVERT(datetime, LEFT(vchMsg, 23), 121) DESC
Now it shows the date, source and message text in seperate fields. The TOP 50 and ORDER BY I put in so that only the last 50 messages are displayed.
I'd like to improve it further by using the either the OPENROWSET or OPENQUERY statements to execute the xp_readerrorlog procedure. This would get rid of the temp table and I could put this in a stored procedure on one server and dynamically retrieve the error logs from servers that aren't linked.
The alternative to the stored procedure approach would be to open a database connection on the ASP page and dynamically build and execute the SQL statement there. Not my preferred option.
Hope this helps Phill Carter -------------------- Colt 45 - the original point and click interface 
Edited by - phillcart on 09/14/2003 8:02:15 PM
Edited by - phillcart on 09/14/2003 8:03:56 PM
Hope this helps Phill Carter -------------------- Colt 45 - the original point and click interface 
Australian SQL Server User Groups - My profile Phills Philosophies Murrumbeena Cricket Club
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: 2 days ago @ 2:09 PM
Points: 265,
Visits: 636
|
|
Good stuff. To para #3 I would add "and unscheduled jobs." I've been burned by someone else either removing or disabling the schedule of a regularly-scheduled job. At first glance you say "it's still enabled, why didn't it run?" There's no easy way to check if the schedule was deleted, but it is easy to see if the schedule is disabled.
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Monday, May 20, 2013 6:52 AM
Points: 3,047,
Visits: 1,256
|
|
I am going to add some of these into my daily reports. And yes, I do have co-workers that slip in new sysadmin users! At least this way I'll know it right away. Any good scripts for monitoring replication status? Regards, Scott
|
|
|
|