Database SnapShot

  • Hi DBAs,

    After creating the database snapshot, when we try to read from the snapsshot, does SQL Server actually reads from the datafiles of Source database.

    I'm asking this because, the data pages present in the SnapShot are only the updated ones after the database SnapShot has been created.

    So, if database is not updated after the SnapShot creation, where does the SQL Server try to read. From the Source database or from the SnapShot.

    Thanks

    Manoj

    John

  • Pages that have been changed since the snapshot's creation are read from the snapshot (which contains the page as it was before it was modified). Pages that haven't are read from the source database.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • When you create a database snapshot, the snap shot doesn’t hold any data. Each page that is modified for the first time in the original database, is copied to the snapshot with the data that it had before the modification (of course if the same page is modified again it will not be copied anymore). When you issue a select query on the snapshot, it will get the data from the snapshot itself only if the original data in the original database was modified. If the original data in the original database was not modified, it will query the table in the original database in order to get the information.

    Adi

    --------------------------------------------------------------
    To know how to ask questions and increase the chances of getting asnwers:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • Thanks for the replies guys.

    So,If there has been no modification in the source database, then no pages will be copied to SS and hence the data is read from Source Database. In that case, how can the DB SnapShot can be used to Generate reports without blocking or being blocked by production operations.

    This is considered to the best feature of SS. Please explain how the blocking in the production database is avoided by simply creating the SS. Ultimately the data has to be read from the production database, if no update has been done.

    Thanks

    Manoj

    John

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

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