如何知道表何时从变更数据捕获 (CDC) 中删除或添加到其中?
SQL Server 2008 具有更改数据捕获功能,允许捕获表中所做的更改,例如插入、删除或更新行。
我注意到一个表被排除在变更数据捕获(CDC)之外,这带来了很多问题。
有没有办法找出表何时从 CDC 中删除,甚至是谁删除了该表?
CDC 是否有某种日志可以提供此类信息?
SQL Server 2008 has Change Data Capture feature that allows to capture changes made in the table, such as insert, delete or update rows.
I have noticed that a table was excluded from Change Data Capture (CDC) which brought lots of problems.
Is there a way to find out when a table was removed from CDC or even who removed the table?
Is there some kind of log of CDC where such information is available?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以检查报告/标准报告/架构更改历史记录,我认为它会在那里被拾取,因为捕获表可能会被删除,但该数据来自默认跟踪,因此它可能不会回溯到足够远的地方。
You could check the Reports / Standard Reports / Schema changes history, I would think it would get picked up there since the capture tables probably would be dropped, but that data comes from the default trace, so it may not go back far enough for you.
CDC 跟踪对受监控表进行的 DDL 更改:
http://msdn.microsoft.com/en-我们/library/bb522553(v=sql.110).aspx
和 http://msdn.microsoft.com/en -us/library/bb510681(v=sql.110).aspx
另外,
selectmodify_date from sys.tables where object_id = object_id('dbo.yourtablename')
将为您提供时间和表的 DDL 上次更改的日期。据我所知,除非您对所有 DDL 更改安装了监视功能,否则无法获取对表定义所做的所有更改。CDC keeps track of DDL changes made on the monitored tables:
http://msdn.microsoft.com/en-us/library/bb522553(v=sql.110).aspx
and http://msdn.microsoft.com/en-us/library/bb510681(v=sql.110).aspx
Also
select modify_date from sys.tables where object_id = object_id('dbo.yourtablename')
will give you the time and date the table's DDL was last changed. Unless you've got monitoring installed on all DDL changes there's -to my knowledge- no way to get all changes made to your table's definitions.