Home Forums SQL Server 2005 Administering DBCC CHECKDB - how use it in a maintenance plan ? RE: DBCC CHECKDB - how use it in a maintenance plan ?

  • Hi Gila,

    According from 'dbcc checkdb (dbname) with no_infomsgs.' , you said run

    that command before backup run. But my questions is, what do we do if I already setup a job like

    21:00 - dbcc checkdb (dbname) with no_infomsgs

    22:00 - DBCC BackupDB(DBname)

    23:00 - DBCC RebuildIndex

    1. How do we know database is corrupt before the Backup at 22:00? Job is already setup and backup the corrupt database anyway according from the JOB. Any way to stop that, NOT to backup?

    2. Which command can fix and repair the Database if 'dbcc checkdb' result is failed.

    3. Do you have any sample code to check database, run the db repair if needed then backup and rebuild DB?

    Thanks.