Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Database SnapShot Expand / Collapse
Author
Message
Posted Wednesday, March 31, 2010 2:39 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, November 12, 2013 10:53 PM
Points: 290, Visits: 714
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
Post #893547
Posted Wednesday, March 31, 2010 3:23 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 12:22 PM
Points: 2,125, Visits: 5,544
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/
Post #893580
Posted Wednesday, March 31, 2010 3:23 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 10:25 AM
Points: 40,385, Visits: 36,827
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 2008, MVP
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

Post #893581
Posted Wednesday, March 31, 2010 5:25 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, November 12, 2013 10:53 PM
Points: 290, Visits: 714
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
Post #893650
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse