MOSS: Excessive Sync errors on Sharepoint 2007 Front End Web Server
In several MOSS deployments with multiple front ends, I have noticed many sync issues in the event logs.
A runtime exception was detected. Details follow.
Message: Cannot insert duplicate key row in object 'dbo.UserMemberships' with unique index 'CX_UserMemberships_RecordId_MemberGroupId_SID'.
The statement has been terminated.
Techinal Details:
System.Data.SqlClient.SqlException: Cannot insert duplicate key row in object 'dbo.UserMemberships' with unique index 'CX_UserMemberships_RecordId_MemberGroupId_SID'.
The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Microsoft.Office.Server.Data.SqlSession.ExecuteNonQuery(SqlCommand command)
at Microsoft.Office.Server.UserProfiles.WSSSynchSqlSession.SynchExecuteNonQuery(SqlCommand cmd, Boolean throwOnFail)
at Microsoft.Office.Server.UserProfiles.WSSSynchSqlSession.SynchExecuteNonQuery(SqlCommand cmd)
at Microsoft.Office.Server.UserProfiles.SiteSynchronizer.WriteChangeLogConsumed()
at Microsoft.Office.Server.UserProfiles.SiteSynchronizer.Synch()
at Microsoft.Office.Server.Diagnostics.FirstChanceHandler.ExceptionFilter(Boolean fRethrowException, TryBlock tryBlock, FilterBlock filter, CatchBlock catchBlock, FinallyBlock finallyBlock)
stsadm -o sync -listolddatabases 0
You can then use this information to query SQL and see which databases are having issues. OR, you can use this VBS script to get the information:
Set Args = WScript.Arguments
Connstr = "Driver={SQL Server};Server=SQL2005;Database=Config_DB"
Set Connect = CreateObject("ADODB.Connection")
Connect.Open Connstr
strInput = Args.Item(0)
Set DB = Connect.Execute("SELECT Id, ClassId, Name, Status, Version, Properties FROM Objects WHERE (Id = '" & strInput & "')")
Do Until DB.Eof
WScript.Echo Db("Id")
WScript.Echo Db("ClassId")
WScript.Echo Db("Name")
WScript.Echo Db("Status")
WScript.Echo Db("Version")
'WScript.Echo Db("Properties")
DB.MoveNext
Loop
stsadm -o sync -deleteolddatabases 0
stsadm -o preparetomove -contentdb -contentdb : -site
stsadm -o deletecontentdb -url -databaseserver -databasename
To reattach:stsadm -o addcontentdb -url
I hope that saves someone else some time.
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader or join our newsletter and receive future articles emailed directly to you.



Comments
No comments yet.
Leave a comment