understanding the need of database snapshot

  • hi everyone,I want to understand the actual real time benefit of database snapshot.

    when u have routine backup and restore mechanism,u take database snapshot for any data loss i.e for wrong updates or deletes.how it is useful when u require to do manual snapshot every time and what about in between changes that occurs between snapshots.

    can anyone explain how useful it is in real time.

  • It's useful when you're about to make a bunch of changes that may need to be undone, for example a code deployment. Easier than restoring from a backup to undo.

    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
  • What I want to know is what steps should be taken to protect any data loss in between the snapshots that we take along with routine backup and restore task as data keep changing constantly in real time environment.

    Thanks in advance

  • A snapshot is a frozen copy of your actual database.

    It can be used to provide users a read-only database state at a given point in time ( =create datetime of the snapshot ).

    You can have multiple snapshots of the same database !

    DBA can use a DB Snapshot as a potential restore point for upgrades in stead of having to go through the regular database backup full/diff/log combination.

    Keep in mind a database snapshot may consume a vast number of GB, depending on the insert/update/delete volume of the database.

    They are not to be a replacement for your regular backup schema !

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

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

    - 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

  • sej2008 (11/6/2013)


    What I want to know is what steps should be taken to protect any data loss in between the snapshots that we take along with routine backup and restore task as data keep changing constantly in real time environment.

    Thanks in advance

    To be honest I wouldn't use snapshots that way. Protecting against data loss is what your backups are for.

    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
  • You need to bear in mind that snapshots are almost a "temporary" backup. I wouldn't bother taking them in addition to normal backups unless there was likely to be a requirement to roll back to that point in time or I had to compare data changes over time for some reason. Perhaps day old reporting if I had limited resources and sql licences.

    If the source database becomes corrupt you are unlikely to be able to recover it from the snapshot as the snapshot consists of both the source database and the modified pages in the snapshots sparse files.

    You cannot backup a snapshot so if you need to recover the source db from backup, you will loose the snapshots.

  • The reason snapshots are so fast is that they're only tracking changes pages. It's not an actual backup. It completely dependent on your original database being in place. As Gail has noted, they're not a part of a DR scenario.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • I think they are most useful for testing.

    When I need to test with production data, I restore to a test database from a production backup, and create a snapshot of the test database.

    After I run tests against the test DB, I can restore the test DB from the snapshot to return it to its original condition. This is especially good for testing scripts that make schema changes.

  • I use database snapshots for some of the reasons mentioned above, but I also use it to run DBCC CHECKDB on my mirror instance instead of running it on the principal.

    I know this thread has gone in a little bit of a different direction, but just in case someone searches for reasons why to use snapshots I wanted to add my $.02 🙂



    Microsoft Certified Master - SQL Server 2008
    Follow me on twitter: @keith_tate

    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

Viewing 9 posts - 1 through 8 (of 8 total)

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