<?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>SQL Server Restart &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/sql-server-restart/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Mon, 24 Jun 2019 19:35:43 +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: How to find a time when was SQL Server Restarted</title>
		<link>https://www.dbrnd.com/2019/05/sql-server-how-to-find-a-time-when-was-sql-server-restarted-dm_exec_sessions-dm_os_sys_info-traces/</link>
					<comments>https://www.dbrnd.com/2019/05/sql-server-how-to-find-a-time-when-was-sql-server-restarted-dm_exec_sessions-dm_os_sys_info-traces/#respond</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 20 May 2019 16:16:01 +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[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 Restart]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[sys.databases]]></category>
		<category><![CDATA[sys.dm_exec_sessions]]></category>
		<category><![CDATA[sys.traces]]></category>
		<category><![CDATA[sysdatabases]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=4089</guid>

					<description><![CDATA[In this post, I am sharing few different scripts to find when was the SQL Server restarted. The DBAs must know about this because they have to make sure about data consistency. For example: when SQL Server restarted because of power failure, system failure, update failure or any other reason, We must check the last [&#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%2F2019%2F05%2Fsql-server-how-to-find-a-time-when-was-sql-server-restarted-dm_exec_sessions-dm_os_sys_info-traces%2F&amp;linkname=SQL%20Server%3A%20How%20to%20find%20a%20time%20when%20was%20SQL%20Server%20Restarted" 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%2F2019%2F05%2Fsql-server-how-to-find-a-time-when-was-sql-server-restarted-dm_exec_sessions-dm_os_sys_info-traces%2F&amp;linkname=SQL%20Server%3A%20How%20to%20find%20a%20time%20when%20was%20SQL%20Server%20Restarted" 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%2F2019%2F05%2Fsql-server-how-to-find-a-time-when-was-sql-server-restarted-dm_exec_sessions-dm_os_sys_info-traces%2F&amp;linkname=SQL%20Server%3A%20How%20to%20find%20a%20time%20when%20was%20SQL%20Server%20Restarted" 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%2F2019%2F05%2Fsql-server-how-to-find-a-time-when-was-sql-server-restarted-dm_exec_sessions-dm_os_sys_info-traces%2F&amp;linkname=SQL%20Server%3A%20How%20to%20find%20a%20time%20when%20was%20SQL%20Server%20Restarted" 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%2F2019%2F05%2Fsql-server-how-to-find-a-time-when-was-sql-server-restarted-dm_exec_sessions-dm_os_sys_info-traces%2F&amp;linkname=SQL%20Server%3A%20How%20to%20find%20a%20time%20when%20was%20SQL%20Server%20Restarted" 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%2F2019%2F05%2Fsql-server-how-to-find-a-time-when-was-sql-server-restarted-dm_exec_sessions-dm_os_sys_info-traces%2F&amp;linkname=SQL%20Server%3A%20How%20to%20find%20a%20time%20when%20was%20SQL%20Server%20Restarted" 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%2F2019%2F05%2Fsql-server-how-to-find-a-time-when-was-sql-server-restarted-dm_exec_sessions-dm_os_sys_info-traces%2F&#038;title=SQL%20Server%3A%20How%20to%20find%20a%20time%20when%20was%20SQL%20Server%20Restarted" data-a2a-url="https://www.dbrnd.com/2019/05/sql-server-how-to-find-a-time-when-was-sql-server-restarted-dm_exec_sessions-dm_os_sys_info-traces/" data-a2a-title="SQL Server: How to find a time when was SQL Server Restarted"></a></p><p>In this post, I am sharing few different scripts to find when was the SQL Server restarted.</p>
<blockquote><p>The DBAs must know about this because they have to make sure about data consistency.
</p></blockquote>
<blockquote><p>For example: when SQL Server restarted because of power failure, system failure, update failure or any other reason, We must check the last restarted time of SQL Server. Because from that time, we have to restore data from our backup disks to the actual disk.</p></blockquote>
<blockquote><p>When SQL Server restarted, few transactions also rollback. We have to also identify these transactions by knowing the correct time when SQL Server actually restarted.
</p></blockquote>
<p><strong>Using sys.dm_exec_sessions:</strong></p>
<pre class="crayon-plain-tag">SELECT login_time FROM sys.dm_exec_sessions WHERE session_id = 1
GO</pre> </p>
<p><strong>Using sys.dm_os_sys_info:</strong></p>
<pre class="crayon-plain-tag">SELECT sqlserver_start_time FROM sys.dm_os_sys_info
GO</pre> </p>
<p><strong>Using sys.databases:</strong></p>
<pre class="crayon-plain-tag">SELECT create_date FROM sys.databases WHERE name = 'tempdb' 
GO</pre> </p>
<p><strong>Using sys.traces:</strong></p>
<pre class="crayon-plain-tag">SELECT start_time FROM sys.traces WHERE is_default = 1  
GO</pre> </p>
<p><strong>Using sysdatabases: </strong></p>
<pre class="crayon-plain-tag">SELECT crdate FROM sysdatabases WHERE name='tempdb'  
GO</pre> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2019/05/sql-server-how-to-find-a-time-when-was-sql-server-restarted-dm_exec_sessions-dm_os_sys_info-traces/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
