.mdf and .ldf file dates

  • Can anyone explain to me why the file dates on these files seem way off to me? We run several SQL databases that are used daily, and backed up evey night. However, when I look at the files at the operating system level, their modified dates are currently a week or more ago. ??

  • I believe it is  because the files are open and being used, and are only closed when the server is stopped.

    when the server stops it closes the files and the filesystem sets the modified date then.

    on a developer machine, if the database is not opened, the date could still vary from the server shut down time, because the file never got opened, but i would bet on production every mdf gets opened and the server shuts down once a week tops.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • I wonder if the last date shows when the file was created -or- when the file grows.  Never checked, but that might do it as well.

  • FYI i stopped and started my server to test this theory, and sure enough, any open databases had mdf/ldf's with a timestamp of when the server shutdown; some mdf's for databases that are never opened kept their old modified date.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • If you impliment log shipping you will see that on the Warm(production server) that the modified dates of the MDF files on the databases never change.  On the standby server the modification dates change, because you are overwritting the same files with respect to the transaction log every 15-20 minutes.

    Rob Broyles 

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply