SQL Server does not purge row versioning records even the transaction are committed if there are other open transaction running in the databases with read-committed snapshot enabled .
This is a by-design behavior. There is only one allocation unit in tempdb that is
tracking the versioned records across the server. Cleanup of this allocation
unit is decided by the oldest transaction of READ_COMMITTED_SNAPSHOT enabled
database. SQL Server won’t remove row
versioning records of all databases greater than the oldest transaction until
it commits or rollback.
Here is an example
Database db1 and db2 have read_committed_snapshot enabled.
1)session 1
use db1
begin tran
select *From table1DB1
2)session 2
use db2
update table1DB2 set c1=c1+1
Then the SQL Server does not remove the row versioning records of session 2 until session 1 transaction commit rollback.
Then we start an new transaction
3)Session 3
use db1
begin tran
select * from table2DB1
4)Session 4
use db2
update table1DB2 set c1=c1+1
if Session 1 is commit right now.
The row versioning records of session 2 will be removed by SQL Server.
However,The row versioning records of session 4 will not be removed by SQL Server, because transaction in session 3 is still there.
SQL Server does not purge row versioning records even the transaction are committed if there are other open transaction running in the databases with read-committed snapshot enabled .的更多相关文章
- SQL Server中如何定位Row Lock锁定哪一行数据
在SQL Server中有时候会使用提示(Hint)强制SQL使用行锁(Row Lock),前两天有个同事咨询了一个问题,如何定位Row Lock具体锁定了哪一行.其实这个问题只适合研究一下,实际意义 ...
- SQL Server 2008性能故障排查(四)——TempDB
原文:SQL Server 2008性能故障排查(四)--TempDB 接着上一章:I/O TempDB: TempDB是一个全局数据库,存储内部和用户对象还有零食表.对象.在SQLServer操作过 ...
- Microsoft SQL Server Trace Flags
Complete list of Microsoft SQL Server trace flags (585 trace flags) REMEMBER: Be extremely careful w ...
- Microsoft SQL Server Version List [sqlserver 7.0-------sql server 2016]
http://sqlserverbuilds.blogspot.jp/ What version of SQL Server do I have? This unofficial build ch ...
- Microsoft SQL Server Version List(SQL Server 版本)
原帖地址 What version of SQL Server do I have? This unofficial build chart lists all of the known Servic ...
- 《SQL Server 2012 T-SQL基础》读书笔记 - 9.事务和并发
Chapter 9 Transactions and Concurrency SQL Server默认会把每个单独的语句作为一个事务,也就是会自动在每个语句最后提交事务(可以设置IMPLICIT_TR ...
- 非常全面的SQL Server巡检脚本来自sqlskills团队的Glenn Berry 大牛
非常全面的SQL Server巡检脚本来自sqlskills团队的Glenn Berry 大牛 Glenn Berry 大牛会对这个脚本持续更新 -- SQL Server 2012 Diagnost ...
- SQL Server Lock Escalation - 锁升级
Articles Locking in Microsoft SQL Server (Part 12 – Lock Escalation) http://dba.stackexchange.com/qu ...
- SQL Server 2008性能故障排查(二)——CPU
原文:SQL Server 2008性能故障排查(二)--CPU 承接上一篇:SQL Server 2008性能故障排查(一)--概论 说明一下,CSDN的博客编辑非常不人性化,我在word里面都排好 ...
随机推荐
- Service Discovery And Health Checks In ASP.NET Core With Consul
在这篇文章中,我们将快速了解一下服务发现是什么,使用Consul在ASP.NET Core MVC框架中,并结合DnsClient.NET实现基于Dns的客户端服务发现 这篇文章的所有源代码都可以在G ...
- RabbitMQ实战经验分享
前言 最近在忙一个高考项目,看着系统顺利完成了这次高考,终于可以松口气了.看到那些即将参加高考的学生,也想起当年高三的自己. 下面分享下RabbitMQ实战经验,希望对大家有所帮助: 一.生产消息 关 ...
- RFC2616-HTTP1.1-Status Code(状态码规定部分—译文)
part of Hypertext Transfer Protocol -- HTTP/1.1 RFC 2616 Fielding, et al. 10 状态码规定(Status Code Defin ...
- curl get请求添加header头信息
function get($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPGET, true); curl_setopt($ch, CU ...
- 给json对象去除重复的值
给数组去除重复值 Array.prototype.distinct = function() { var arr = this, result = [], i, j, len = arr.length ...
- JDK 1.8 新特性
default 函数式接口 待总结
- 产品开发- DFX
一.DFE(Design for Environment)面向环境的设计 二.DFM(Design for Manufacture)面向制造的设计 DFM的最终设计的主要目的是对产品成本的控制,主要包 ...
- mysql存储过程相关记录
一个标准的存储过程创建语句 CREATE PROCEDURE myTestPro ( ), OUT rtv ) ) BEGIN SET rtv = text; END; 这个存储过程有一个输入参数以及 ...
- LOJ #10084. 「一本通 3.3 练习 1」最小圈(二分+SPFA判负环)
题意描述: 见原LOJ:https://loj.ac/problem/10084 题解: 假设所求的平均最小值为X,环上各个边的权值分别为A1,A2...Ak,可以得到: X=(A1+A2+A3+.. ...
- JS 正则表达式深入
1.零宽断言 断言指正则表达式可以指明在指定的内容前面或后面会出现满足规则的内容 零宽指的是断言只是匹配的表达式,不占据宽度,也不会出现在返回的匹配结果中 "<span class=& ...