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里面都排好 ...
随机推荐
- java validate date
public boolean isDateValidDDMMYYYY(String date) { String DATE_FORMAT = "ddMMyyyy"; try { D ...
- 10个非常有趣的Linux命令【转载】
Linux当中有很多比较有趣的命令,可以动手看看,很简单的. 1.rev命令 一行接一行地颠倒所输入的字符串. 运行: $rev 如输入:shiyanlou shiyanlou rev.jpg 2.a ...
- 在addroutes后,$router.options.routes没有更新的问题(手摸手,带你用vue撸后台 读后感)
参照<着手摸手,带你用vue撸后台>一文,本人做了前端的权限判断 https://segmentfault.com/a/1190000009275424 首先就是在addroutes后,$ ...
- Lucene入门实例-CRUD
1.导入jar包 lucene-analyzers-common-7.6.0.jar lucene-analyzers-smartcn-7.6.0.jar lucene-core-7.6.0.jar ...
- 基于CC2530/CC2430 的光强采集系统--ADC实验
使用光敏电阻,程序通用所有模拟量传感器 参见论坛中实例视频讲解http://bphero.com.cn/forum.php?mod=viewthread&tid=15&extra=pa ...
- js中使用将json数组 转换为json将一个包含对象的数组用以创建一个包含新重新格式化对象的新数组
1.使用reduce: let arr = [{ "code": "badge", "priceList": [{ "amount ...
- CodeForce VKcup B
题目描述:给了n个单词和m,还有一堆YES和NO表示在序列1-m,2-(m+1),3-(m+2)......中是否存在重复的单词,没重复的是YES,有重复的是NO 题目链接:点我 如果是NO的话,就使 ...
- Yii2 表单(form)
表单 1.表单的创建 在 yii 中主要通过 yii\widgets\ActiveForm 类来创建表单 ActiveForm::begin() 不仅创建了一个表单实例,同时也标志着表单的开始. 放在 ...
- IE内核浏览器的404页面问题和IE自动缓存引发的问题
本站404页面被IE替换成IE自己的404页面 在权限设置正确的情况下,自定义的404页面文件大小如果小于512字节,那么IE内核的浏览器会认为你自定义的404页面不够权威,从而使用其自带的404页面 ...
- ‘百度杯’十月场web ---login
首先一看的题,既然是是web类的,就要查看源码,一看,最先有一行注释,估摸着是用户名和密码 果然登录上去了,显示一段乱码,源码也没有什么东西, 那就抓一次包吧 发现响应头里边有个show:0的响应,而 ...