July 9, 2009 at 5:19 am
SQL Instance details:
SQL Server 2005 Enterprise Edition x64 with SP2.
Windows OS Details:
Windows 2003 Enterprise Edition x64 with SP2
This SQL instance hosts a single 60 GB database. I have setup a maintenance plan to check the database integrity, database backup, transaction log backup.
When i check the history of this plan i see that the database integrity check task runs for couple of seconds, less than a minute. But, when i run the DBCC CHECKDB (DBNAME) via a query window, it runs for several minutes. I believe the database integrity task in fact runs DBCC CHECKDB(). Then, why is there such a difference in the execution time?
Any reason for this?
Thank you
Ravi
July 10, 2009 at 1:50 am
Because it runs with option like "with physical only".
Chack the Error log with same timestamp and see the complete command ..
Regards
Abhay Chaudhary
Sr.DBA (MCITP/MCTS :SQL Server 2005/2008 ,OCP 9i)
July 14, 2009 at 12:45 am
I have checked the T-SQL of the Check Database Integrity task and it doesn't have the "with PHYSICAL_ONLY". This is the T-SQL of the task:
USE [PRD]
GO
DBCC CHECKDB WITH NO_INFOMSGS
GO
July 15, 2009 at 8:45 am
DBCC CHECKDB() --> this is executing in the default database which is probable master
That is why it is so quick. Whereas ...
DBCC CHECKDB(yous_database_name) --> is performing the DBCC on the database you wish to check !
RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."
July 15, 2009 at 9:57 am
Hello Rudy,
Sorry, DBCC in both the situations is running on the user database 'PRD'.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply