用sql语句dbcc log 查看SQL Server 数据库的事务日志

 

 

1)用系统函数

SELECT allocunitname,operation,[RowLog Contents 0] as r0,[RowLog Contents 1] as r1
FROM::Fn_dblog(null,null)
where allocunitname like'dbo.TArea%'
and operation in('LOP_INSERT_ROWS','LOP_DELETE_ROWS')

 


2)用DBCC

DBCC log('hrdb', TYPE=2)

 

 

dbcc log(dbname,4)       --(n=0,1,2,3,4)

1 - 更多信息plus flags, tags, row length

2 - 非常详细的信息plus object name, index name,page id, slot id

3 - 每种操作的全部信息

4 - 每种操作的全部信息加上该事务的16进制信息


默认 type = 0

相关文章:

  • 2022-12-23
  • 2022-01-09
  • 2021-06-06
  • 2022-12-23
  • 2022-12-23
  • 2021-12-11
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-01
  • 2021-11-05
  • 2021-05-19
  • 2022-12-23
  • 2021-08-14
  • 2022-12-23
  • 2021-06-29
相关资源
相似解决方案