0

I'm able to implement trigger on user define table but not on system table (log_shipping_primaries and log_shipping_secondaries), it store info about when the backup .bak file was generated and when the transaction log ship file .trn file was copied and restored at secondary database

Objective : to implement RPO (recovery point objective) > 15 min at secondary database (DR site)

I was given a task to monitor log_shipping activities and provide historical data to higher management. Now the problem is these 2 tables is that it updates the old entry (for a given database) every time whenever a new entry is added.

Solution (does not work in SQL Server 2000): whenever a new entry is inserted, insert the similar data in user define table via trigger so as to keep historical data.

  1. how to implement trigger on system table (what permission do I need) or is it possible at all (please be precidse)?
  2. alternative to trigger like stored procedure or something(I've no experience in stored procedure)
4

3 回答 3

1

如果您使用 SQL 作业进行备份和事务日志传送,在这种情况下,您可以在此之前添加一个步骤以将该数据导入历史表中。

于 2013-02-15T07:54:45.820 回答
0

不可能在系统表上创建触发器。

我会考虑向SQL Server 代理添加一个以适当频率运行的作业(例如,每 30 秒)

于 2013-02-15T10:03:23.500 回答
0

为什么不在每次备份之前创建一个作业来保存表中的数据?至于如何做到这一点,这真的是你的选择。编写存储过程,将插入语句直接写入 SQL 代理作业,坐在您的计算机旁,每 15 分钟按一次 F5 ... :-) 很多选项。

于 2013-02-15T12:01:49.283 回答