lsn学习

来源:互联网 发布:软件质量问题处理流程 编辑:程序博客网 时间:2024/05/01 09:07

if exists(select 1 from sys.tables where name='t')
    drop table t
go
DECLARE @LAST_LSN BINARY(10)

create table t(col int)
go
dbcc traceon(3505, -1)
go
checkpoint
go
select [Current LSN],[Previous LSN],[Previous Page LSN],PartitionId, Operation,Context,[Transaction ID],[Log Record Fixed Length],[Log Record Length]
from  sys.fn_dblog(null,null)
go
insert into  t values(1)--
go
--sql server need to allocate space for the new table
select [Current LSN],[Previous LSN],[Previous Page LSN],PartitionId, Operation,Context,[Transaction ID],[Log Record Fixed Length],[Log Record Length]
from  sys.fn_dblog(null,null)
go
checkpoint
go
insert into  t values(1)--
 go
--only insert operation
select [Current LSN],[Previous LSN],[Previous Page LSN],PartitionId, Operation,Context,[Transaction ID],[Log Record Fixed Length],[Log Record Length]
from  sys.fn_dblog(null,null)

原创粉丝点击