January 18, 2012 at 12:35 am
Hi Folks,
I've not created or automated any job to do run DBCC CHECKDB. But i noticed that DBCC CHECKDB is running on daily basis. This will consume lot of physical memory that time.
How can i know where exactly and who is using this command in my SQL SERVER 2005.
January 18, 2012 at 12:43 am
You can use Profiler for this purpose.
Check whether AutoClose property is ON for this DB.
January 18, 2012 at 1:05 am
SQL error log should tell you which SQL account was used to run it.
Regards,
Raj
January 18, 2012 at 2:00 am
Thanks a lot for quick response.
Autoclose option is set to false.Now i started profiler to check.
I can't find any thing from SQL ErrorLogs.
January 18, 2012 at 2:02 am
Your errorlog should say
DBCC CHECKDB (<db name>) executed by sa found 0 errors and repaired 0 errors. Elapsed time: 0 hours 0 minutes 47 seconds.
Regards,
Raj
January 18, 2012 at 3:02 am
No I didn't find any thing in errorlogs about DBCC CHECKDB.
DBCC CHECKDB was last executed on 2012-01-17(i.e., yesterday). But since 13/12/2011 there are no error logs..
January 18, 2012 at 3:22 am
MasterDB (1/18/2012)
I've not created or automated any job to do run DBCC CHECKDB.
Why not? You should IMHO.
-- Gianluca Sartori
January 18, 2012 at 3:55 am
MasterDB (1/18/2012)
I've not created or automated any job to do run DBCC CHECKDB. But i noticed that DBCC CHECKDB is running on daily basis.
Why do you think it's running daily?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
January 18, 2012 at 4:17 am
I got a query, which results when DBCC CHECKDB was ran last time. so that i came to know it was executed yesterday.
January 18, 2012 at 4:30 am
And that query is?????
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
January 18, 2012 at 4:31 am
Firstly I think you should be automating your CHECKDB.
Secondly, if you saying it's not in the log but your query say's it has been run then that's odd.
The way I check this is by using the following;
DBCC dbinfo('DatabaseName) WITH TABLERESULTS
Then look for the record with a field value equal to 'dbi_dbccLastKnownGood'.
Can you confirm what the date is that this was last run?
Edit
-----
As Gail points out, can you show us your query?
January 18, 2012 at 4:44 am
IF OBJECT_ID('tempdb..#CheckDB') IS NOT NULL
DROP TABLE #CheckDB
CREATE TABLE #CheckDB (LogDate DATETIME, ProcessInfo VARCHAR(50), [Text] VARCHAR(500))
INSERT #CheckDB
EXEC XP_READERRORLOG 0, 1, 'CheckDB'
SELECT SUBSTRING([Text], 23, CHARINDEX( '''',[Text],23)-23) AS DatabaseName,
SUBSTRING([Text], CHARINDEX( '2',[Text],PATINDEX('%errors%', [Text])), 23) AS LastCheckDBRanDate
FROM #CheckDB
WHERE [Text] LIKE 'CHECKDB for database%'
UNION
SELECT SUBSTRING([Text], 15, CHARINDEX( ')',[Text],15)-15) AS DatabaseName,
LogDate AS LastCheckDBRanDate
FROM #CheckDB
WHERE [Text] LIKE 'DBCC CHECKDB%'
DROP TABLE #CheckDB
January 18, 2012 at 4:53 am
And for one database that shows yesterday?
Sure there's no maint plan that someone set up? (btw, CheckDB daily is a good idea)
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
January 18, 2012 at 5:07 am
MasterDB (1/18/2012)
Thanks a lot for quick response.Autoclose option is set to false.Now i started profiler to check.
I can't find any thing from SQL ErrorLogs.
I'm a little confused, you said the error log had no mention of the CHECKDB or who ran it?
If so then how does the xp_readerrorlog work? Is it possible that you could have a maintenance plan on another server that is running the check on this server?
Viewing 14 posts - 1 through 13 (of 13 total)
You must be logged in to reply to this topic. Login to reply