Database Research & Development

  • Home
  • NoSQL
    • NoSQL
    • Cassandra
  • Databases
    • Database Theory
    • Database Designing
    • SQL Server Coding Standards
    • SQL Server
    • PostgreSQL
    • MySQL
    • Greenplum
    • Linux
  • Interviews
    • SQL Server Interviews
    • MySQL Interviews
    • SQL Puzzles
  • DBA Scripts
    • SQL Server DBA Scripts
    • PostgreSQL DBA Scripts
    • MySQL DBA Scripts
    • Greenplum DBA Scripts
  • Home
  • Blog Archives !
  • (: Laugh@dbrnd :)
  • Contact Me !
sqlserverinterviews
Home 2017 January SQL Server: What is Database Snapshot and How it works?

SQL Server: What is Database Snapshot and How it works?

This article is half-done without your Comment! *** Please share your thoughts via Comment ***

Since SQL Server 2005, The Database Snapshot exists with the SQL Server. In this post, I am going to share a basic and easy note of Database Snapshot.

SQLServer Snapshot Database
The Database Snapshot is not related to Snapshot Isolation, Snapshot Replication, Snapshot Backup. You can create Snapshot Database with the SQL Server Enterprise Edition. Image reference taken from msdn.

The SQL Server Database Snapshot:

We can create a Snapshot of the user database and it provides a read-only and static view of the source database.

The Database Snapshot is fully dependent on the source database and must be on the same server. If we make source database unavailable, Database Snapshot also becomes unavailable.

We can reduce the load on Source Database because the Snapshot is very good option for reporting purpose where all the reporting related queries can execute on the Snapshot instead of the actual database.

How it works?

I asked one interview question to DBA that does Snapshot update when the source database is updated.
Most of the time the answer was: Yes, Snapshot automatically update.

This is a wrong answer.

Initially, Snapshot is a pointer of the source database and when we are selecting data from Snapshot, it retrieves data from the actual source database.

Whenever we update the data in the actual database, it copies that actual data page from the source database to Snapshot database.
The Snapshot uses one or more sparse file to store the original pages.

That means, You can read a new version of the data in the actual source database and you can read an old version of the data in the Snapshot database.
Now we can say, Snapshot database is a report purpose database and only for historical and old data.

A Sparse file provided by the NTFS file system that requires much less disk space than other.
If your source database frequently updates, the size of Snapshot Database also frequently increase.

Snapshots could also be used to restore the current database to the point the snapshot was taken. It would perform a very quick point in time restore of the database.

If you want updated Snapshot, Periodically bases on requirement you should drop and recreate Snapshot Database.

The Performance is reduced, due to increased I/O on the source database resulting from a copy-on-write operation to the snapshot every time a page is updated.

The Real Time Use:

One of the main use is for reporting purpose and read-only database access.
We can create multiple Snapshot databases to maintain the different version of the Actual Database.
For example, if we are working with financial systems, we can create yearly Snapshot databases and we can populate different statistical report on it.

Jan 27, 2017Anvesh Patel
PostgreSQL: Must know about pg_terminate_backend and pg_cancel_backend before killing to any sessionSQL Server: How to create Snapshot Database?
Anvesh Patel
Anvesh Patel

Database Engineer

January 27, 2017 SQL ServerAnvesh Patel, database, database research and development, dbrnd, Snapshot database, SQL Query, SQL Server, SQL Server Administrator, SQL Server Monitoring, SQL Server Performance Tunning, SQL Server Tips and Tricks, TSQL
About Me!

I'm Anvesh Patel, a Database Engineer certified by Oracle and IBM. I'm working as a Database Architect, Database Optimizer, Database Administrator, Database Developer. Providing the best articles and solutions for different problems in the best manner through my blogs is my passion. I have more than six years of experience with various RDBMS products like MSSQL Server, PostgreSQL, MySQL, Greenplum and currently learning and doing research on BIGData and NoSQL technology. -- Hyderabad, India.

About DBRND !

dbrnd

This is a personal blog (www.dbrnd.com).

Any views or opinions represented in this blog are personal and belong solely to the blog owner and do not represent those of people, institutions or organizations that the owner may or may not be associated with in professional or personal capacity, unless explicitly stated.

Feel free to challenge me, disagree with me, or tell me I’m completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever (abusive, profane, rude, or anonymous comments) - so keep it polite.

The content of this website is protected by copyright. No portion of this website may be copied or replicated in any form without the written consent of the website owner.

Recent Comments !
  • Anvesh Patel { Sure will do... } – May 27, 12:43 PM
  • Anvesh Patel { Great... } – May 27, 12:41 PM
  • Anvesh Patel { Great... } – May 27, 12:39 PM
  • Anvesh Patel { Great... } – May 27, 12:36 PM
  • Anvesh Patel { Great... } – May 27, 12:28 PM
  • Anvesh Patel { Great... } – May 27, 12:27 PM
  • Anvesh Patel { Great... } – May 27, 12:16 PM
  • Older »
Follow Me !
  • facebook
  • linkedin
  • twitter
  • youtube
  • google
  • flickr
© 2015 – 2019 All rights reserved. Database Research & Development (dbrnd.com)
Posting....