SQL2008做了镜像,为什么那镜像数据库文件的修改日期不是实时的

解决方案 »

  1.   

    你是说数据库的MDF和LDF文件更新时间吗?另外你的数据库镜像选用的是高可用性还是高安全性?高可用性的话两边不是实时同步的,搞完全性才是。 
      

  2.   

    我应该用的是高级别保护模式,就是除去了见证。
    说数据库的MDF和LDF文件更新时间
      

  3.   

    This is correct behaviour.  The modified dates change when SQL Server closes the files (SQL Server shut down or the database is detached), or when the file is grown (either automatically or manually).  All other times, SQL Server essentially bypasses the file system when performing the writes, and so the modified dates aren't updated.why?Assuming no fragmentation in the log file, the log is written to disk in a continuous fashion, and the disk head doesn't need to move.  If you wanted the Modified datetime to be updated whenever the file is changed, the disk head would need to move to the position in the FAT where this value is stored and change it after each update, and then move back into position to write the next entry to the log.  
      

  4.   

    另外你可以测试一下不光是订阅的数据库是这样的,发布的数据库也是同样的。对于OLTP系统可能每秒钟上千次的更改,SQL Server不可能每次数据的更改都修改数据文件或者日志文件的MODIFY DATE,这样的工作量太大了,会严重降低性能。 而且作为数据库使用者主要关注的是数据的改变,而这个改变是通过数据库软件去实现的,所以不会太关注物理文件的更改日期。