sqlserver 如何利用fn_dblog( )函数进行日志解析?

wh5700057 2013-08-05 11:29:27
利用fn_dblog函数可以查看用户所操作的所有MDL操作,但是此记录在表里是以16进制值来呈现的,请问大神们怎么将它转换成明文。
...全文
1572 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
nogos 2015-09-20
  • 打赏
  • 举报
回复
参看:http://blog.csdn.net/sunxianghuang/article/details/48576395
lbhnrg2021 2013-09-07
  • 打赏
  • 举报
回复
我个人觉得还是放弃,这些东西microsoft不公开的,只能自己摸索,很困难,做了测试;我觉得log explorer很可能不是用fn_dblog做出来的,因为checkpoint对log explorer毫无作用,而fn_dblog在checkpoint以后,前面的记录全部select不出来,数据库是FULL恢复模式,很早前就有人说过fn_dblog很可能不是log explorer的核心,至于数据解析,看下面: 说明地址:http://raresql.com/2011/10/22/how-to-recover-deleted-data-from-sql-sever/ 这段就是分析逻辑 [Fixed Length Data] = Substring (RowLog content 0, Status Bit A+ Status Bit B + 1,2 bytes) [Total No of Columns]= Substring (RowLog content 0, [Fixed Length Data] + 1,2 bytes) [Null Bitmap length] = Ceiling ([Total No of Columns]/8.0) [Null Bytes]= Substring (RowLog content 0, Status Bit A+ Status Bit B + [Fixed Length Data] +1, [Null Bitmap length] ) Total no of variable columns = Substring (RowLog content 0, Status Bit A+ Status Bit B + [Fixed Length Data] +1, [Null Bitmap length] + 2 ) Column Offset Array= Substring (RowLog content 0, Status Bit A+ Status Bit B + [Fixed Length Data] +1, [Null Bitmap length] + 2 , Total no of variable columns*2 ) Variable Column Start = Status Bit A+ Status Bit B + [Fixed Length Data] + [Null Bitmap length] + 2+( Total no of variable columns*2)
最爱午夜 2013-08-06
  • 打赏
  • 举报
回复
那你得会解析二进制文件,要不还真不好办
wh5700057 2013-08-05
  • 打赏
  • 举报
回复
log explorer这个工具我用了,的确是可以分析出日志。但是我想用代码写一个分析日志的工具,所以必须手动解析出来,或者怎么让我的代码能去连log explorer?
Shawn 2013-08-05
  • 打赏
  • 举报
回复
--第三方工具: log explorer --自己解析:http://wenku.baidu.com/view/b9a759bfc77da26925c5b065.html

22,297

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧