Path: csiph.com!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail From: Erland Sommarskog Newsgroups: comp.databases.ms-sqlserver Subject: Re: How to find not-committed transaction in SQL Server 2008 exactly? Date: Sun, 28 Apr 2013 11:26:03 +0200 Organization: Erland Sommarskog Lines: 35 Message-ID: References: <2e7b480a-ee84-4105-a3e4-b9297e4d9835@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Injection-Info: mx05.eternal-september.org; posting-host="78e2ae7e6764121e217a035f19bdb315"; logging-data="1337"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19nXdlwttGOXd3hckQY6ols" User-Agent: Xnews/2006.08.24 Mime-proxy/2.1.c.0 (Win32) Cancel-Lock: sha1:l/IsCzmMJVUl6jfQqNTwVUQ3b8Q= Xref: csiph.com comp.databases.ms-sqlserver:1457 Peng Liu (liupengwyy@gmail.com) writes: > 6. Finally, I run "DBCC OPENTRAN;", and get below: No active open > transactions. DBCC execution completed. If DBCC printed error messages, > contact your system administrator. > > So, according to what I test above, before step 6, it seems that there > is one transaction which is not committed, the session 53 has one > transaction (the "open_tran" value is 1), the status is "sleeping"; > However, step 6 also show that no transaction is not committed. They > seems conflict. I don't think so. Books Online says in the Remarks section for DBCC OPENTRAN: Use DBCC OPENTRAN to determine whether an open transaction exists within the transaction log. You have a transaction that this far has only read data, but has not performed any updates. Therefore it is not preventing the log from being truncated. > Besides, for the query text from step 5, is it possible for me to know > the exact value of the parameters P1, P2 and P3? Only if you have a trace running which captures the statement. -- Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se Links for SQL Server Books Online: SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx