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 Snapshots Expand / Collapse
Author
Message
Posted Tuesday, May 12, 2009 11:20 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, April 21, 2013 12:25 PM
Points: 9, Visits: 45
Hi, quick question on Database Snapshots. Let's say I take a snapshot once per hour, and I update a row in a table and so the original row is copied to the snapshot. Then that same row in that table is updated for a second time, is will the snapshot be able to capture more then one change on the same row?

Also, are there recommendations on frequency of snapshots?

Thanks!!
Post #715314
Posted Tuesday, May 12, 2009 11:31 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Friday, April 18, 2014 6:27 AM
Points: 6,997, Visits: 8,411
No.
A shapshot only preserves the state at the moment it has been taken !

So it only contains a single truth about a row at a certain point in time.

Keep in mind a snapshot database will consume as much space as the original rows need (+ a little bit). (only the ones that got updated !)

snapshot 1 will have the original state of rowA.

Snapshot 2 will have the next state of rowA.

Then RowB will get updated and will be documented in both snapshot databases !


Johan


Don't drive faster than your guardian angel can fly ...
but keeping both feet on the ground won't get you anywhere

- How to post Performance Problems
- How to post data/code to get the best help


- How to prevent a sore throat after hours of presenting ppt ?


"press F1 for solution", "press shift+F1 for urgent solution"


Need a bit of Powershell? How about this

Who am I ? Sometimes this is me but most of the time this is me
Post #715321
Posted Tuesday, May 12, 2009 11:39 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 @ 2:40 AM
Points: 41,572, Visits: 34,499
Just bear in mind that snapshots aren't free. Having lots of them could slow down inserts, updates and deletes.


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 #715327
Posted Tuesday, May 12, 2009 11:40 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, April 21, 2013 12:25 PM
Points: 9, Visits: 45
Ok, so snapshot 1 is taken at 12pm, provides a copy of the database, RowA at that point in time.

Row A is modified at 12:15pm, snapshot 1 will not capture that update?
Row A is again modified at 12:30pm

Snapshot 2 is taken at 1pm, snapshot 2 will capture both Row A mods, 12:15pm + 12:30pm. Snapshot 1 would only capture mods prior to 12pm?

Post #715329
Posted Tuesday, May 12, 2009 12:09 PM


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 @ 2:40 AM
Points: 41,572, Visits: 34,499
Snapshots don't capture modifications. They show the database as it was at the time the snapshot was created. So, in your scenario, if you query snapshot 1, it will show Row A as it was at 12:00, if you query snapshot 2, it will show Row A as it was at 13:00


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 #715354
Posted Tuesday, May 12, 2009 1:24 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, April 21, 2013 12:25 PM
Points: 9, Visits: 45
got it, thanks Gail!
Post #715417
Posted Tuesday, May 12, 2009 11:47 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Friday, April 18, 2014 6:27 AM
Points: 6,997, Visits: 8,411
In fact a snapshot db is created without any entries !
Data is only inserted if rows are modified in the originating database (or objects altered/dropped).
That's why a snapshot db only grows accordingly to the modification rate of the original db.

Off course there is a system overhead and a snapshot db is read only (for the user) !



Johan


Don't drive faster than your guardian angel can fly ...
but keeping both feet on the ground won't get you anywhere

- How to post Performance Problems
- How to post data/code to get the best help


- How to prevent a sore throat after hours of presenting ppt ?


"press F1 for solution", "press shift+F1 for urgent solution"


Need a bit of Powershell? How about this

Who am I ? Sometimes this is me but most of the time this is me
Post #715676
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse