Database Maintenance in SQL Server 2005 Express – Integrity

Views 2133

Following on from my Blog on SQL Server Agent for SQL Server 2005 Express, this post is to run you through having confidence in the integrity of your databases. This is blog 2 of 3 on Database Maintenance in SQL Server 2005 Express.

Database Integrity

Database Integrity is the process of checking your logical and physical integrity of all of your objects in your database. To achieve this you utilise the command DBCC CheckDB which performs the following checks:·

  • DBCC CheckAlloc
  • DBCC CheckTable
  • DBCC CheckCatalog

You want to run this check prior to running your backups as discussed in Database Maintenance In SQL Server 2005 Express – Recoverability. If your database does have issues then you should be notified about this and resolve the issues prior to running your database backup. Otherwise you could potentially be backing up a corrupt database, that in the event of an issue and your needing to restore your database you could find yourself in the position of performing a restore of an invalid database.

As discussed in SQL Server Agent for SQL Server 2005 Express you can utilise SQLScheduler to schedule your job to run your integrity checks on a regular basis.

Feel free to download usp_CheckDB.sql to perform your Integrity checks.

Stay tuned for the next installment in Database maintenance in SQL Server 2005 Express – Performance

Leave a Reply

Your email address will not be published. Required fields are marked *

Warwick

I am a Microsoft Data Platform MVP as well as a Microsoft Certified Master working as the Principal Consultant here at SQL Masters Consulting. When I am not working with the SQL Server Stack I like to get away to the Snow and spend time Snowboarding.

Search