<?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>Trace &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/trace/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, 07 Jan 2018 19:20:21 +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: Script to get the definition of Trace</title>
		<link>https://www.dbrnd.com/2018/01/sql-server-script-to-get-the-definition-of-trace-fn_trace_geteventinfo/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sun, 21 Jan 2018 16:16:52 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[fn_trace_geteventinfo]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Error]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tuning]]></category>
		<category><![CDATA[SQL Server Programming]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[Trace]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=6984</guid>

					<description><![CDATA[In this post, I am sharing a SQL DBA Script for getting the definition of default trace of SQL Server. Why is this important? When you are running multiple traces on your SQL Server while troubleshooting particular event, you should know the definition of the particular trace which helps you in the better investigation. Using [&#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%2F2018%2F01%2Fsql-server-script-to-get-the-definition-of-trace-fn_trace_geteventinfo%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20get%20the%20definition%20of%20Trace" 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%2F2018%2F01%2Fsql-server-script-to-get-the-definition-of-trace-fn_trace_geteventinfo%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20get%20the%20definition%20of%20Trace" 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%2F2018%2F01%2Fsql-server-script-to-get-the-definition-of-trace-fn_trace_geteventinfo%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20get%20the%20definition%20of%20Trace" 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%2F2018%2F01%2Fsql-server-script-to-get-the-definition-of-trace-fn_trace_geteventinfo%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20get%20the%20definition%20of%20Trace" 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%2F2018%2F01%2Fsql-server-script-to-get-the-definition-of-trace-fn_trace_geteventinfo%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20get%20the%20definition%20of%20Trace" 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%2F2018%2F01%2Fsql-server-script-to-get-the-definition-of-trace-fn_trace_geteventinfo%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20get%20the%20definition%20of%20Trace" 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%2F2018%2F01%2Fsql-server-script-to-get-the-definition-of-trace-fn_trace_geteventinfo%2F&#038;title=SQL%20Server%3A%20Script%20to%20get%20the%20definition%20of%20Trace" data-a2a-url="https://www.dbrnd.com/2018/01/sql-server-script-to-get-the-definition-of-trace-fn_trace_geteventinfo/" data-a2a-title="SQL Server: Script to get the definition of Trace"></a></p><p>In this post, I am sharing a SQL DBA Script for getting the definition of default trace of SQL Server. </p>
<p><strong>Why is this important?</strong></p>
<blockquote><p>When you are running multiple traces on your SQL Server while troubleshooting particular event, you should know the definition of the particular trace which helps you in the better investigation. </p></blockquote>
<p>Using fn_trace_geteventinfo, you can get the trace definition.</p>
<p><strong>Get the default trace_id of instance:</strong></p>
<pre class="crayon-plain-tag">SELECT distinct traceid 
FROM ::fn_trace_getinfo(default)
GO

traceid
-----------
1</pre> </p>
<p><strong>Pass trace_id in fn_trace_geteventinfo() and get the definition of Trace:</strong></p>
<pre class="crayon-plain-tag">select
	tg.eventid as EventID
	,te.Name as EventName 
	,tg.columnid as ColumnID
	,cols. name as ColumnName
from :: fn_trace_geteventinfo (1) as tg 
INNER JOIN sys.trace_events as te 
	ON tg.eventid = te.trace_event_id
INNER JOIN sys.trace_columns cols 
	ON tg.columnid = cols.trace_column_id</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: The list of Important Trace Flags</title>
		<link>https://www.dbrnd.com/2016/12/sql-server-the-list-of-important-trace-flags/</link>
					<comments>https://www.dbrnd.com/2016/12/sql-server-the-list-of-important-trace-flags/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Wed, 28 Dec 2016 19:41:21 +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[Trace]]></category>
		<category><![CDATA[Trace Flag]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=1975</guid>

					<description><![CDATA[In this post, I am sharing some of the important Trace Flag of the SQL Server. Trace flags are frequently used to debug stored procedures and diagnose performance issues. There are two types of Trace Flag, you can enable particular trace Globally and Session Specific. You can also visit this article, How to enable and [&#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%2F12%2Fsql-server-the-list-of-important-trace-flags%2F&amp;linkname=SQL%20Server%3A%20The%20list%20of%20Important%20Trace%20Flags" 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%2F12%2Fsql-server-the-list-of-important-trace-flags%2F&amp;linkname=SQL%20Server%3A%20The%20list%20of%20Important%20Trace%20Flags" 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%2F12%2Fsql-server-the-list-of-important-trace-flags%2F&amp;linkname=SQL%20Server%3A%20The%20list%20of%20Important%20Trace%20Flags" 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%2F12%2Fsql-server-the-list-of-important-trace-flags%2F&amp;linkname=SQL%20Server%3A%20The%20list%20of%20Important%20Trace%20Flags" 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%2F12%2Fsql-server-the-list-of-important-trace-flags%2F&amp;linkname=SQL%20Server%3A%20The%20list%20of%20Important%20Trace%20Flags" 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%2F12%2Fsql-server-the-list-of-important-trace-flags%2F&amp;linkname=SQL%20Server%3A%20The%20list%20of%20Important%20Trace%20Flags" 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%2F12%2Fsql-server-the-list-of-important-trace-flags%2F&#038;title=SQL%20Server%3A%20The%20list%20of%20Important%20Trace%20Flags" data-a2a-url="https://www.dbrnd.com/2016/12/sql-server-the-list-of-important-trace-flags/" data-a2a-title="SQL Server: The list of Important Trace Flags"></a></p><p>In this post, I am sharing some of the important Trace Flag of the SQL Server.</p>
<p>Trace flags are frequently used to debug stored procedures and diagnose performance issues.</p>
<p>There are two types of Trace Flag, you can enable particular trace Globally and Session Specific.</p>
<p><strong><a href="https://www.dbrnd.com/2015/05/script-to-enable-and-disable-default-trace-sql-server/" target="_blank">You can also visit this article, How to enable and disable default trace of SQL Server.</a></strong></p>
<p><strong>Enable or Disable Trace Flag for Session:</strong></p>
<pre class="crayon-plain-tag">DBCC TRACEON (TraceNumber)
DBCC TRACEOFF (TraceNumber)</pre> </p>
<p><strong>Enable or Disable Trace Flag for Globally:</strong></p>
<pre class="crayon-plain-tag">DBCC TRACEON (TraceNumber,-1)
DBCC TRACEOFF (TraceNumber,-1)</pre> </p>
<p><strong>Example:</strong></p>
<pre class="crayon-plain-tag">DBCC TRACEON (3205)</pre> </p>
<p><strong>Trace Flag 1222: </strong><br />
Write the information about resources and types of locks in an XML format.</p>
<p><strong>Trace Flag 1204:</strong><br />
Write the information about the deadlock in a text format. </p>
<p><strong>Trace Flag 7806:</strong><br />
Enables a dedicated administrator connection on SQL Server Express Edition. </p>
<p><strong>Trace Flag 1806:</strong><br />
You can disable the instant file initialization. </p>
<p><strong>Trace Flag 4616:</strong><br />
The Application can access server level roles. </p>
<p><strong>Trace Flag 3625:</strong><br />
It limits the information for those users who are not part of the sysadmin role and it prevents sensitive information. </p>
<p><strong>Trace Flag 3608:</strong><br />
It stops the SQL Server to start automatically backup and restore for all Databases except the Master database.</p>
<p><strong>Trace Flag 3226:</strong><br />
When we are taking log backups frequently, we can avoid some unnecessary additional log information. </p>
<p><strong>Trace Flag 3014:</strong><br />
Trace more information of error log during the backup operation. </p>
<p><strong>Trace Flag 3505:</strong><br />
It disables all information about the instant file initialization. </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2016/12/sql-server-the-list-of-important-trace-flags/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>SQL Server: Script to find the status of Trace is running or not</title>
		<link>https://www.dbrnd.com/2016/03/sql-server-script-to-find-the-status-of-trace-is-running-or-not/</link>
					<comments>https://www.dbrnd.com/2016/03/sql-server-script-to-find-the-status-of-trace-is-running-or-not/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Fri, 18 Mar 2016 19:13:24 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[default trace]]></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.traces]]></category>
		<category><![CDATA[Trace]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=1945</guid>

					<description><![CDATA[In this post, I am sharing a TSQL script to find the status of SQL Server Trace. The SQL Server Trace is very important for tracing the different SQL Server events like errors, object changes information and others. Using this script you can find different information of the Trace like Trace is running or not, [&#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%2F03%2Fsql-server-script-to-find-the-status-of-trace-is-running-or-not%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20the%20status%20of%20Trace%20is%20running%20or%20not" 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%2F03%2Fsql-server-script-to-find-the-status-of-trace-is-running-or-not%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20the%20status%20of%20Trace%20is%20running%20or%20not" 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%2F03%2Fsql-server-script-to-find-the-status-of-trace-is-running-or-not%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20the%20status%20of%20Trace%20is%20running%20or%20not" 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%2F03%2Fsql-server-script-to-find-the-status-of-trace-is-running-or-not%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20the%20status%20of%20Trace%20is%20running%20or%20not" 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%2F03%2Fsql-server-script-to-find-the-status-of-trace-is-running-or-not%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20the%20status%20of%20Trace%20is%20running%20or%20not" 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%2F03%2Fsql-server-script-to-find-the-status-of-trace-is-running-or-not%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20the%20status%20of%20Trace%20is%20running%20or%20not" 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%2F03%2Fsql-server-script-to-find-the-status-of-trace-is-running-or-not%2F&#038;title=SQL%20Server%3A%20Script%20to%20find%20the%20status%20of%20Trace%20is%20running%20or%20not" data-a2a-url="https://www.dbrnd.com/2016/03/sql-server-script-to-find-the-status-of-trace-is-running-or-not/" data-a2a-title="SQL Server: Script to find the status of Trace is running or not"></a></p><p>In this post, I am sharing a TSQL script to find the status of SQL Server Trace. </p>
<p>The SQL Server Trace is very important for tracing the different SQL Server events like errors, object changes information and others. </p>
<p>Using this script you can find different information of the Trace like Trace is running or not, Type of the trace, File path of the trace. </p>
<p><a href="https://www.dbrnd.com/2015/05/script-to-enable-and-disable-default-trace-sql-server/" target="_blank"><strong>You can also visit this article to enable and disable SQL Server Default Trace. </strong></a></p>
<p>I am fetching require trace column using an sys.traces. </p>
<p><strong>Below is a script:</strong></p>
<pre class="crayon-plain-tag">SELECT 
	CASE T.is_default
		WHEN 1 THEN 'Default/System Trace'
		WHEN 0 THEN 'User Defined Trace'
	END AS TraceType
	,CASE T.status
		WHEN 1 THEN 'Running'
		WHEN 0 THEN 'Stopped'
	END AS TraceStrace
	,ES.session_id AS SessionID
	,ES.login_name AS LoginName
	,T.Path AS TraceFilePath
FROM sys.traces AS T
LEFT JOIN sys.dm_exec_sessions AS ES
	ON T.reader_spid = ES.session_id</pre> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2016/03/sql-server-script-to-find-the-status-of-trace-is-running-or-not/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
