SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Database Snapshots


Database Snapshots

Author
Message
Steve Jones
Steve Jones
SSC Guru
SSC Guru (147K reputation)SSC Guru (147K reputation)SSC Guru (147K reputation)SSC Guru (147K reputation)SSC Guru (147K reputation)SSC Guru (147K reputation)SSC Guru (147K reputation)SSC Guru (147K reputation)

Group: Administrators
Points: 147301 Visits: 19434
Comments posted to this topic are about the item Database Snapshots

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Jamie-2229
Jamie-2229
Hall of Fame
Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)

Group: General Forum Members
Points: 3862 Visits: 857
Having no experience made this call a bit of a guess. The page in the BOL for Limitations on Snapshots states that http://msdn.microsoft.com/en-us/library/ms189940.aspx

If a source database becomes RECOVERY_PENDING, its database snapshots may become inaccessible.
After the issue on the source database is resolved, however, its snapshots should become available again. This question is about the database becoming suspect and not the snapshot. Is that correct?

Before answering, an analogy to an ADO disconnected recordset logic kicked in. My answer was wrong because the disconnected recordset still has access to the data.

How does the snapshot know that the database is offline - is the snapshot communicating with the database?

Is the... "may become inaccessible" in the documentation referring to the
The source database must be online, unless the database is a mirror database within a database mirroring session
?

Reading through the better analogy might be a system restore on XP.

May I ask for an analogy here that might put me in the right direction?

Jamie
kenk-601293
kenk-601293
SSC Rookie
SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)

Group: General Forum Members
Points: 28 Visits: 59
The way snapshots work is they use both a sparse file and the original data source. If you have a table t1, and an update occurs to one row on the original DB, then the data page in which that one row lives is copied to your sparse file. When you select * from t1, it reads both the copied page from the sparse file (snapshot) and original data set. Therefore any corruption on the original DB affects the sparse file
Steve Jones
Steve Jones
SSC Guru
SSC Guru (147K reputation)SSC Guru (147K reputation)SSC Guru (147K reputation)SSC Guru (147K reputation)SSC Guru (147K reputation)SSC Guru (147K reputation)SSC Guru (147K reputation)SSC Guru (147K reputation)

Group: Administrators
Points: 147301 Visits: 19434
kenk has a good explanation. The snapshot cannot exist, and is tightly tied to the source database. Only pages changed since the snapshot was created are copied to the snapshot. Others are read from the source.

Snapshots are a shaky structure, IMHO. If anything happens to the source, the snapshot is likely shot. If you want to restore, you need to whack all snapshots.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Jamie-2229
Jamie-2229
Hall of Fame
Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)

Group: General Forum Members
Points: 3862 Visits: 857
So
It continues to work as long as you access changed data only that exists in the snapshot
... there is no way to access only the changed data. A query to a snapshot will always attempt to connect to both the snapshot and the database simultaneously.

This is more clear now. There is no "changed records only" dataset available.

Thanks. Hope you all enjoy the holiday(s).

Jamie
Anipaul
Anipaul
SSCrazy Eights
SSCrazy Eights (9.8K reputation)SSCrazy Eights (9.8K reputation)SSCrazy Eights (9.8K reputation)SSCrazy Eights (9.8K reputation)SSCrazy Eights (9.8K reputation)SSCrazy Eights (9.8K reputation)SSCrazy Eights (9.8K reputation)SSCrazy Eights (9.8K reputation)

Group: General Forum Members
Points: 9807 Visits: 1407
Nice Explanation Kenk...



Tom Thomson
Tom Thomson
One Orange Chip
One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)

Group: General Forum Members
Points: 26068 Visits: 12500
Nice clear question and answer.

Tom

Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search