[英]Can I trace database's records by SQL query from log file?
I need to trace changes on a record in database. 我需要跟踪数据库中记录的更改。 I have some triggers on different tables that calls one stored procedure and this sp updates records in certain table (table1).
我在不同的表上有一些触发器,这些触发器调用一个存储过程,并且此sp更新了某些表(table1)中的记录。
I will trace records in table1 to find when and from where data are changed. 我将跟踪table1中的记录,以查找何时以及从何处更改数据。
Actually I use sybase 12.5 and I would know how to read LOG file by SQL query in sybase or sql server. 实际上我使用的是sybase 12.5,我会知道如何通过sybase或sql server中的SQL查询读取LOG文件。
tanx :) 坦克斯:)
I don't think we can read transaction log using sql query unless there is some tools like Fog Light 我认为除非有Fog Light之类的工具,否则我们无法使用sql查询读取事务日志
As far as I know we can use DBCC command 据我所知,我们可以使用DBCC命令
DBCC LOG([,{0|1|2|3|4}]) DBCC LOG([,{0 | 1 | 2 | 3 | 4}])
0 - Basic Log Information (default) 0-基本日志信息(默认)
1 - Lengthy Info 1-详细信息
2 - Very Length Info 2-非常长的信息
3 - Detailed 3-详细
4 - Full 4-满
Also if this is gonna be permanent scenario, I would create a history table to audit update and delete changes. 同样,如果这将是永久的情况,我将创建一个历史表来审核更新和删除更改。 Hope I helped, sorry if I don't answer your question.
希望我能帮助您,如果我不回答您的问题,对不起。
我认为跟踪变更的唯一方法几乎就是编写触发器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.