In Microsoft SQL Server 2005, you configure a merge publication. When you run the Merge Agent, a blocking issue occurs. When you monitor the blocking issue, you find the following behaviors:
- In the output of the blocking script that you created to monitor this issue, some threads that are running replication stored procedures are blocked. For example, you may notice that the blocked threads are running the following replication stored procedures:
- The sp_MSinsertgenhistory stored procedure
- The sp_MSgetmakegenerationappl stored procedure
- The sp_MSenumgenerations stored procedure
Note You can also find the threads that are blocked by using the Activity Monitor in SQL Server Management Studio.
For more information about how to monitor an issue by creating a blocking script, click the following article number to view the article in the Microsoft Knowledge Base:
271509
(http://support.microsoft.com/kb/271509/
)
How to monitor blocking in SQL Server 2005 and in SQL Server 2000
- In a SQL Server trace, a transaction that is opened through the sp_mergemetadataretentioncleanup stored procedure may still be running even though the stored procedure that calls the sp_mergemetadataretentioncleanup stored procedure has completed. Additionally, you may find an Attention event in the transaction. The stored procedure that calls the sp_mergemetadataretentioncleanup stored procedure may be one of the following stored procedures:
- The sp_MSinsertgenhistory stored procedure
- The sp_MSgetmakegenerationappl stored procedure
- The sp_MSenumgenerations stored procedure.
For example, you may find records that resemble the following in the SQL Server trace:Collapse this tableExpand this table
| EventClass
| TextData
| ObjectName
| DBID
| TransactionID
| HostName
| ClientProcessID | ApplicationName
| SPID
|
| RPC:Completed
| exec sp_MSenumgenerations 1051201,'9B9CC268-A43A-4736-9481-0B99227C3BF0',1
| sp_Msenumgenerations
| 5
| 525491216
| HostName | 1896
| ApplicationName | 69 |
Collapse this tableExpand this table
| EventClass
| TextData
| ObjectName
| DBID
| TransactionID
| HostName
| ClientProcessID | ApplicationName
| SPID
|
| SP:StmtCompleted | begin transaction | sp_mergemetadataretentioncleanup | 5
| 525491216
| HostName | 1896
| ApplicationName | 69 |
| SP:StmtStarting | select NULL from dbo.MSmerge_contents with(TABLOCK ,HOLDLOCK) where 1=2 | sp_mergemetadataretentioncleanup | 5
| 525491216
| HostName | 1896
| ApplicationName | 69 |
Collapse this tableExpand this table
| EventClass
| TextData
| ObjectName
| DBID
| TransactionID
| HostName
| ClientProcessID | ApplicationName
| SPID
|
| Attention | | | 5
| 525491216
| HostName | 1896
| ApplicationName | 69 |
This issue occurs because the merge metadata cleanup process does not set the XACT_ABORT option to ON for the transaction. When the sp_mergemetadataretentioncleanup stored procedure is running, if an unexpected exception such as a network issue occurs, the transaction is not rolled back. When the transaction is not rolled back, the lock resources that are held by the transaction is not released.
Service pack information
To resolve this problem, obtain the latest service pack for SQL Server 2005. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
913089
(http://support.microsoft.com/kb/913089/
)
How to obtain the latest service pack for SQL Server 2005
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. This problem was first corrected in SQL Server 2005 Service Pack 3.
For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:
824684
(http://support.microsoft.com/kb/824684/LN/
)
Description of the standard terminology that is used to describe Microsoft software updates
Article ID: 959023 - Last Review: December 16, 2008 - Revision: 1.0
APPLIES TO
- Microsoft SQL Server 2005 Standard Edition
- Microsoft SQL Server 2005 Developer Edition
- Microsoft SQL Server 2005 Enterprise Edition
- Microsoft SQL Server 2005 Standard X64 Edition
- Microsoft SQL Server 2005 Standard Edition for Itanium-based Systems
- Microsoft SQL Server 2005 Enterprise X64 Edition
- Microsoft SQL Server 2005 Enterprise Edition for Itanium-based Systems
- Microsoft SQL Server 2005 Workgroup Edition
| kbsql2005repl kbexpertiseadvanced kbtshoot kbfix kbbug KB959023 |