Thursday, March 29, 2012

Automating DBCC Checkdb

This is a multi-part message in MIME format.
--=_NextPart_000_0062_01C3E402.F8AADA80
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
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!
--=_NextPart_000_0062_01C3E402.F8AADA80
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&
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!

--=_NextPart_000_0062_01C3E402.F8AADA80--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=djq&as_ugroup=microsoft.public.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!|||This is a multi-part message in MIME format.
--=_NextPart_000_0044_01C3E41D.ECAE0D40
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
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:\Dbmaint\DBCC.out -DelTxtRpt 2months -HtmlRpt =D:\Dbmaint\DBCC_result.htm'
Richard
"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!
--=_NextPart_000_0044_01C3E41D.ECAE0D40
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

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:\Dbmaint\DBCC.out =-DelTxtRpt 2months -HtmlRpt D:\Dbmaint\DBCC_result.htm'
Richard
"JLS" 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!


--=_NextPart_000_0044_01C3E41D.ECAE0D40--|||This is a multi-part message in MIME format.
--=_NextPart_000_0012_01C3E4B6.7E0ABE80
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
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.2432@.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:\Dbmaint\DBCC.out -DelTxtRpt 2months -HtmlRpt =D:\Dbmaint\DBCC_result.htm'
Richard
"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!
--=_NextPart_000_0012_01C3E4B6.7E0ABE80
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

Thanx! Great advise, I like being pointed in the right =direction instead of spinning my wheels all over BOL.
"Richard Ding" =wrote in message news:e8DcWfE5DHA.2432=@.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:\Dbmaint\DBCC.out =-DelTxtRpt 2months -HtmlRpt D:\Dbmaint\DBCC_result.htm'
Richard
"JLS" =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!


--=_NextPart_000_0012_01C3E4B6.7E0ABE80--|||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...
> 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=djq&as_ugroup=microsoft.public.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!
>
>

No comments:

Post a Comment