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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Problem with CheckDB - SQL Server 2005

Author  Topic 

WindChaser
Posting Yak Master

225 Posts

Posted - 2008-03-27 : 21:36:18

I've just converted from SQL Server 2000 to 2005 and I'm encountering a few issues, as would be expected when migrating from one environment to another.

In particular, I have a service which periodically issues a simple "DBCC CheckDB" during the day against a database which is constantly in use. With SQL Server 2000, everything worked fine. On my station which has SQL Server 2005 Developer edition, again everything is working fine. However, on a test station which has SQL Server 2005 Express, the operation fails with "The database could not be exclusively locked to perform the operation.".

Given that I'm not requesting any tab locks, I suppose that the exclusive locks are being required because a snapshot cannot be created. Question is: why on SQL Server Express and not anything else? Is this a configuration issue?

Any thoughts would be appreciated.

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-03-27 : 23:29:08
Is the db being used by other processes? By the way, you shouldn't check db during the day in first place unless in emergency.
Go to Top of Page

WindChaser
Posting Yak Master

225 Posts

Posted - 2008-03-27 : 23:58:31
The DB is not checked during the day. As indicated, the datatase is constantly in use 24/24.
Go to Top of Page

WindChaser
Posting Yak Master

225 Posts

Posted - 2008-03-28 : 16:24:01
Actually, is there a way to simply bypass the exclusive lock requirement? It has to be possible otherwise the DB has to be made unavailable to users during the diagnostic check, which wouldn't make much sense in many worldwide applications.
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-03-29 : 00:14:51
It needs exclusive lock on thable be checked.
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2008-03-29 : 07:54:44
I thought DBCC CheckDB does a table schema lock - which prevents things like build clustered index , truncate table etc , but still allows the data changes

Jack Vamvas
--------------------
Search IT jobs from multiple sources- http://www.ITjobfeed.com
Go to Top of Page

WindChaser
Posting Yak Master

225 Posts

Posted - 2008-03-29 : 09:03:20
jacky: Me too.

Let me repeat that on my computer which has a SQL Server 2005 Developer Edition, everything works fine and I can do a CheckDB while the DB is in use. The problem only occurs on SQL Server 2005 Express. Why? What is the variation in parameter configuration between editions that would cause this?
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-03-29 : 22:05:59
Not really, I got this issue several times. Dbcc checkdb blocked data change and I had to cancel it.
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2008-03-30 : 13:55:45
Windchaser , firstly , could you check that there are no read only files , and secondly , ensure there are no other connections , then run DBCC CHECKDB

Jack Vamvas
--------------------
Search IT jobs from multiple sources- http://www.ITjobfeed.com
Go to Top of Page
   

- Advertisement -