Login or Sign Up to become a member!
LessThanDot Sit Logo

LessThanDot

A Technical Community for IT Professionals

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.

LTD Social Sitings

Lessthandot twitter Lessthandot Linkedin Lessthandot friendfeed Lessthandot facebook Lessthandot rss

Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.

Highly Rated Users

Forum
No Posts Rated

Top 50
Given
Received

Links

Wiki
Blog

Forum Statistics

Users
Members:
543
Members Online:
10
Guests Online:
5

Total Post History
Posts:
45705
Topics:
9398

7-Day Post History
New Posts:
342
New Topics:
80
Active Topics:
90

Our newest member
sangeeta

Other

FAQ
All times are UTC [ DST ]

Google Ads

Database Mirroring Error SQL 2005

Please wait...

Database Mirroring Error SQL 2005

Postby ptheriault on Tue Sep 01, 2009 3:21 pm

You may encounter the following errors in you log file while mirroring databases in SQL 2005 SP2 or earlier
Message
Error: 17066, Severity: 16, State: 1.

SQL Server Assertion: File: <loglock.cpp>, line=818 Failed Assertion = 'result == LCK_OK'. This error may be timing-related. If the error persists after rerunning the statement, use DBCC CHECKDB to check the database for structural integrity, or restart the server to ensure in-memory data structures are not corrupted.

Error: 3624, Severity: 20, State: 1.
A system assertion check has failed. Check the SQL Server error log for details. Typically, an assertion failure is caused by a software bug or data corruption. To check for database corruption, consider running DBCC CHECKDB. If you agreed to send dumps to Microsoft during setup, a mini dump will be sent to Microsoft. An update might be available from Microsoft in the latest Service Pack or in a QFE from Technical Support.

These errors are terminal to database mirroring. You will need to re-create database mirroring from a fresh backup.

The error message states you should run DBCC CHECKDB to check the database for errors. However, you can NOT run DBCC CHECKDB on a database that is currently in a restoring state. Which is the case with the partner db of a mirror.

The root cause of the error is the use of sp_getappLock and sp_releaseapplock in the principal db. The lock is not properlly released by sp_releaseapplock and the mirror db can not apply the mirror transaction. You may want to check you database objects for the use of those system procedures.
Microsoft recommends not using sp_getapplock and sp_releaseapplock if it can be helped. These system procedures will lock the code so it can only run concurrently.

Microsoft states that the error is fixed in CU8 and SP3.

http://support.microsoft.com/kb/953625/LN/

50002736 953625 http://support.microsoft.com/kb/953625/LN/
FIX: Error message when SQL Server 2005 synchronizes a mirrored database: "Expression: result == LCK_OK"
--Paul
--If at first you don't succeed destroy all evidence that you tried.
User avatar
ptheriault
LTD Admin
LTD Admin
LTD Bronze - Rating: 98LTD Bronze - Rating: 98
 
Posts: 545
Joined: Thu Oct 11, 2007 6:28 pm
Location: Warwick, RI

Re: Database Mirroring Error SQL 2005

Postby SQLDenis on Tue Sep 01, 2009 3:27 pm

People would use sp_getapplock to create a kind of singleton object in SQL Server...I have never seen it in code
User avatar
SQLDenis
LTD Admin
LTD Admin
LTD Gold - Rating: 1467LTD Gold - Rating: 1467LTD Gold - Rating: 1467LTD Gold - Rating: 1467LTD Gold - Rating: 1467
LTD Gold - Rating: 1467LTD Gold - Rating: 1467LTD Gold - Rating: 1467LTD Gold - Rating: 1467LTD Gold - Rating: 1467
LTD Gold - Rating: 1467
 
Posts: 11780
Joined: Wed Oct 10, 2007 6:43 pm
Location: Princeton, New Jersey, USA,World, Solar System, Milky Way, Universe and Beyond
Unrated