把read_committed_snapshot 选项打开:
alter database law set read_committed_snapshot on
当数据库处于read committed隔离级别时,与Oracle数据库中的效果相同,这时,update操作的旧数据会保存在tempdb中称为version store的部分,在Oracle数据库,这些旧数据会保存在undo表空间。只要事务不提交,其他连接可以看到update之前的旧数据。下面查询中的version_store_reserved_page_count字段可以得到tempdb中version store所占的空间大小:
select * from sys.dm_db_file_space_usage
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/37724/viewspace-152601/ ,如需转载,请注明出处,否则将追究法律责任。