<?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>sys.dm_db_index_operational_stats &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/sys-dm_db_index_operational_stats/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>Sun, 08 Jan 2017 15:25:00 +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: Get the Latches Usage and Information (sys.dm_db_index_operational_stats)</title>
		<link>https://www.dbrnd.com/2017/01/sql-server-get-the-latches-usage-and-information-sys-dm_db_index_operational_stats/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 07 Jan 2017 15:23:55 +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[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_db_index_operational_stats]]></category>
		<category><![CDATA[sys.dm_os_latch_stats]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=2471</guid>

					<description><![CDATA[In the previous article, I have shared basic theory about the SQL Server Latches. In this post, I am sharing T-SQL script to find different information and usage statistics of the SQL Server Latches. Using sys.dm_db_index_operational_stats: Using this dynamic management function, you can find information about the Locks and Latches. You can pass different parameters [&#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-get-the-latches-usage-and-information-sys-dm_db_index_operational_stats%2F&amp;linkname=SQL%20Server%3A%20Get%20the%20Latches%20Usage%20and%20Information%20%28sys.dm_db_index_operational_stats%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%2F2017%2F01%2Fsql-server-get-the-latches-usage-and-information-sys-dm_db_index_operational_stats%2F&amp;linkname=SQL%20Server%3A%20Get%20the%20Latches%20Usage%20and%20Information%20%28sys.dm_db_index_operational_stats%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%2F2017%2F01%2Fsql-server-get-the-latches-usage-and-information-sys-dm_db_index_operational_stats%2F&amp;linkname=SQL%20Server%3A%20Get%20the%20Latches%20Usage%20and%20Information%20%28sys.dm_db_index_operational_stats%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%2F2017%2F01%2Fsql-server-get-the-latches-usage-and-information-sys-dm_db_index_operational_stats%2F&amp;linkname=SQL%20Server%3A%20Get%20the%20Latches%20Usage%20and%20Information%20%28sys.dm_db_index_operational_stats%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%2F2017%2F01%2Fsql-server-get-the-latches-usage-and-information-sys-dm_db_index_operational_stats%2F&amp;linkname=SQL%20Server%3A%20Get%20the%20Latches%20Usage%20and%20Information%20%28sys.dm_db_index_operational_stats%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%2F2017%2F01%2Fsql-server-get-the-latches-usage-and-information-sys-dm_db_index_operational_stats%2F&amp;linkname=SQL%20Server%3A%20Get%20the%20Latches%20Usage%20and%20Information%20%28sys.dm_db_index_operational_stats%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%2F2017%2F01%2Fsql-server-get-the-latches-usage-and-information-sys-dm_db_index_operational_stats%2F&#038;title=SQL%20Server%3A%20Get%20the%20Latches%20Usage%20and%20Information%20%28sys.dm_db_index_operational_stats%29" data-a2a-url="https://www.dbrnd.com/2017/01/sql-server-get-the-latches-usage-and-information-sys-dm_db_index_operational_stats/" data-a2a-title="SQL Server: Get the Latches Usage and Information (sys.dm_db_index_operational_stats)"></a></p><p>In the previous article, I have shared basic theory about the SQL Server Latches. </p>
<p>In this post, I am sharing T-SQL script to find different information and usage statistics of the SQL Server Latches.</p>
<p><strong>Using sys.dm_db_index_operational_stats:</strong></p>
<p>Using this dynamic management function, you can find information about the Locks and Latches.<br />
You can pass different parameters like: DatabaseID, TableID, IndexID, and PartitionNumber. </p>
<pre class="crayon-plain-tag">/* Syntax: 
Sys.dm_db_index_operational_stats 
(
   Database identifier | DEFAULT | 0 | NULL
   ,Object identifier | DEFAULT | 0 | NULL
   ,Index identifier | DEFAULT | -1 | 0 | NULL
   ,Partition number | DEFAULT | 0 | NULL
)
*/


SELECT 
	OBJECT_NAME(object_id)
	,page_latch_wait_count
	,page_latch_wait_in_ms
	,tree_page_latch_wait_count
	,tree_page_latch_wait_in_ms  
	,Page_io_latch_wait_count
	,Page_io_latch_wait_in_ms
FROM sys.dm_db_index_operational_stats (DB_ID(), NULL, NULL, NULL)</pre> </p>
<p><strong>Using sys.dm_os_latch_stats:</strong></p>
<p>Using this dynamic management view, you can find different Latches counter information. </p>
<p>Using below DBCC, You can clear this view data for latest updated stats. </p>
<pre class="crayon-plain-tag">DBCC SQLPERF('sys.dm_os_latch_stats', CLEAR)</pre> </p>
<p>SELECT buffer related information. </p>
<pre class="crayon-plain-tag">SELECT * FROM sys.dm_os_latch_stats  WHERE latch_class = 'buffer'</pre> </p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
