监控日志传送数据库
我需要一种一致的方法来监视作为生产数据库的只读日志传送副本的数据库。过去我依赖以下方法:
- 将日志恢复到数据库的作业设置为启动另一个作业作为其最后一步。
- 将日志恢复到数据库的作业设置为在控制表中插入一条记录作为其最后一步。
- 查询msdb数据库,查看日志恢复到数据库作业的状态。
- 查询数据库本身内部的控制表,该表在备份事务日志之前立即获取值。
- 从数据库内的表中查询 MAX 值以查看最近是否有更改。
尽管上述方法有效,但由于各种原因,它们无法对我查询的每个日志传送数据库实现。监视日志传送数据库的“截至日期的数据”的最佳方法是什么?
I need a consistent way to monitor databases that are read-only log shipped copies of production databases. In the past I have relied on the following methods:
- Set the job that restores logs to the database kick off another job as its last step.
- Set the job that restores logs to the database to insert a record in a control table as its last step.
- Query the msdb database to check the status of the job that restores logs to the database.
- Query a control table inside the database itself that gets a value immediately before transaction logs are backed up.
- Query MAX values from tables inside the database to see if it has recent changes.
Although the above methods work, they can't be implemented for every log shipped database that I query for various reasons. What is the best method for monitoring the "data as of" date for a log shipped database?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
备份和还原表中包含您需要的所有信息:
You have all the information you need in the Backup and Restore tables:
对我来说似乎有希望的一种可能的解决方案是使用“数据库属性”窗口的“常规”选项卡中的“上次数据库日志备份”和“上次数据库备份”字段。有谁知道这些数据存储在哪里或将返回数据库值的命令?不幸的是,由于权限问题,我无法在任何具有日志传送数据库的服务器上运行跟踪。另外,这些日期是备份和日志的“数据截至”日期,还是只是在服务器上应用备份和日志的时间?显然后者对我没有多大帮助。
One possible solution that seems promising to me is to use the "Last Database Log Backup" and "Last Database Backup" fields in the General tab of the "Database Properties" window. Does anyone know where this data is stored or a command that will return the value for a database? Unfortunately I can't run a trace on any servers with log shipped databases here due to permission issues. Also, are these dates the "data as of" date of the backups and logs or just the time at which the backups and logs were applied on the server? Obviously the latter wouldn't help me much.