有没有办法知道在活动SQL Server 2005数据库中最后一次写入操作发生的时间?
我目前在我的服务器上有30个(和不断增长的)数据库。 其中只有一些会看到日常活动(但哪些日常活动会随着时间的推移而变化)。我的备份空间有限,我希望每日备份所有“自上次备份后修改”的数据库。
事实上,我在问这个问题的反面。 我不想从备份中询问最后一次写入日期以查看是否应该恢复它,而是要告诉最后写入数据库的日期以查看是否应备份它。
由于备份在服务器上运行,我可以检查日志的最后修改时间,但这不是很干净,也不确定是完全可靠的。
Is there a way to know when the last write operation has occurred in a live SQL Server 2005 database?
I currently have 30 (and growing) databases on my server. Only some of these see daily activity (but which ones get daily activity varies over time.) My backup space is limited and I'd like to do a daily backup of all "modified since last backup" databases.
In fact, I'm asking the reverse of this question. Instead of asking last write date from a backup to see if I should restore it, I want to tell last write date of a live database to see if I should back it up.
Since the backups run on the server itself, I could check the last modification time of the log, but that isn't very clean, nor I'm sure is totally reliable.
最满意答案
本博客条目包含有关如何在SQL Server 2008和2005上执行此操作的信息。
在2008年:使用新的服务器审计功能 在2005年:使用动态管理视图(DMV)This Blog entry contains information on how to do it on SQL Server 2008 and 2005.
On 2008: using the new Server Auditing feature On 2005: using Dynamic Management Views (DMV)更多推荐
发布评论