top of page
  • Twitter Social Icon
  • Facebook Social Icon
  • LinkedIn Social Icon
Search

How to automate DBCC CHECKDB in MS SQL 2016?

  • Writer: Filip Holub
    Filip Holub
  • Jan 16, 2017
  • 1 min read

In this post I would like to show you how I solved the automation of DBCC CHECKDB. I had a meeting with a Microsoft engineer about MS SQL and he told me it is recommended to run this command runs regularly. At least once a week during the night hours because DBCC CHECKDB generates a lot of IO operations.

Here is my solution:

1) Create table CheckDB:

- This Proc save the result of DBCC CHECKDB(0) WITH TABLERESULTS to the table CheckDB in the first step.

I have created new job that consisted of 3 steps.

1 Step - Exec procedure DBCC_CHECKDB

2 Step - Delete rows when CreateDate is older than 2 months

3 Step - Send information mail with results

I hope you will find it as helpful as I do!

DBCC CHECKDB

 
 
 

Comments


RECENT POST
  • Grey Twitter Icon
  • Grey Facebook Icon
  • Grey LinkedIn Icon

© 2020 All rights reserved. PigeonSQL.com | Filip Holub

bottom of page