惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 聂微东
MyScale Blog
MyScale Blog
The GitHub Blog
The GitHub Blog
C
Check Point Blog
M
MIT News - Artificial intelligence
U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
H
Help Net Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
D
DataBreaches.Net
大猫的无限游戏
大猫的无限游戏
D
Docker
Last Week in AI
Last Week in AI
IT之家
IT之家
F
Fortinet All Blogs
A
About on SuperTechFans
P
Proofpoint News Feed
The Cloudflare Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
B
Blog RSS Feed
博客园_首页
月光博客
月光博客
博客园 - 司徒正美
Y
Y Combinator Blog

博客园 - stswordman

Tutorial: Add a node to SQL cluster on RHEL Tutorial: Create SQL Cluster(FCI) on RHEL Configure multiple-subnet Always On Availability Groups and failover cluster instances by modifying CIB Failed to restart Polybase Data Movement service after running sp_polybase_join_group Realcase: Failed to upgrade SQL Server 2016 SP2 CU11. (Installation success or error status: 1648) Connect SQL Server from Linux Client using Windows Authentication and troubleshoot steps Different AG groups have the exactly same group_id value if the group names are same and the ‘CLUSTER_TYPE = EXTERNAL/NONE’ An example of polybase for Oracle use azure data studio to create external table for oracle Missing MSI and MSP files You may fail to backup log or restore log after TDE certification/key rotation. Password is required when adding a database to AG group if the database has a master key Use KTPASS instead of adden to configure mssql.keytab Failed to run 'create login' or 'sp_addsrvrolemeber' in sql Linux using windows authentcation Sql Server Linux(Redhat) Distributed Availability Group Setup — step by step Example of SQL Linux Windows Authentication configuration using Managed Service Accounts FILESTREAM feature can't be enabled if you use cluster shared volumes “The subscription does not exist” when a distributor primary replica fails over to a replica that does not use the same agent profile The thumbprint of same asymmetric key is not same in 'SQL Server Connector for Microsoft Azure Key Vault' 1.0.4.0 and 'SQL Server Connector for Microsoft Azure Key
SQL Server does not purge row versioning records even the...
stswordman · 2019-02-22 · via 博客园 - stswordman

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.