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里面都排好 ...
随机推荐
- LoRaWAN 1.1 网络协议规范 - 5 MAC指令
LoRaWAN 1.1 网络协议规范 LoRaWAN 1.1 版本封稿很久了也没有完整啃过一遍,最近边啃边翻译,趁着这个机会把它码下来. 如果觉得哪里有问题,欢迎留言斧正. 翻译不易,转载请申明出处和 ...
- 解决VS打开文件出现No EditorOptionDefinition export found for the given option name问题
转载自http://stackoverflow.com/questions/23893497/no-editoroptiondefinition-export-found-error的第一个回答 Af ...
- Android视图动画集合AndoridViewAnimations
Android视图动画集合AndoridViewAnimations Android视图动画是针对视图对象的动画效果,包括对象平移.旋转.缩放和渐变四种类型.通过组合这四种类型,可以创建出无数种动画效 ...
- vue注册和简单使用
组件的出现就是为了解决页面布局等等一些列的问题. vue中的组件分为两种,全局组件和局部组件. 一 . 注册全局组件 通过Vue.component()创建一个全局组件之后,我们可以在一个通过 ...
- React-Redux使用方法
React-Redux使用方法 理解 在React项目中使用react-redux,可以让你更方便的使用redux,原理是在index.js中注册app时用一个<Povider>标签嵌套, ...
- [P1396]营救 (并查集)
大佬都是用最短路做的 我用最小生成树 #include<bits/stdc++.h> #include<algorithm> using namespace std; stru ...
- 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第4章编程练习2
#include <iostream>#include <string>int main(){ using namespace std; string name; string ...
- 编程菜鸟的日记-初学尝试编程-寻找2到n之间的素数并输出
//输入一个整数n,输出2到n之间的具体素数值 #include <iostream> #include <algorithm> #include <cmath> ...
- 如何修改PHP的memory_limit限制
在运行PHP程序,通常会遇到“Fatal Error: Allowed memory size of xx bytes exhausted”(允许内存大小为 xx 字节耗尽)的错误, 这个意味着PHP ...
- asp.net缓存 (转)
原文地址 http://www.cnblogs.com/knowledgesea/archive/2012/07/10/2530436.html 谢谢 一.缓存概念,缓存的好处.类型. ...