x

Database Snapshot

Hi Has anyone used Database Snapshots? From what I understand these became available in SQL 2005 Enterprise Edition, unfortunately I currently only have Standard so can't have a 'play'. Any feedback on these would be gratefully received, on how they have been useful or not.

Many thanks
more ▼

asked Jun 06, 2011 at 06:39 AM in Default

Mrs_Fatherjack gravatar image

Mrs_Fatherjack
4.7k 60 62 66

also available in 'Developer' flavour.....
Jun 06, 2011 at 06:40 AM Kev Riley ♦♦
Enterprise is available for a 6m trial from the installer CD...
Jun 06, 2011 at 06:44 AM Fatherjack ♦♦
(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

Some of my typical uses for Database Snapshots include:

  • Supporting small data changes in Production by providing a hot restore option. (No need to take a database backup when a Snapshot can be used to store just the delta of changed data.)
  • In conjunction with Database Mirroring, can be used to provide read access to the Mirrored database data.(Useful in typical query/reporting offloading scenarios but not as flexible as a Replicated DB, which permits local optimisations such as workload specific indexes).
more ▼

answered Jun 07, 2011 at 01:22 AM

John Sansom gravatar image

John Sansom
897 2

(comments are locked)
10|1200 characters needed characters left

I use database snapshots in development, when testing ideas or performing restructuring-by-brainstorming. I start off making a snapshot, go wild and crazy in a development database, and then use the snapshot to go back to the original state when I'm finished playing/testing ideas. That way, I don't need to take a copy of a database just to go bananas with it.

A database snapshot is initially an empty sparse file. It's an allocation of disk space, but the file itself is empty. As the original datafile changes, Windows will fill the sparse-file with the original data. So if you create a snapshot, and then change or delete a datapage, Windows will first write the original datapage to the sparse-file, and then change/delete the datapage.

The way it's implemented, creating a database snapshot is very, very quick, as Windows won't really copy data, it will just create some meta-data about the data. Restoring/reverting from a snapshot is also a quick process (if only little data has been changes since creating the snapshot), since only the changed pages are restored.

Some reading on database snapshots in SQL Server 2005: http://msdn.microsoft.com/en-us/library/ms175158(v=SQL.90).aspx
more ▼

answered Jun 07, 2011 at 01:37 AM

Magnus Ahlkvist gravatar image

Magnus Ahlkvist
16.4k 16 19 33

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x1945
x13

asked: Jun 06, 2011 at 06:39 AM

Seen: 820 times

Last Updated: Jun 06, 2011 at 06:39 AM