Running a server audit script picked up Integrity Checks as not having occurred. My audit script uses this piece of code to get the date.
CREATE TABLE #temp ( [ParentObject] VARCHAR(255) , [Object] VARCHAR(255) , Field VARCHAR(255) , [Value] VARCHAR(255) ) INSERT INTO #temp EXECUTE ('DBCC DBINFO WITH TABLERESULTS') SELECT DISTINCT Value AS DBCCDate FROM #temp WHERE Field = 'dbi_dbccLastKnownGood'
There are 2 caveats with this code
- It only works on SQL 2005+
- It needs DISTINCT in the select statement to run on SQL 2008 (where a bug means the date is reported twice).
It turns out the client were running SQL 2005 SP2, build 9.00.3042.
In this build there is a bug re; integrity checks failing in maintenance plans.
No comments:
Post a Comment