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里面都排好 ...
随机推荐
- 【Spring Boot】使用JDBC 获取相关的数据
使用JDBC 获取相关的数据 什么是JDBC Java Database Connectivity 是一种用于执行SQL语句的Java API,与数据库建立连接.发送 操作数据库的语句并处理结果. S ...
- 003.MongoDB主要概念
一 对比关系 SQL术语/概念 MongoDB术语/概念 解释/说明 database database 数据库 table collection 数据库表/集合 row document 数据记录行 ...
- mysql(三) 数据表的基本操作操作
mysql(三) 数据表的基本操作操作 创建表,曾删改查,主键,外键,基本数据类型. 1. 创建表 create table 表名( 列名 类型 是否可以为空, 列名 类型 是否可以为空 )ENGIN ...
- MAVEN 加载公共包 commons
<dependency> <groupId>commons-fileupload</groupId> <artifactId>commons-fileu ...
- C# LnkHelper
using System; using System.Collections.Generic; using System.Text; using Microsoft.Win32; using Syst ...
- vue-router那些事儿
vue-router适用于单页面应用. 一.vue-router的引用方法1.用script标签 <script src="https://unpkg.com/vue-router/d ...
- Cisco 12系列 AP 初始化配置-2-初始化配置
用于SSH登陆这个设备 bridge irb bridge 1 route ip 开启路由功能 interface BVI1 ip address 10.15.106.44 255.255.255. ...
- GBT 31000-2015 社会治安综合治理基础数据规范 数据项 编码
动态掌握 各级 综治组织 和 队伍建设 情况. 对 综治组织建设和其他业务 进行 统计. -- 数据描述 包括 序号 数据项名称 数据项类型 数据项长度 是否必填 相关条文和标准 -- 综治机构 包 ...
- CentOS 7 安装MongoDB详细步骤
创建/etc/yum.repos.d/mongodb-org-4.0.repo文件,编辑内容如下: [mongodb-org-4.0] name=MongoDB Repository baseurl= ...
- [HNOI2010]平面图判定
Description: 若能将无向图 \(G=(V, E)\) 画在平面上使得任意两条无重合顶点的边不相交,则称 \(G\) 是平面图.判定一个图是否为平面图的问题是图论中的一个重要问题.现在假设你 ...