Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
kpsreenath
Yak Posting Veteran
52 Posts |
Posted - 2006-02-13 : 18:11:36
|
Hi We have the regular maintenance plan running every sunday morning 12.00AM which does a checkdb with repair optionEverytime it fails saying that users are connected to the database and the database needs to be bought to single user mode.I checked the commands and found that the dbcc checkdb (without any repair option) doesnt need the database to be in single user mode.But then, every monday I need to check the dbcc output to see any errors and then do a fix accordingly. This is a tedious process as we have 9 production servers with the biggest server having 40 database.Is there any way out. Thanks in advanceSreenath |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2006-02-13 : 18:16:44
|
quote: checkdb with repair option
You should not have the repair option selected. If DBCC CHECKDB fails, a DBA should intervene to determine what to do next. After you un-select this option, you won't run into the problem anymore.Tara Kizeraka tduggan |
 |
|
kpsreenath
Yak Posting Veteran
52 Posts |
Posted - 2006-02-13 : 22:35:40
|
Thanks TaraHow do we know that the dbcc output has printed error messageswhen a checkdb fails, will it show as the job failure or will it just print error messages in the dbcc output and show the job successful?Sreenath |
 |
|
mallier
Starting Member
24 Posts |
Posted - 2006-02-14 : 07:58:19
|
Insert the output in a table. So u can analyse the output next day.see this example,Im using xp_cmdshell command here.CREATE TABLE checkdberror (Results varchar(255) NULL)INSERT INTO checkdberror(Results) EXEC('master..xp_cmdshell ''ISQL -E -Q"dbcc checkdb(pubs) WITH NO_INFOMSGS, ALL_ERRORMSGS"''')select * from checkdberror cheers,http://mallier.blogspot.com |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2006-02-14 : 12:07:13
|
If DBCC CHECKDB job fails, the job will show a failure.Tara Kizeraka tduggan |
 |
|
|
|
|