Showing posts with label dbcc. Show all posts
Showing posts with label dbcc. Show all posts

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!
>
>

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!
>
>

Wednesday, March 7, 2012

automate rebuilding indexes

Hi,
I was wondering if someone had a method to rebuild indexes
automatically, based on the results of 'dbcc showcontig'.
I want to automate index rebuilding by using the results of 'dbcc
showcontig with tableresults' into a table.
Then i want to query the results which indexes have a logical and extent
scan fragmentation of >10%.
Finally execute a 'create index <indexname> on <tablename>(columnname)
with drop_existing'
Should i be doing this automatically or manually and have a general
maintenance plan where i do a rebuild with default fillfactor?You find just such an example in Books Online, DBCC SHOWCONTIG. Also see
http://www.microsoft.com/technet/pr...n/ss2kidbp.mspx
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Jason" <jasonlewis@.hotmail.com> wrote in message news:uQWgItQdGHA.4576@.TK2MSFTNGP05.phx.gb
l...
> Hi,
> I was wondering if someone had a method to rebuild indexes automatically,
based on the results of
> 'dbcc showcontig'.
> I want to automate index rebuilding by using the results of 'dbcc showcont
ig with tableresults'
> into a table.
> Then i want to query the results which indexes have a logical and extent s
can fragmentation of
> Finally execute a 'create index <indexname> on <tablename>(columnname) wit
h drop_existing'
> Should i be doing this automatically or manually and have a general mainte
nance plan where i do a
> rebuild with default fillfactor?