<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Snapshot database &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/snapshot-database/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Mon, 30 Jan 2017 19:41:21 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.5</generator>
	<item>
		<title>SQL Server: How to Restore Database from Snapshot Database?</title>
		<link>https://www.dbrnd.com/2017/01/sql-server-how-to-restore-database-from-snapshot-database-script-to-restore-database/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sun, 29 Jan 2017 19:40:15 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Restore Database]]></category>
		<category><![CDATA[Snapshot database]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tuning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=2487</guid>

					<description><![CDATA[In the previous two articles, I have shared basic details about the SQL Server Snapshot and how we can configure it. But one of the important things is, we can also restore a source database from the created Snapshot database. SQL Server: What is Database Snapshot and How it works? SQL Server: How to create [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fsql-server-how-to-restore-database-from-snapshot-database-script-to-restore-database%2F&amp;linkname=SQL%20Server%3A%20How%20to%20Restore%20Database%20from%20Snapshot%20Database%3F" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fsql-server-how-to-restore-database-from-snapshot-database-script-to-restore-database%2F&amp;linkname=SQL%20Server%3A%20How%20to%20Restore%20Database%20from%20Snapshot%20Database%3F" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fsql-server-how-to-restore-database-from-snapshot-database-script-to-restore-database%2F&amp;linkname=SQL%20Server%3A%20How%20to%20Restore%20Database%20from%20Snapshot%20Database%3F" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fsql-server-how-to-restore-database-from-snapshot-database-script-to-restore-database%2F&amp;linkname=SQL%20Server%3A%20How%20to%20Restore%20Database%20from%20Snapshot%20Database%3F" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fsql-server-how-to-restore-database-from-snapshot-database-script-to-restore-database%2F&amp;linkname=SQL%20Server%3A%20How%20to%20Restore%20Database%20from%20Snapshot%20Database%3F" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fsql-server-how-to-restore-database-from-snapshot-database-script-to-restore-database%2F&amp;linkname=SQL%20Server%3A%20How%20to%20Restore%20Database%20from%20Snapshot%20Database%3F" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fsql-server-how-to-restore-database-from-snapshot-database-script-to-restore-database%2F&#038;title=SQL%20Server%3A%20How%20to%20Restore%20Database%20from%20Snapshot%20Database%3F" data-a2a-url="https://www.dbrnd.com/2017/01/sql-server-how-to-restore-database-from-snapshot-database-script-to-restore-database/" data-a2a-title="SQL Server: How to Restore Database from Snapshot Database?"></a></p><p><em>In the previous two articles, I have shared basic details about the SQL Server Snapshot and how we can configure it.<br />
But one of the important things is, we can also restore a source database from the created Snapshot database. </em></p>
<blockquote class="wp-embedded-content" data-secret="EjcgaaLrLv"><p><a href="https://www.dbrnd.com/2017/01/sql-server-what-is-database-snapshot-and-how-it-works-read-only-database/">SQL Server: What is Database Snapshot and How it works?</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2017/01/sql-server-what-is-database-snapshot-and-how-it-works-read-only-database/embed/#?secret=EjcgaaLrLv" data-secret="EjcgaaLrLv" width="600" height="338" title="&#8220;SQL Server: What is Database Snapshot and How it works?&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<blockquote class="wp-embedded-content" data-secret="z819gApsOZ"><p><a href="https://www.dbrnd.com/2017/01/sql-server-how-to-create-snapshot-database-for-read-only-access/">SQL Server: How to create Snapshot Database?</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2017/01/sql-server-how-to-create-snapshot-database-for-read-only-access/embed/#?secret=z819gApsOZ" data-secret="z819gApsOZ" width="600" height="338" title="&#8220;SQL Server: How to create Snapshot Database?&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<blockquote><p>When we update anything in the source database, it holds the modified pages and copied original pages into the Snapshot database.<br />
The Snapshot database is a collection of the original pages and source database may have some original and updated pages. </p></blockquote>
<blockquote><p>The Snapshot is a virtual backup of the Source database and sometimes it happens that after the creation of Snapshot database, some invalid operation or update happen on the source database. </p></blockquote>
<blockquote><p>If any corruption happens in the Source database, we can restore original pages from Snapshot database and can overwrite on the modified pages in the Source database and Transaction log also update accordingly. </p></blockquote>
<blockquote><p>
Generally, restoring a database from the Snapshot is not an always preferable option.<br />
The best practice is to take a full database backup regularly and whenever it is required we can restore it. But to restore a Source Database using Snapshot Database is faster than the regular restore operation. </p></blockquote>
<p><strong>Script to restore using Snapshot Database: </strong></p>
<pre class="crayon-plain-tag">USE master
GO
RESTORE DATABASE [Source_Database]
FROM DATABASE_SNAPSHOT = 'Snapshot_Database'
GO</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: How to create Snapshot Database?</title>
		<link>https://www.dbrnd.com/2017/01/sql-server-how-to-create-snapshot-database-for-read-only-access/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 28 Jan 2017 18:21:36 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[.ldf]]></category>
		<category><![CDATA[.mdf]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Snapshot database]]></category>
		<category><![CDATA[sparse file]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tunning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=2455</guid>

					<description><![CDATA[In the previous post, I have shared basic theory on SQL Server Database Snapshot. SQL Server: What is Database Snapshot and How it works? In this post, I am sharing T-SQL scripts to create Snapshot Database in SQL Server. First, Create one test database: [crayon-6aac5e928f964899642795/] Create a table with sample data: [crayon-6aac5e928f967777114570/] Create a Snapshot [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fsql-server-how-to-create-snapshot-database-for-read-only-access%2F&amp;linkname=SQL%20Server%3A%20How%20to%20create%20Snapshot%20Database%3F" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fsql-server-how-to-create-snapshot-database-for-read-only-access%2F&amp;linkname=SQL%20Server%3A%20How%20to%20create%20Snapshot%20Database%3F" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fsql-server-how-to-create-snapshot-database-for-read-only-access%2F&amp;linkname=SQL%20Server%3A%20How%20to%20create%20Snapshot%20Database%3F" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fsql-server-how-to-create-snapshot-database-for-read-only-access%2F&amp;linkname=SQL%20Server%3A%20How%20to%20create%20Snapshot%20Database%3F" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fsql-server-how-to-create-snapshot-database-for-read-only-access%2F&amp;linkname=SQL%20Server%3A%20How%20to%20create%20Snapshot%20Database%3F" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fsql-server-how-to-create-snapshot-database-for-read-only-access%2F&amp;linkname=SQL%20Server%3A%20How%20to%20create%20Snapshot%20Database%3F" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fsql-server-how-to-create-snapshot-database-for-read-only-access%2F&#038;title=SQL%20Server%3A%20How%20to%20create%20Snapshot%20Database%3F" data-a2a-url="https://www.dbrnd.com/2017/01/sql-server-how-to-create-snapshot-database-for-read-only-access/" data-a2a-title="SQL Server: How to create Snapshot Database?"></a></p><p>In the previous post, I have shared basic theory on SQL Server Database Snapshot.</p>
<blockquote data-secret="MMRPYXtVRG" class="wp-embedded-content"><p><a href="https://www.dbrnd.com/2017/01/sql-server-what-is-database-snapshot-and-how-it-works-read-only-database/">SQL Server: What is Database Snapshot and How it works?</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2017/01/sql-server-what-is-database-snapshot-and-how-it-works-read-only-database/embed/#?secret=MMRPYXtVRG" data-secret="MMRPYXtVRG" width="600" height="338" title="&#8220;SQL Server: What is Database Snapshot and How it works?&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p>In this post, I am sharing T-SQL scripts to create Snapshot Database in SQL Server.</p>
<p><strong>First, Create one test database:</strong></p><pre class="crayon-plain-tag">USE master
GO
CREATE DATABASE TestRND
GO</pre><p>
<strong>Create a table with sample data: </strong></p><pre class="crayon-plain-tag">USE TestRND
GO
CREATE TABLE tbl_TestSnapshot
(ID INTEGER PRIMARY KEY, Name VARCHAR(50))
GO

INSERT INTO tbl_TestSnapshot VALUES 
(1,'Anvesh'),(2,'Neevan')
,(3,'Roy'),(4,'Martin')
,(5,'Jenny'),(6,'Kavia')
GO</pre><p>
<strong>Create a Snapshot Database: </strong><br />
Please specify source database .mdf file name and file path and create a new sparse file for Snapshot with .ss extension.</p><pre class="crayon-plain-tag">USE master
GO
CREATE DATABASE TestRND_SS
ON
(NAME=TestRND,FILENAME='C:\Program Files (x86)\Microsoft SQL Server\MSSQL11.MSSQL_DBRND\MSSQL\DATA\TestRND_SS.ss')
AS SNAPSHOT OF TestRND
GO</pre><p>
<a href="https://www.dbrnd.com/wp-content/uploads/2016/04/SQLServerDatabaseSnapshot.png" rel="attachment wp-att-2459"><img loading="lazy" decoding="async" class="alignnone wp-image-2459 size-full" title="SQL Server Database Snapshot" src="https://www.dbrnd.com/wp-content/uploads/2016/04/SQLServerDatabaseSnapshot.png" alt="SQL Server Database Snapshot" width="177" height="77" srcset="https://www.dbrnd.com/wp-content/uploads/2016/04/SQLServerDatabaseSnapshot.png 177w, https://www.dbrnd.com/wp-content/uploads/2016/04/SQLServerDatabaseSnapshot-150x65.png 150w" sizes="auto, (max-width: 177px) 100vw, 177px" /></a></p>
<p><strong>Update data into source database:</strong><br />
<pre class="crayon-plain-tag">USE TestRND
GO
UPDATE tbl_TestSnapshot SET Name = 'dbrnd' WHERE ID=1
GO</pre>
<strong>Check the result of Snapshot database:</strong><br />
As earlier, I have discussed that Snapshot Database keep all old data.<br />
whenever a source database updates the data, it never updates the original data.<br />
<pre class="crayon-plain-tag">USE TestRND_SS
GO
SELECT *FROM tbl_TestSnapshot
GO

/* Result...

ID          Name
------  ------------
1           Anvesh
2           Neevan
3           Roy
4           Martin
5           Jenny
6           Kavia
*/</pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: What is Database Snapshot and How it works?</title>
		<link>https://www.dbrnd.com/2017/01/sql-server-what-is-database-snapshot-and-how-it-works-read-only-database/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Fri, 27 Jan 2017 04:40:11 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Snapshot database]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tunning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=2449</guid>

					<description><![CDATA[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. 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 [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fsql-server-what-is-database-snapshot-and-how-it-works-read-only-database%2F&amp;linkname=SQL%20Server%3A%20What%20is%20Database%20Snapshot%20and%20How%20it%20works%3F" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fsql-server-what-is-database-snapshot-and-how-it-works-read-only-database%2F&amp;linkname=SQL%20Server%3A%20What%20is%20Database%20Snapshot%20and%20How%20it%20works%3F" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fsql-server-what-is-database-snapshot-and-how-it-works-read-only-database%2F&amp;linkname=SQL%20Server%3A%20What%20is%20Database%20Snapshot%20and%20How%20it%20works%3F" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fsql-server-what-is-database-snapshot-and-how-it-works-read-only-database%2F&amp;linkname=SQL%20Server%3A%20What%20is%20Database%20Snapshot%20and%20How%20it%20works%3F" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fsql-server-what-is-database-snapshot-and-how-it-works-read-only-database%2F&amp;linkname=SQL%20Server%3A%20What%20is%20Database%20Snapshot%20and%20How%20it%20works%3F" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fsql-server-what-is-database-snapshot-and-how-it-works-read-only-database%2F&amp;linkname=SQL%20Server%3A%20What%20is%20Database%20Snapshot%20and%20How%20it%20works%3F" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fsql-server-what-is-database-snapshot-and-how-it-works-read-only-database%2F&#038;title=SQL%20Server%3A%20What%20is%20Database%20Snapshot%20and%20How%20it%20works%3F" data-a2a-url="https://www.dbrnd.com/2017/01/sql-server-what-is-database-snapshot-and-how-it-works-read-only-database/" data-a2a-title="SQL Server: What is Database Snapshot and How it works?"></a></p><p><em>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.</em></p>
<p><em><img loading="lazy" decoding="async" class="alignright wp-image-4410 size-medium" title="SQL Server Snapshot Database" src="https://www.dbrnd.com/wp-content/uploads/2017/01/SQLServerSnapshotDatabase-300x264.gif" alt="SQLServer Snapshot Database" width="300" height="264" srcset="https://www.dbrnd.com/wp-content/uploads/2017/01/SQLServerSnapshotDatabase-300x264.gif 300w, https://www.dbrnd.com/wp-content/uploads/2017/01/SQLServerSnapshotDatabase-150x132.gif 150w" sizes="auto, (max-width: 300px) 100vw, 300px" /><br />
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.<br />
</em><br />
<strong>The SQL Server Database Snapshot:<br />
</strong></p>
<blockquote><p>We can create a Snapshot of the user database and it provides a read-only and static view of the source database.</p></blockquote>
<blockquote><p>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.</p></blockquote>
<blockquote><p>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.</p></blockquote>
<p><strong>How it works?</strong></p>
<blockquote><p>I asked one interview question to DBA that does Snapshot update when the source database is updated.<br />
Most of the time the answer was: <em>Yes, Snapshot automatically update</em>.</p>
<p><strong>This is a wrong answer. </strong></p></blockquote>
<blockquote><p>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.</p></blockquote>
<blockquote><p>Whenever we update the data in the actual database, it copies that actual data page from the source database to Snapshot database.<br />
The Snapshot uses one or more sparse file to store the original pages.</p></blockquote>
<blockquote><p>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.<br />
Now we can say, Snapshot database is a report purpose database and only for historical and old data.</p></blockquote>
<blockquote><p>A Sparse file provided by the NTFS file system that requires much less disk space than other.<br />
If your source database frequently updates, the size of Snapshot Database also frequently increase.</p></blockquote>
<blockquote><p>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.</p></blockquote>
<blockquote><p>If you want updated Snapshot, Periodically bases on requirement you should drop and recreate Snapshot Database.</p></blockquote>
<blockquote><p>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.</p></blockquote>
<p><strong>The Real Time Use: </strong></p>
<blockquote><p>One of the main use is for reporting purpose and read-only database access.<br />
We can create multiple Snapshot databases to maintain the different version of the Actual Database.<br />
For example, if we are working with financial systems, we can create yearly Snapshot databases and we can populate different statistical report on it.</p></blockquote>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server Database Administrator Interview Questions and Answers (Day-2)</title>
		<link>https://www.dbrnd.com/2016/07/sql-server-database-administrator-interview-questions-and-answers-singleton-lookup-range-scan-checkpoints-database-snapshot-sparse-file-day-2/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sun, 10 Jul 2016 16:32:04 +0000</pubDate>
				<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[answers]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[checkpoints]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database administrator]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[interview]]></category>
		<category><![CDATA[questions]]></category>
		<category><![CDATA[range scan]]></category>
		<category><![CDATA[singleton lookup]]></category>
		<category><![CDATA[Snapshot database]]></category>
		<category><![CDATA[sparse file]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tunning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[stand by server]]></category>
		<category><![CDATA[TSQL]]></category>
		<category><![CDATA[warm server]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3322</guid>

					<description><![CDATA[How to change the database owner of the database? [crayon-6aac5e928fa48809611706/] What is Singleton Lookup? A singleton lookup is a seek operation whereby a single record/page of data is retrieved. This can occur, for example when you perform a query that needs to access only a single record, or a few records from a single page. [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fsql-server-database-administrator-interview-questions-and-answers-singleton-lookup-range-scan-checkpoints-database-snapshot-sparse-file-day-2%2F&amp;linkname=SQL%20Server%20Database%20Administrator%20Interview%20Questions%20and%20Answers%20%28Day-2%29" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fsql-server-database-administrator-interview-questions-and-answers-singleton-lookup-range-scan-checkpoints-database-snapshot-sparse-file-day-2%2F&amp;linkname=SQL%20Server%20Database%20Administrator%20Interview%20Questions%20and%20Answers%20%28Day-2%29" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fsql-server-database-administrator-interview-questions-and-answers-singleton-lookup-range-scan-checkpoints-database-snapshot-sparse-file-day-2%2F&amp;linkname=SQL%20Server%20Database%20Administrator%20Interview%20Questions%20and%20Answers%20%28Day-2%29" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fsql-server-database-administrator-interview-questions-and-answers-singleton-lookup-range-scan-checkpoints-database-snapshot-sparse-file-day-2%2F&amp;linkname=SQL%20Server%20Database%20Administrator%20Interview%20Questions%20and%20Answers%20%28Day-2%29" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fsql-server-database-administrator-interview-questions-and-answers-singleton-lookup-range-scan-checkpoints-database-snapshot-sparse-file-day-2%2F&amp;linkname=SQL%20Server%20Database%20Administrator%20Interview%20Questions%20and%20Answers%20%28Day-2%29" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fsql-server-database-administrator-interview-questions-and-answers-singleton-lookup-range-scan-checkpoints-database-snapshot-sparse-file-day-2%2F&amp;linkname=SQL%20Server%20Database%20Administrator%20Interview%20Questions%20and%20Answers%20%28Day-2%29" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fsql-server-database-administrator-interview-questions-and-answers-singleton-lookup-range-scan-checkpoints-database-snapshot-sparse-file-day-2%2F&#038;title=SQL%20Server%20Database%20Administrator%20Interview%20Questions%20and%20Answers%20%28Day-2%29" data-a2a-url="https://www.dbrnd.com/2016/07/sql-server-database-administrator-interview-questions-and-answers-singleton-lookup-range-scan-checkpoints-database-snapshot-sparse-file-day-2/" data-a2a-title="SQL Server Database Administrator Interview Questions and Answers (Day-2)"></a></p><p><strong>How to change the database owner of the database?</strong></p><pre class="crayon-plain-tag">EXEC sp_changedbowner 'MyAdmin';</pre><p>
<strong>What is Singleton Lookup?</strong></p>
<blockquote><p>A singleton lookup is a seek operation whereby a single record/page of data is retrieved. This can occur, for example when you perform a query that needs to access only a single record, or a few records from a single page.</p></blockquote>
<p><strong>What is a Range Scan?</strong></p>
<blockquote><p>A range-scan is a scan operation whereby a range of pages are retrieved &#8211; think of this as a full-scan with boundaries.</p></blockquote>
<p><strong>What is Checkpoints?</strong></p>
<blockquote><p>A checkpoint creates a known good point from which the SQL Server Database Engine can start applying changes contained in the log during recovery after an unexpected shutdown or crash.</p></blockquote>
<p><strong>What are the different type of Checkpoints?</strong></p>
<ul>
<li>automatic &#8211; Issued automatically in the background.</li>
<li>indirect &#8211; Issued in the background to meet a user-specified target recovery time for a given database.</li>
<li>manual &#8211; Issued when you execute a Transact-SQL CHECKPOINT command. The manual checkpoint occurs in the current database for your connection.</li>
<li>internal &#8211; Issued by various server operations such as backup and database-snapshot creation to guarantee that disk images match the current state of the log.</li>
</ul>
<p><strong>What is Database Snapshot?</strong></p>
<blockquote><p>A database snapshot is a view of what the source database looked like at the time at which the snapshot was created. This means that all the objects will be the same as what it was when the snapshot was taken and all of the data will be exactly as it was then.</p>
<p>To use database snapshots to recover from an unwanted DML statement, you need to have a suitable snapshot in place. Snapshots can only be created by using a T-SQL statement.</p></blockquote>
<p><strong>What is Sparse file in Database Snapshot?</strong></p>
<blockquote><p>To store the copied original pages, the snapshot uses one or more sparse files. Initially, a sparse file is an essentially empty file that contains no user data and has not yet been allocated disk space for user data.</p>
<p>As more and more pages are updated in the source database, the size of the file grows. When a snapshot is taken, the sparse file takes up little disk space. As the database is updated over time, however, a sparse file can grow into a very large file.</p></blockquote>
<p><strong>Explain Sparse file Size in database snapshot.</strong></p>
<blockquote><p>At the creation time sparse file will take very little space, but as the data changes occurred into the parent database, data page before the changes copied into the sparse file.</p>
<p>Thus sparse file grows. Sparse files are the feature of NTFS file system. As the sparse file grows NTFS will allocate the space to sparse file gradually.</p></blockquote>
<p><strong>How to create database snapshot?</strong></p>
<blockquote><p>Based on the current size of the source database, ensure that you have sufficient disk space to hold the database snapshot. The maximum size of a database snapshot is the size of the source database at snapshot creation.</p>
<p>Issue a CREATE DATABASE statement on the files using the AS SNAPSHOT OF clause. Creating a snapshot requires specifying the logical name of every database file of the source database.</p></blockquote>
<p><strong>How does a snapshot work?</strong></p>
<ul>
<li>When you create a snapshot a sparse file is created for each data file</li>
<li>When data is modified in the source database for the first time, the old value of the modified data is copied to the sparse file</li>
<li>If the same data is the subsequently changed again, those changes will be ignored and not copied to the snapshot</li>
<li>When you query the snapshot, it first checks if the data is available in the snapshot. If it’s there it reads if from the snapshot. If it’s not there, I reads through to the source database and gets the data from there instead, because that means the data has not yet changed since the time the snapshot was taken.</li>
</ul>
<p><strong>Can we change the permissions in a database snapshot?</strong></p>
<blockquote><p>No it’s not possible.</p></blockquote>
<p><strong>Can we take a backup of a database snapshot?</strong></p>
<blockquote><p>No.</p></blockquote>
<p><strong>What are the benefits of Database Snapshots?</strong></p>
<ul>
<li>Snapshots can be used for reporting purposes.</li>
<li>Using a mirror database that you are maintaining for availability purposes to offload reporting.</li>
<li>Safeguarding data against administrative and user error.</li>
</ul>
<p><strong>What is hot standby and warm standby server?</strong></p>
<blockquote><p>Warm servers are often used for replication and mirroring.</p>
<p>A hot server is a backup server that receives regular updates and is standing by ready (on hot standby) to take over immediately in the event of a failover.</p></blockquote>
<p><strong>What is copy-on-write operation in database snapshot?</strong></p>
<blockquote><p>Database snapshots operate at the data-page level. Before a page of the source database is modified for the first time, the original page is copied from the source database to the snapshot.</p>
<p>This process is called a copy-on-write operation. The snapshot stores the original page, preserving the data records as they existed when the snapshot was created.</p></blockquote>
<p><strong>Is database snapshot transitionally consistent?</strong></p>
<blockquote><p>Each database snapshot is transitionally consistent with the source database at the moment of the snapshot’s creation. When we create a database snapshot, the source database will typically have number open transactions.</p>
<p>Before the snapshot becomes available, the open transactions are rolled back to make the database snapshot transitionally consistent. Just like it follows the recovery interval step and it will not affect the source database.</p></blockquote>
<p><strong>Can SQL Servers linked to other servers like Oracle?</strong></p>
<blockquote><p>SQL Server can be linked to any server provided it has OLE-DB provider from Microsoft to allow a link. E.g. Oracle has an OLE-DB provider for oracle that Microsoft provides to add it as linked server to SQL Server group.</p></blockquote>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
