July 27, 2011 at 9:43 am
I'm looking for a script (Powershell?) which will scan a directory of the batch job log files produced by running DBCC CHECKDB as a batch SQL Server Agent job against a series of databases on a server. Each run produces text log file that, hopefully, includes near the bottom the line:
[font="Courier New"]CHECKDB found 0 allocation errors and 0 consistency errors in database 'test'. [SQLSTATE 01000][/font]
The script should scan (grep) all of the log files and, ideally, email a message when either error count is not zero.
Has anyone seen a script like this?
Thank you for any help.
Alan
July 27, 2011 at 10:20 am
Any type of error will result in the task 'failing', so many of us run this statement with NO_INFOMSGS to not log any of that extra detail, and send a simple text/page if that job or step fails.
For a powershell script, you may find more success posting in the powershell forum found here: http://www.sqlservercentral.com/Forums/Forum1351-1.aspx rather than in the general DBA section. The powershell junkies troll this other forums and may miss your post here.
Jim Murphy
http://www.sqlwatchmen.com
@SQLMurph
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply