<?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>memory &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/memory/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>Thu, 12 Jan 2017 20:25:28 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.6</generator>
	<item>
		<title>SQL Server Interview: Where does DMVs store its data?</title>
		<link>https://www.dbrnd.com/2017/01/sql-server-interview-where-does-dmvs-store-its-data-in-memory-ram/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Wed, 11 Jan 2017 20:23:28 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[DMVs]]></category>
		<category><![CDATA[dynamic management views]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[SQL DBA]]></category>
		<category><![CDATA[SQL Developer]]></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=4296</guid>

					<description><![CDATA[Are you SQL Developer or SQL DBA? Whatever you are, you must know about the SQL Server DMVs (Dynamic Management Views). Last week, I was taking interview for SQL DBAs. I had asked few questions like: What do you know about the SQL DMVs? How can we effectively use it? Do you know, Where does [&#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-interview-where-does-dmvs-store-its-data-in-memory-ram%2F&amp;linkname=SQL%20Server%20Interview%3A%20Where%20does%20DMVs%20store%20its%20data%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-interview-where-does-dmvs-store-its-data-in-memory-ram%2F&amp;linkname=SQL%20Server%20Interview%3A%20Where%20does%20DMVs%20store%20its%20data%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-interview-where-does-dmvs-store-its-data-in-memory-ram%2F&amp;linkname=SQL%20Server%20Interview%3A%20Where%20does%20DMVs%20store%20its%20data%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-interview-where-does-dmvs-store-its-data-in-memory-ram%2F&amp;linkname=SQL%20Server%20Interview%3A%20Where%20does%20DMVs%20store%20its%20data%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-interview-where-does-dmvs-store-its-data-in-memory-ram%2F&amp;linkname=SQL%20Server%20Interview%3A%20Where%20does%20DMVs%20store%20its%20data%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-interview-where-does-dmvs-store-its-data-in-memory-ram%2F&amp;linkname=SQL%20Server%20Interview%3A%20Where%20does%20DMVs%20store%20its%20data%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-interview-where-does-dmvs-store-its-data-in-memory-ram%2F&#038;title=SQL%20Server%20Interview%3A%20Where%20does%20DMVs%20store%20its%20data%3F" data-a2a-url="https://www.dbrnd.com/2017/01/sql-server-interview-where-does-dmvs-store-its-data-in-memory-ram/" data-a2a-title="SQL Server Interview: Where does DMVs store its data?"></a></p><p>Are you SQL Developer or SQL DBA? Whatever you are, you must know about the SQL Server DMVs (Dynamic Management Views).</p>
<p>Last week, I was taking interview for SQL DBAs. I had asked few questions like:</p>
<blockquote><p>What do you know about the SQL DMVs?<br />
How can we effectively use it?<br />
Do you know, Where does SQL Server stores the DMVs data?</p></blockquote>
<p>I had found most of the SQL DBA given the wrong answer for the third question, that is about the storage of DMVs.<br />
<em>Most of the time, I got one type of answer like SQL Server stores DMVs data in master &#038; msdb database. </em></p>
<p><strong>This is an absolutely wrong answer.</strong></p>
<p><strong>The correct answer is:</strong> SQL Server doesn&#8217;t store DMV/DMF related data into the physical disk, but it stores directly into the memory. You can read this data directly from the process space of sqlservr.exe.</p>
<blockquote><p>Because of this reason, most of the DBAs are suggesting that you should not restart the SQL Server. It will drive a SQL Server to poor performance.<br />
Because it clears all query cache, buffer cache and wait type statistics.</p></blockquote>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: Script to find Memory Utilization for each database</title>
		<link>https://www.dbrnd.com/2016/11/sql-server-script-to-find-memory-utilization-for-each-database/</link>
					<comments>https://www.dbrnd.com/2016/11/sql-server-script-to-find-memory-utilization-for-each-database/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Tue, 08 Nov 2016 16:16:45 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[buffer pool]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[memory]]></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[sys.dm_os_buffer_descriptors]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=1968</guid>

					<description><![CDATA[This is one of the most important script for SQL Server Database Administrator. In this post, I am sharing TSQL script to find memory utilization for each SQL Server database. Generally, The majority percentage of the memory is utilized by the SQL Server buffer pool. As a Database Administrator, this is our responsibility to find [&#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%2F11%2Fsql-server-script-to-find-memory-utilization-for-each-database%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Memory%20Utilization%20for%20each%20database" 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%2F11%2Fsql-server-script-to-find-memory-utilization-for-each-database%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Memory%20Utilization%20for%20each%20database" 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%2F11%2Fsql-server-script-to-find-memory-utilization-for-each-database%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Memory%20Utilization%20for%20each%20database" 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%2F11%2Fsql-server-script-to-find-memory-utilization-for-each-database%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Memory%20Utilization%20for%20each%20database" 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%2F11%2Fsql-server-script-to-find-memory-utilization-for-each-database%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Memory%20Utilization%20for%20each%20database" 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%2F11%2Fsql-server-script-to-find-memory-utilization-for-each-database%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Memory%20Utilization%20for%20each%20database" 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%2F11%2Fsql-server-script-to-find-memory-utilization-for-each-database%2F&#038;title=SQL%20Server%3A%20Script%20to%20find%20Memory%20Utilization%20for%20each%20database" data-a2a-url="https://www.dbrnd.com/2016/11/sql-server-script-to-find-memory-utilization-for-each-database/" data-a2a-title="SQL Server: Script to find Memory Utilization for each database"></a></p><p>This is one of the most important script for SQL Server Database Administrator.<br />
In this post, I am sharing TSQL script to find memory utilization for each SQL Server database. </p>
<p>Generally, The majority percentage of the memory is utilized by the SQL Server buffer pool.</p>
<p>As a Database Administrator, this is our responsibility to find which database is consuming the most buffer pool memory. </p>
<p>We can use sys.dm_os_buffer_descriptors DMV to find information on every cached page of the Buffer pool.</p>
<pre class="crayon-plain-tag">SELECT
	CASE 
		WHEN database_id = 32767 
			THEN 'Resource DB' 
		ELSE DB_NAME (database_id) 
	END AS DatabaseName
	,COUNT (1) AS Buffer_PageCount
	,(COUNT (1) * 8)/1024 AS Used_MemoryInMB 	
FROM sys.dm_os_buffer_descriptors
GROUP BY database_id
ORDER BY db_name(database_id)</pre> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2016/11/sql-server-script-to-find-memory-utilization-for-each-database/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>SQL Server: Internal Storage and Memory Architecture Interview Questions and Answers (Day-5)</title>
		<link>https://www.dbrnd.com/2016/05/sql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-5/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sun, 29 May 2016 17:23:37 +0000</pubDate>
				<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[answers]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Interviews]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[pages]]></category>
		<category><![CDATA[questions]]></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[transaction]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=2910</guid>

					<description><![CDATA[What is the max degree of parallelism option? When SQL Server runs on a computer with more than one microprocessor or CPU, it detects the best degree of parallelism, that is, the number of processors employed to run a single statement, for each parallel plan execution. You can use the max degree of parallelism option [&#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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-5%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-5%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-5%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-5%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-5%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-5%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-5%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-5%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-5%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-5%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-5%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-5%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-5%2F&#038;title=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-5%29" data-a2a-url="https://www.dbrnd.com/2016/05/sql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-5/" data-a2a-title="SQL Server: Internal Storage and Memory Architecture Interview Questions and Answers (Day-5)"></a></p><p><strong>What is the max degree of parallelism option?</strong></p>
<blockquote><p>When SQL Server runs on a computer with more than one microprocessor or CPU, it detects the best degree of parallelism, that is, the number of processors employed to run a single statement, for each parallel plan execution. You can use the max degree of parallelism option to limit the number of processors to use in parallel plan execution.</p></blockquote>
<p><strong>What is MAXDOP in SQL Server?</strong></p>
<blockquote><p>Maximum Degree of Parallelism (MAXDOP) is an option in SQL server which enables you to configure SQL Server to use available CPU/CPUs to run a single statement in parallel execution plan. MAXDOP configuration highly depends on SQL Server edition, CPU type and operating system.</p>
<p>In my experience, I had to play with MAXDOP for certain statements coming from different servers in order to find best option of MAXDOP.</p></blockquote>
<p><strong>What is the MAXDOP query hint option?</strong></p>
<blockquote><p>You can override the max degree of parallelism value in queries by specifying the MAXDOP query hint in the query statement.</p></blockquote>
<p><strong>T-SQL script to change max degree of parallelism Option.</strong></p>
<blockquote><p>Setting maximum degree of parallelism to 0 allows SQL Server to use all the available processors up to 64 processors.<br />
To suppress parallel plan generation, set max degree of parallelism to 1. Set the value to a number greater than 1 to restrict the maximum number of processors used by a single query execution.</p><pre class="crayon-plain-tag">sp_configure 'show advanced options', 1;
GO
RECONFIGURE WITH OVERRIDE;
GO
sp_configure 'max degree of parallelism', 8;
GO
RECONFIGURE WITH OVERRIDE;
GO</pre><p>
</p></blockquote>
<p><strong>SQL Server 2014: What is Hekaton?</strong></p>
<blockquote class="wp-embedded-content" data-secret="LR1MqWpsGO"><p><a href="https://www.dbrnd.com/2016/01/sql-server-2014-what-is-hekaton/">SQL Server 2014: What is Hekaton?</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/01/sql-server-2014-what-is-hekaton/embed/#?secret=LR1MqWpsGO" data-secret="LR1MqWpsGO" width="600" height="338" title="&#8220;SQL Server 2014: What is Hekaton?&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p><strong>SQL Server 2014: Create Memory Optimized File Group and Table.</strong></p>
<blockquote class="wp-embedded-content" data-secret="QSkDTl0ZZN"><p><a href="https://www.dbrnd.com/2016/01/sql-server-2014-create-memory-optimized-file-group-and-table/">SQL Server 2014: Create Memory Optimized File Group and Table</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/01/sql-server-2014-create-memory-optimized-file-group-and-table/embed/#?secret=QSkDTl0ZZN" data-secret="QSkDTl0ZZN" width="600" height="338" title="&#8220;SQL Server 2014: Create Memory Optimized File Group and Table&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p><strong>What is a Read-Ahead mechanism?</strong></p>
<blockquote><p>The Database Engine supports a performance optimization mechanism called read-ahead. Read-ahead anticipates the data and index pages needed to fulfill a query execution plan and brings the pages into the buffer cache before they are actually used by the query.</p></blockquote>
<p><strong>What are the types of Read-Ahead?</strong></p>
<blockquote><p>There are two types of Read-Ahead, one is Reading Data Pages and second is Reading Index Pages.</p></blockquote>
<p><strong>How internally pages are modified and written to the disk?</strong></p>
<blockquote><p>First page modification happens in the buffer cache and When a page is modified in the buffer cache, it is not immediately written back to disk;instead, the page is marked as dirty.</p>
<p>This means that a page can have more than one logical write made before it is physically written to disk.</p>
<p>For each logical write, a transaction log record is inserted in the log cache that records the modification. The log records must be written to disk before the associated dirty page is removed from the buffer cache and written to disk. SQL Server uses a technique known as write-ahead logging.</p></blockquote>
<p><strong>What is Bookmark Lookup?</strong></p>
<blockquote><p>When a SQL query requests a small number of rows, the optimizer can use the nonclustered index, if available, on the column(s) in the WHERE clause to retrieve the data. If the query refers to columns that are not part of the nonclustered index used to retrieve the data, then navigation is required from the index row to the corresponding data row in the table to access these columns.This operation is called a bookmark lookup.</p></blockquote>
<p><strong>What is a COLD, DIRTY or CLEAN Buffer?</strong></p>
<blockquote><p>The cold buffer cache has a couple of variants within SQL Server.    Typically it refers to the buffer pool right after restart.   The data cache is not loaded (cold) and requires physical reads to populate the cache.</p>
<p>Modified buffers that have not been written to disk are termed DIRTY buffers and are typically written to disk by checkpoint processing.</p>
<p>A clean buffer is a data page in memory that is NOT MODIFIED.</p></blockquote>
<p><strong>What is the use of DBCC DROPCLEANBUFFERS?</strong></p>
<blockquote><p>DBCC DROPCLEANBUFFERS removes the UNMODIFIED buffers from the buffer pool (no longer hashed) and places them on the free list.</p>
<p>This is often used in basic performance testing to clear the data cache and force the data to be retrieved from disk as a physical read instead of a logic read.</p></blockquote>
<p><strong>What is affinity I/O mask option?</strong></p>
<blockquote><p>The affinity I/O mask option binds SQL Server disk I/O to a specified subset of CPUs. In high-end SQL Server online transactional processing (OLTP) environments, this extension can enhance the performance of SQL Server threads issuing I/Os.</p></blockquote>
<p><strong>What should be the different values for affinity I/O mask?</strong></p>
<ul>
<li>A 1-byte affinity I/O mask covers up to 8 CPUs in a multiprocessor computer.</li>
<li>A 2-byte affinity I/O mask covers up to 16 CPUs in a multiprocessor computer.</li>
<li>A 3-byte affinity I/O mask covers up to 24 CPUs in a multiprocessor computer.</li>
<li>A 4-byte affinity I/O mask covers up to 32 CPUs in a multiprocessor computer.</li>
<li>To cover more than 32 CPUs, configure a four-byte affinity I/O mask for the first 32 CPUs and up to a four-byte affinity64 I/O mask for the remaining CPUs.</li>
</ul>
<p><strong>What Is Eager Writing in SQL Server?</strong></p>
<blockquote><p>Eager writing is a long back implemented idea in SQL server to prevent flooding of the buffer pool with pages that are newly created from minimally logged activities, and physically written to disk.</p>
<p>In SQL Server 2014, eager write doesn’t force dirty pages physical write as quickly as previous versions.   This allows dirty pages to spend their life time in RAM, used by SQL and flush them to free list without ever a physical write to disk as long memory is available. This will significantly increase the performance up to 300% as compared to previous versions.</p></blockquote>
<p><strong>Generally, what kind of operations are recorded in the transaction log file?</strong></p>
<ul>
<li>The start and end of each transaction.</li>
<li>Every data modification (insert, update, or delete).</li>
<li>Every extent and page allocation or deallocation.</li>
<li>Creating or dropping a table or index.</li>
<li>Rollback operations are also logged.</li>
</ul>
<p><strong>What happened if FILEGROWTH is enable and disable?</strong></p>
<ul>
<li>If the FILEGROWTH setting is enabled for the log and space is available on the disk, the file is extended by the amount specified in growth_increment and the new log records are added to the extension.</li>
<li>If the FILEGROWTH setting is not enabled, or the disk that is holding the log file has less free space than the amount specified in growth_increment, an 9002 error is generated.</li>
</ul>
<p><strong>Are you suggesting to truncate an old transaction log?</strong></p>
<blockquote><p>Yes,</p>
<p>If the log records were never deleted from the transaction log, the logical log would grow until it filled all the available space on the disks holding the physical log files. At some point in time, old log records no longer necessary for recovering or restoring a database must be deleted to make way for new log records.</p></blockquote>
<p><strong>Do you think truncate log operation reduces the size of the physical log file?</strong></p>
<blockquote><p>Log truncation does not reduce the size of a physical log file, it reduces the size of the logical log and marks as inactive the virtual logs that do not hold any part of the logical log.</p>
<p>A log shrink operation removes enough inactive virtual logs to reduce the log file to the requested size.</p></blockquote>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: Internal Storage and Memory Architecture Interview Questions and Answers (Day-4)</title>
		<link>https://www.dbrnd.com/2016/05/sql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-4/</link>
					<comments>https://www.dbrnd.com/2016/05/sql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-4/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 28 May 2016 17:26:33 +0000</pubDate>
				<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[answers]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Interviews]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[pages]]></category>
		<category><![CDATA[questions]]></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[transaction]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=2907</guid>

					<description><![CDATA[How SQL Server virtual address space for the buffer pool? When SQL Server starts, it computes the size of virtual address space for the buffer pool based on a number of parameters such as amount of physical memory on the system, number of server threads and various startup parameters. SQL Server reserves the computed amount [&#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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-4%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-4%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-4%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-4%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-4%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-4%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-4%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-4%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-4%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-4%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-4%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-4%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-4%2F&#038;title=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-4%29" data-a2a-url="https://www.dbrnd.com/2016/05/sql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-4/" data-a2a-title="SQL Server: Internal Storage and Memory Architecture Interview Questions and Answers (Day-4)"></a></p><p><strong>How SQL Server virtual address space for the buffer pool?</strong></p>
<blockquote><p>When SQL Server starts, it computes the size of virtual address space for the buffer pool based on a number of parameters such as amount of physical memory on the system, number of server threads and various startup parameters. SQL Server reserves the computed amount of its process virtual address space for the buffer pool, but it acquires only the required amount of physical memory for the current load.</p></blockquote>
<p><strong>What is min server memory and max server memory?</strong></p>
<blockquote><p>The min server memory and max server memory configuration options establish upper and lower limits to the amount of memory used by the buffer pool of the Microsoft SQL Server Database Engine.</p>
<p>buffer pool never drops its memory allocation below the level specified in min server memory, and never acquires more memory than the level specified in max server memory.</p></blockquote>
<p><strong>An organization requires to add more memory in the running SQL Server so is it require to restart SQL Server service?</strong></p>
<blockquote><p>No, it is not required to restart a SQL Server because the buffer manager supports Hot Add Memory, which allows users to add physical memory without restarting the server.</p></blockquote>
<p><strong>What is a dynamic management view to monitor pages in the buffer cache?</strong></p>
<blockquote><p>You can use the sys.dm_os_buffer_descriptors view to monitor the pages in the buffer cache.</p></blockquote>
<p><strong>What is a Torn Page Protection?</strong></p>
<blockquote><p>Torn page protection is primarily a way of detecting page corruptions due to power failures.</p>
<p>It is managing a 2-bit signature is placed at the end of each 512-byte sector at the page and base on this signature value it detects the torn pages.</p></blockquote>
<p><strong>Why Checksum Protection is a very important?</strong></p>
<blockquote><p>Checksum protection is a stronger data integrity checking.</p>
<p>A checksum is calculated for the data in each page that is written, and stored in the page header. Whenever a page with a stored checksum is read from disk, the Database Engine recalculates the checksum for the data in the page and raises error 824 if the new checksum is different from the stored checksum.</p></blockquote>
<p><strong>What is the role of Named Pipes protocol?</strong></p>
<blockquote><p>Named Pipes is a protocol developed for local area networks. A part of memory is used by one process to pass information to another process, so that the output of one is the input of the other. The second process can be local or remote.</p></blockquote>
<p><strong>What is a Page Header?</strong></p>
<blockquote><p>Page number 0- the file header (page type 15). It holds the file header information. There will be only one header page for each data file and that reside in the 0th position. The header page store the file level information like file size, minimum size, max size and file growth.</p></blockquote>
<p><strong>What is PFS?</strong></p>
<blockquote><p>PFS page is the second page in the data file followed by file header. PFS pages are used to track page level allocation. PFS page repeat after every 8088 pages.</p></blockquote>
<p><strong>How many GAM pages will be there in a 7GB data file?</strong></p>
<blockquote><p>A GAM page can hold information of around 64000 extents. That is, a GAM page can hold information of (64000X8X8)/1024 = 4000 MB approximately. In short, a data file of size 7 GB will have two GAM pages.</p></blockquote>
<p><strong>How many SGAM pages will be there in a 7GB data file?</strong></p>
<blockquote><p>A SGAM page can hold information of 64000 extents. That is, a SGAM page can hold information of (64000X8X8)/1024 = 4000 MB. In short, a data file of size 7 GB will have two SGAM page.</p></blockquote>
<p><strong>How SQL Server engine will decide which extents need to be added into a differential backup?</strong></p>
<blockquote><p>A differential backup process scans through DCP page to identify the extents which are modified after the last full backup and add those extents in the Differential backup.</p></blockquote>
<p><strong>What is Boot Page?</strong></p>
<blockquote><p>There is one special data page that exists only once per database. It is the database boot page. The database boot page is always stored in page 9 of file 1, the first file in the primary file group.</p>
<p>The database boot page contains a broad variety of data about the database itself. Here you can find the internal database version, the compatibility level, the database name and the date of the last log backup.</p></blockquote>
<p><strong>What is an IAM page?</strong></p>
<blockquote><p>IAM stands for Index Allocation Map: To catalog all the pages that belong to a single allocation unit, SQL Server utilizes a special type of pages, the Index Allocation Map or IAM pages. Each allocation unit has at least one IAM Page and depending on the size of the table there might be many.</p></blockquote>
<p><strong>What is a Fill Factor?</strong></p>
<blockquote><p>The fill-factor option is provided for fine-tuning index data storage and performance. When an index is created or rebuilt, the fill-factor value determines the percentage of space on each leaf-level page to be filled with data, reserving the remainder on each page as free space for future growth.</p></blockquote>
<p><strong>What are Virtual Log files? How these are created?</strong></p>
<blockquote><p>SQL Server Database Engine divides each physical log file internally into a number of virtual log files. Virtual log files have no fixed size, and there is no fixed number of virtual log files for a physical log file. The Database Engine chooses the size of the virtual log files dynamically while it is creating or extending log files. The Database Engine tries to maintain a small number of virtual files.</p></blockquote>
<p><strong>Important DMV to find memory related information. (From SQL Server 2008)</strong></p><pre class="crayon-plain-tag">select
(physical_memory_in_use_kb/1024)Memory_usedby_Sqlserver_MB,
(locked_page_allocations_kb/1024 )Locked_pages_used_Sqlserver_MB,
(total_virtual_address_space_kb/1024 )Total_VAS_in_MB,
process_physical_memory_low,
process_virtual_memory_low
from sys. dm_os_process_memory;</pre><p>
<strong>What is Locked pages in Memory (LPIM) concept?</strong></p>
<blockquote><p>Locked pages in memory is a privilege given to SQL Server service account which allows SQL Server not to trim its memory excessively when SQLOS ask SQL Server to do so.</p>
<p>When OS will face memory pressure and in turn inform to SQLOS and then SQLOS will ask SQL Server to trim it consumption. Now if LPIM privilege is not there SQL Server will start trimming its memory consumption.</p>
<p>To avoid this it is better to give optimum value to SQL Server memory and leave enough RAM for OS and then give LPIM privilege.</p></blockquote>
<p><strong>What is WOW?</strong></p>
<blockquote><p>When SQL Server 32 bit runs on 64 bit version of windows it is called WOW.</p></blockquote>
<p><strong>How you resolved out of memory error?</strong></p>
<blockquote><p>Make sure you have set OPTIMUM value for MAX SERVER MEMORY SETTING. This is one which should be adopted as best practice.</p>
<p>Try to find out whether it is internal memory pressure or external. By that I mean if SQL Server is facing memory crunch it will be internal if there is less physical RAM on system it will be external.</p>
<p>Try to find if it is SQL Server VAS pressure. Generally in error message if you get like &#8216;Failed Virtual Allocate Bytes: FAIL_VIRTUAL_RESERVE &#8216; this points to fact that OOM error came because there was VAS pressure.</p></blockquote>
<p><strong>What is the difference between Bufferpool and Virtual memory (VAS)?</strong></p>
<blockquote><p>No buffer pool and VAS are not the same thing. In SQL Server direct physical memory access is not allowed any memory request which comes is first mapped to process VAS and then if SQL Server find memory free it would map this VAS address to physical memory and then memory becomes committed. Bufferpool is physical memory VAS is virtual memory.</p></blockquote>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2016/05/sql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-4/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>SQL Server: Internal Storage and Memory Architecture Interview Questions and Answers (Day-3)</title>
		<link>https://www.dbrnd.com/2016/05/sql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-3/</link>
					<comments>https://www.dbrnd.com/2016/05/sql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-3/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Fri, 27 May 2016 17:30:37 +0000</pubDate>
				<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[answers]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Interviews]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[questions]]></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[transaction]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=2902</guid>

					<description><![CDATA[How to find data page information? Execute DBCC IND to check allocated pages of a Table. Execute DBCC PAGE to find more information about the allocated pages. What is a Global Allocation Map (GAM)? GAM has a bit for every extent and it records what extents have been allocated for any use. It stores information [&#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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-3%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-3%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-3%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-3%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-3%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-3%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-3%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-3%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-3%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-3%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-3%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-3%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-3%2F&#038;title=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-3%29" data-a2a-url="https://www.dbrnd.com/2016/05/sql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-3/" data-a2a-title="SQL Server: Internal Storage and Memory Architecture Interview Questions and Answers (Day-3)"></a></p><p><strong><a href="https://www.dbrnd.com/2016/04/sql-server-dbcc-page-and-dbcc-ind-to-find-a-data-page-information/" target="_blank">How to find data page information?</a></strong></p>
<ul>
<li>Execute DBCC IND to check allocated pages of a Table.</li>
<li>Execute DBCC PAGE to find more information about the allocated pages.</li>
</ul>
<p><strong><a href="https://www.dbrnd.com/2016/04/sql-server-gam-and-sgam-pages-to-find-the-extent-space-information/" target="_blank">What is a Global Allocation Map (GAM)?</a></strong></p>
<blockquote><p>GAM has a bit for every extent and it records what extents have been allocated for any use.</p>
<p>It stores information about both Uniform and Mixed extents.</p>
<p>If the bit value is 0, extent is in use and If the bit value is 1, extent is free.</p>
<p>It can hold information about the total 64000 extents and approximately size is 4000 MB.</p></blockquote>
<p><strong><a href="https://www.dbrnd.com/2016/04/sql-server-gam-and-sgam-pages-to-find-the-extent-space-information/" target="_blank">What is a Shared Global Allocation Map (SGAM)?</a></strong></p>
<blockquote><p>SGAM has a bit for every extent and it records what extents are currently being used as mixed extent and have at least one unused page.</p>
<p>If the bit value is 0, either extent is not a mixed extent or it is a mixed extent and all its pages being used.</p>
<p>If the bit value is 1, it is a mixed extent and having an at least one unused page.</p></blockquote>
<p><strong>What is a Differential Changed Map (DCM)?</strong></p>
<blockquote><p>This tracks the extents that have changed since the last BACKUP DATABASE statement. If the bit for an extent is 1, the extent has been modified since the last BACKUP DATABASE statement. If the bit is 0, the extent has not been modified.</p></blockquote>
<p><strong>What is a Bulk Changed Map (BCM)?</strong></p>
<blockquote><p>This tracks the extents that have been modified by bulk logged operations since the last BACKUP LOG statement. If the bit for an extent is 1, the extent has been modified by a bulk logged operation after the last BACKUP LOG statement. If the bit is 0, the extent has not been modified by bulk logged operations.</p></blockquote>
<p><strong>What is RAID and what are different types of RAID configurations?</strong></p>
<blockquote><p>RAID stands for Redundant Array of Independent Disks. RAID defines data storage schemes to divide and replicate data among various disks so that data reliability and I/O performance can be increased.</p></blockquote>
<p><strong>What is a Connection in SQL Server?</strong></p>
<blockquote><p>A connection is established when the user is successfully logged in. The user can then submit one or more Transact-SQL statements for execution. A connection is closed when the user explicitly logs out, or the connection is terminated.</p></blockquote>
<p><strong>What is a SQL Batch?</strong></p>
<blockquote><p>A SQL batch is a set of one or more Transact-SQL statements sent from a client to an instance of SQL Server for execution. It represents a unit of work submitted to the Database Engine by users.</p></blockquote>
<p><strong>What is a Fiber?</strong></p>
<blockquote><p>A fiber is a lightweight thread that requires fewer resources than a Windows thread and can switch context when in user mode. One Windows thread can be mapped to many fibers.</p></blockquote>
<p><strong>What is a Worker Thread?</strong></p>
<blockquote><p>The worker thread represents a logical thread in SQL Server that is internally mapped (1:1) to either a Windows thread or, if lightweight pooling is turned ON, to a fiber.</p></blockquote>
<p><strong>What is the use of lightweight pooling parameter?</strong></p>
<blockquote><p>The server configuration option lightweight pooling controls whether an instance of SQL Server uses Windows threads or fibers.</p>
<p>The default for this option is 0. This indicates that the instance of SQL Server schedules a Windows thread per worker thread.</p>
<p>If lightweight pooling is set to 1, SQL Server uses fibers instead of Windows threads.</p></blockquote>
<p><strong>What is the priority boost option?</strong></p>
<blockquote><p>By default, each instance of SQL Server is a priority of 7, which is referred to as the normal priority. The priority boost configuration option can be used to increase the priority of the threads from an instance of SQL Server to 13. This is referred to as high priority.</p></blockquote>
<p><strong>What is the importance of Buffer in SQL Server?</strong></p>
<blockquote><p>The primary purpose of a SQL Server database is to store and retrieve data.</p>
<p>The disk I/O operations can consume many resources and take a relatively long time to finish, SQL Server focuses on making I/O highly efficient.</p>
<p>Buffer management is a key component in achieving this efficiency.</p>
<p>It caches the repeated data and execution plan in the buffer pool to reduce the disk I/O.</p></blockquote>
<p><strong>What is the size of the buffer in a memory?</strong></p>
<blockquote><p>A buffer is an 8-KB page in memory, the same size as a data or index page.</p></blockquote>
<p><strong>How an internal buffer manager manages the buffer cache?</strong></p>
<blockquote><p>The buffer manager manages the functions for reading data or index pages from the database disk files into the buffer cache and writing modified pages back to disk.</p>
<p>A page remains in the buffer cache until it has either not been referenced for some time or the buffer manager needs the buffer area to read in more data. Data is written back to disk only if it is modified. Data in the buffer cache can be modified multiple times before being written back to disk.</p></blockquote>
<p><strong>What is a ramp-up?</strong></p>
<blockquote><p>The interval between SQL Server startup and when the buffer cache obtains its memory target is called ramp-up.</p>
<p>The ramp-up depends on the number and type of client requests and it is transforming single-page read requests into aligned eight-page requests.</p></blockquote>
<p><strong>What is ROW LOCATOR?</strong></p>
<blockquote><p>If you define a NON CLUSTERED index on a table ,then the index row of a nonclustered index contains a pointer to the corresponding data row of the table. This pointer is called a row locator.</p></blockquote>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2016/05/sql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-3/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>SQL Server: Internal Storage and Memory Architecture Interview Questions and Answers (Day-2)</title>
		<link>https://www.dbrnd.com/2016/05/sql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-2/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Thu, 26 May 2016 17:34:55 +0000</pubDate>
				<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[answers]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Interviews]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[question]]></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[transaction]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=2886</guid>

					<description><![CDATA[What is an Active Log? The section of the log file from the MinLSN to the last-written log record is called the active portion of the log, or the active log. This is the section of the log required to do a full recovery of the database. No part of the active log can ever [&#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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-2%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-2%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-2%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-2%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-2%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-2%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-2%2F&#038;title=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-2%29" data-a2a-url="https://www.dbrnd.com/2016/05/sql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-2/" data-a2a-title="SQL Server: Internal Storage and Memory Architecture Interview Questions and Answers (Day-2)"></a></p><p><strong>What is an Active Log?</strong></p>
<blockquote><p>The section of the log file from the MinLSN to the last-written log record is called the active portion of the log, or the active log. This is the section of the log required to do a full recovery of the database. No part of the active log can ever be truncated. All log records must be truncated from the parts of the log before the MinLSN.</p></blockquote>
<p><strong>What is “Write Ahead Transaction Log”?</strong></p>
<blockquote><p>SQL Server uses a write-ahead log (WAL), which guarantees that no data modifications are written to disk before the associated log record is written to disk.</p>
<p>Data modifications are not made directly to disk, but are made to the copy of the page in the buffer cache. The modification is not written to disk until a checkpoint occurs in the database.</p></blockquote>
<p><strong>What is a Clustered table?</strong></p>
<blockquote><p>Clustered tables are tables that have a clustered index. The data rows are stored in order based on the clustered index key.</p></blockquote>
<p><strong>What is a Heap Table?</strong></p>
<blockquote><p>Heaps are tables that have no clustered index. The data rows are not stored in any particular order, and there is no particular order to the sequence of the data pages.</p></blockquote>
<p><strong>What is a Worktables?</strong></p>
<blockquote><p>The relational engine may need to build a worktable to perform a logical operation specified in an SQL statement. Worktables are internal tables that are used to hold intermediate results. Worktables are generated for certain GROUP BY, ORDER BY, or UNION queries.</p></blockquote>
<p><strong>What is a COMPATIBILITY_LEVEL option of the Database?</strong></p>
<blockquote><p>This lets SQL Server know with which version of SQL Server to make the database compatible.</p></blockquote>
<p><strong>What is AUTO_SHRINK option of the Database?</strong></p>
<blockquote><p>This option either turns on or off the feature that will automatically shrink your database files when free space is available. In almost all cases, this should be set to OFF.</p></blockquote>
<p><strong>What is AUTO_UPDATE_STATISTICS option of the Database?</strong></p>
<blockquote><p>When turned ON, as it should be in most cases, the optimizer will automatically keep statistics updated, in response to data modications.</p></blockquote>
<p><strong>What is READ_WRITE option of the Database?</strong></p>
<blockquote><p>This is the default option and the one to use if you want users to be able to update the database. We could also set the database to READ_ONLY to prevent any users making updates to the database.</p></blockquote>
<p><strong>What is Lazy writer?</strong></p>
<blockquote><p>Lazy writer can adjust the number of buffers in the buffer pool if dynamic memory management is enabled. The lazy writer is a system process that keeps free buffers available by removing infrequently used pages from the buffer cache.</p>
<p>Ensure that a specified number of buffers are free in the Buffer Pool so they can be allocated for use by the server.</p></blockquote>
<p><strong>How you explicitly recompile your execution plan?</strong></p>
<ul>
<li>You can use sp_recompile to explicitly recompile your execution plan.</li>
<li>You can also use WITH RECOMPILE to recompile the stored procedure.</li>
</ul>
<p><strong>What is buffer pool?</strong></p>
<blockquote><p>SQL Server builds a buffer pool in memory to hold pages read from the database. You can minimize physical I/O to the database files by maximizing the size of the buffer pool.</p></blockquote>
<p><strong>What is a query wait option?</strong></p>
<blockquote><p>Use the query wait option to specify the time in seconds (from 0 through 2147483647) that a query waits for resources before timing out. If the default value of -1 is used, or if –1 is specified, then the time-out is calculated as 25 times of the estimated query cost.</p>
<p>You can change query wait value using sp_configure.</p></blockquote>
<p><strong>How SQL Server executes a single SELECT statement?</strong></p>
<ul>
<li>The parser scans the SELECT statement and breaks it into logical units such as keywords, expressions, operators, and identifiers.</li>
<li>A query tree, sometimes referred to as a sequence tree, is built describing the logical steps needed to transform the source data into the format required by the result set.</li>
<li>The query optimizer analyzes different ways the source tables can be accessed and create an optimized version of the query tree is called the execution plan.</li>
<li>The relational engine starts executing the execution plan.</li>
<li>The relational engine processes the data and returns the result set to the client.</li>
</ul>
<p><strong>What is Query Plan?</strong></p>
<blockquote><p>The bulk of the execution plan is a re-entrant, read-only data structure used by any number of users. This is referred to as the query plan. No user context is stored in the query plan. There are never more than one or two copies of the query plan in memory.</p></blockquote>
<p><strong>What is Execution Context?</strong></p>
<blockquote><p>Each user that is currently executing the query has a data structure that holds the data specific to their execution, such as parameter values. This data structure is referred to as the execution context.</p></blockquote>
<p><strong>How SQL Server uses procedure cache?</strong></p>
<blockquote><p>When any SQL statement is executed, it first looks through the procedure cache to verify that an existing execution plan for the same SQL statement exists.</p>
<p>It reuses any existing plan it finds, saving the overhead of recompiling the SQL statement</p></blockquote>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: Internal Storage and Memory Architecture Interview Questions and Answers (Day-1)</title>
		<link>https://www.dbrnd.com/2016/05/sql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-1/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Wed, 25 May 2016 18:22:10 +0000</pubDate>
				<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[page]]></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[Storage]]></category>
		<category><![CDATA[transaction]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=2881</guid>

					<description><![CDATA[Tell me something about the SQL Server Pages. In SQL Server, the page size is 8 KB. This means SQL Server databases have 128 pages per megabyte. Each page begins with a 96-byte header that is used to store system information about the page. This information includes the page number, page type, the amount of [&#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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-1%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-1%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-1%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-1%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-1%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-1%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-1%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-1%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-1%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-1%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-1%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-1%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-1%2F&#038;title=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-1%29" data-a2a-url="https://www.dbrnd.com/2016/05/sql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-1/" data-a2a-title="SQL Server: Internal Storage and Memory Architecture Interview Questions and Answers (Day-1)"></a></p><p><strong><a href="https://www.dbrnd.com/2016/04/sql-server-the-internal-structure-of-the-data-page/" target="_blank">Tell me something about the SQL Server Pages.</a></strong></p>
<blockquote><p>In SQL Server, the page size is 8 KB. This means SQL Server databases have 128 pages per megabyte. Each page begins with a 96-byte header that is used to store system information about the page. This information includes the page number, page type, the amount of free space on the page, and the allocation unit ID of the object that owns the page.</p></blockquote>
<p><strong>What is a row offset of pages?</strong></p>
<blockquote><p>For each data row there is a 2-byte entry, saving the offset.</p>
<p>A row offset table starts at the end of the page, and each row offset table contains one entry for each row on the page.</p></blockquote>
<p><strong><a href="https://www.dbrnd.com/2016/04/sql-server-what-happened-when-row-overflow-and-data-exceeding-8kb/" target="_blank">What is the ROW_OVERFLOW_DATA allocation unit?</a></strong></p>
<blockquote><p>When the total row size of all fixed and variable columns in a table exceeds the 8,060 byte limitation, SQL Server dynamically moves one or more variable length columns to pages in the ROW_OVERFLOW_DATA allocation unit, starting with the column with the largest width.</p></blockquote>
<p><strong>What is a IN_ROW_DATA allocation unit?</strong></p>
<blockquote><p>It is an allocation unit for data page and index page.</p></blockquote>
<p><strong>What is a LOB_DATA allocation unit?</strong></p>
<blockquote><p>It is an allocation unit for text, ntext, image, xml, varchar (max), nvarchar (max), varbinary (max) data types.</p></blockquote>
<p><strong>Why 24-byte pointer is require with the ROW_OVERFLOW_DATA allocation unit?</strong></p>
<blockquote><p>When a combination of varchar, nvarchar, varbinary, sql_variant, or CLR user-defined type columns exceeds this 8KB limit, the Database Engine moves the record column with the largest width to another page in the ROW_OVERFLOW_DATA allocation unit, while maintaining a 24-byte pointer on the original page.</p></blockquote>
<p><strong>What is the size of the data page header?</strong></p>
<blockquote><p>The size of the data page header is 96-byte.</p></blockquote>
<p><strong>What are the different types of pages and what do they store?</strong></p>
<ul>
<li>Page types include</li>
<li>Data page</li>
<li>Index page</li>
<li>Text/Image page</li>
<li>Page Free Space</li>
<li>Global Allocation Map (GAM) &#8211; extent allocation information</li>
<li>Shared Global Allocation Map (SGAM) &#8211; mixed extent with at least one unused page information</li>
<li>Bulk Changed Map &#8211; extents that got changed by a bulk logged operation</li>
<li>Differential Changed Map &#8211; extents that got changed since last BACKUP DATABASE statement</li>
<li>Index allocation map</li>
</ul>
<p><strong><a href="https://www.dbrnd.com/2016/04/sql-server-understanding-the-role-of-extent/" target="_blank">What is an Extent?</a></strong></p>
<blockquote><p>Extents are the basic unit in which space is managed. An extent is eight physically contiguous pages, or 64 KB. This means SQL Server databases have 16 extents per megabyte.</p></blockquote>
<p><strong>What are the different types of Extents?</strong></p>
<ul>
<li>Uniform extents are owned by a single object; all eight pages in the extent can only be used by the owning object.</li>
<li>Mixed extents are shared by up to eight objects. Each of the eight pages in the extent can be owned by a different object.</li>
</ul>
<p><strong>What are the different types of database files in SQL Server?</strong></p>
<ul>
<li>Primary data files: The primary data file is the starting point of the database and points to the other files in the database. Every database has one primary data file. The recommended file name extension for primary data files is .mdf.</li>
<li>Secondary data files: Secondary data files make up all the data files, other than the primary data file. Some databases may not have any secondary data files, while others have several secondary data files. The recommended file name extension for secondary data files is .ndf.</li>
<li>Log files: Log files hold all the log information that is used to recover the database. There must be at least one log file for each database, although there can be more than one. The recommended file name extension for log files is .ldf.</li>
</ul>
<p><strong>Explained something about SQL Server Access Methods.</strong></p>
<ul>
<li>SQL doesn’t directly retrieve from disk, it makes requests to buffer manager which serves up the page in cache before rendering out.</li>
<li>When scan starts, SQL Server can use look-ahead mechanisms to qualify rows and index entries on a page. The retrieving of rows that meet specified criteria is known as a qualified retrieval.</li>
</ul>
<p><strong>Tell us something about the SQL Server Database Transactions.</strong></p>
<ul>
<li>Provides support for Atomicity, Consistency, Isolation and Durability.</li>
<li>Log records are always written to disk before the data pages where changes were made are actually written.</li>
<li>Writes to the transaction log are synchronous while writes to data pages can be asynchronous.</li>
</ul>
<p><strong>What is the sparse file?</strong></p>
<blockquote><p>A database snapshot that is created by a user stores its data in one or more sparse files. Sparse file technology is a feature of the NTFS file system.</p></blockquote>
<p><strong>What is the Database Filegroups?</strong></p>
<blockquote><p>Database objects and files can be grouped together in filegroups for allocation and administration purposes.</p></blockquote>
<p><strong>What are the different type of Filegroups?</strong></p>
<ul>
<li>Primary: The primary filegroup contains the primary data file and any other files not specifically assigned to another filegroup.</li>
<li>User-defined: User-defined filegroups are any filegroups that are specified by using the FILEGROUP keyword in a CREATE DATABASE or ALTER DATABASE statement.</li>
</ul>
<p><strong>What are Page Splits?</strong></p>
<blockquote><p>When there is not enough room on a page for a new row, a server splits the page, allocates a new page, and moves some rows to the new page.</p>
<p>Page splits are considered as a very bad performance and there are number of techniques which is used to reduce the risk of page splits.</p></blockquote>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
