Thursday, March 29, 2012

Automating DBCC Checkdb

Sql Server 2000
If I ran a weekend job to perform a DBCC Checkdb on my databases, is there a
n alert that I can monitor for which will inform me of any problems discover
ed? Or is there a method to get the output of the DBCC Checkdb to a text fi
le? When running this command as a scheduled job, I don't see the output I
am in the habit of perusing for errors.
Please advise. Or tell me how you approach executing database maintenance.
Thanx!Here's what I'd do:
Define two jobsteps, "at the end" of the job. One has subject "success", the
other "error". In these, you use xp_sendmail or xp_smtp_sendmail (I
recommend this: www.sqldev.net) In the "real" jobsteps, define "next step"
on success and on failure you go to the one where you send the email with
"failure".
In the DBCC jobstep, you define an output file, and in the mail jobsteps,
you specify that file as an attachment.
--
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=...ublic.sqlserver
"JLS" <jlshoop@.hotmail.com> wrote in message
news:OiAUHxC5DHA.2776@.TK2MSFTNGP09.phx.gbl...
Sql Server 2000
If I ran a weekend job to perform a DBCC Checkdb on my databases, is there
an alert that I can monitor for which will inform me of any problems
discovered? Or is there a method to get the output of the DBCC Checkdb to a
text file? When running this command as a scheduled job, I don't see the
output I am in the habit of perusing for errors.
Please advise. Or tell me how you approach executing database maintenance.
Thanx!|||Use sqlmaint.exe utility as described in BOL. It can sends out put to a file
. The file could be in text and /or html format.
EXEC xp_sqlmaint '-S SQLSERVER -PlanName "DBMAINTPLAN 1" -CkDB -Rpt D:\Dbm
aint\DBCC.out -DelTxtRpt 2months -HtmlRpt D:\Dbmaint\DBCC_result.htm'
Richard
"JLS" <jlshoop@.hotmail.com> wrote in message news:OiAUHxC5DHA.2776@.TK2MSFTNG
P09.phx.gbl...
Sql Server 2000
If I ran a weekend job to perform a DBCC Checkdb on my databases, is there a
n alert that I can monitor for which will inform me of any problems discover
ed? Or is there a method to get the output of the DBCC Checkdb to a text fi
le? When running this command as a scheduled job, I don't see the output I
am in the habit of perusing for errors.
Please advise. Or tell me how you approach executing database maintenance.
Thanx!|||Thanx! Great advise, I like being pointed in the right direction instead of
spinning my wheels all over BOL.
"Richard Ding" <dingr@.cleanharbors.com> wrote in message news:e8DcWfE5DHA.24
32@.TK2MSFTNGP10.phx.gbl...
Use sqlmaint.exe utility as described in BOL. It can sends out put to a file
. The file could be in text and /or html format.
EXEC xp_sqlmaint '-S SQLSERVER -PlanName "DBMAINTPLAN 1" -CkDB -Rpt D:\Dbm
aint\DBCC.out -DelTxtRpt 2months -HtmlRpt D:\Dbmaint\DBCC_result.htm'
Richard
"JLS" <jlshoop@.hotmail.com> wrote in message news:OiAUHxC5DHA.2776@.TK2MSFTNG
P09.phx.gbl...
Sql Server 2000
If I ran a weekend job to perform a DBCC Checkdb on my databases, is there a
n alert that I can monitor for which will inform me of any problems discover
ed? Or is there a method to get the output of the DBCC Checkdb to a text fi
le? When running this command as a scheduled job, I don't see the output I
am in the habit of perusing for errors.
Please advise. Or tell me how you approach executing database maintenance.
Thanx!|||Thanx! Exactly the information I was looking for!
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OCrGg$C5DHA.2344@.TK2MSFTNGP09.phx.gbl...
quote:

> Here's what I'd do:
> Define two jobsteps, "at the end" of the job. One has subject "success",

the
quote:

> other "error". In these, you use xp_sendmail or xp_smtp_sendmail (I
> recommend this: www.sqldev.net) In the "real" jobsteps, define "next step"
> on success and on failure you go to the one where you send the email with
> "failure".
> In the DBCC jobstep, you define an output file, and in the mail jobsteps,
> you specify that file as an attachment.
> --
> Tibor Karaszi, SQL Server MVP
> Archive at:
>

http://groups.google.com/groups?oi=...ublic.sqlserver
quote:

>
> "JLS" <jlshoop@.hotmail.com> wrote in message
> news:OiAUHxC5DHA.2776@.TK2MSFTNGP09.phx.gbl...
> Sql Server 2000
> If I ran a weekend job to perform a DBCC Checkdb on my databases, is there
> an alert that I can monitor for which will inform me of any problems
> discovered? Or is there a method to get the output of the DBCC Checkdb to

a
quote:

> text file? When running this command as a scheduled job, I don't see the
> output I am in the habit of perusing for errors.
> Please advise. Or tell me how you approach executing database

maintenance.
quote:

> Thanx!
>
>

No comments:

Post a Comment