<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Pop Quiz Hotshot!  Your Server Dies!  What do you do?  What do you do?</title>
	<atom:link href="http://www.made2mentor.com/2009/11/pop-quiz-hotshot/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.made2mentor.com/2009/11/pop-quiz-hotshot/</link>
	<description>Data Warehousing, Microsoft Business Intelligence, and Other Cool Stuff</description>
	<lastBuildDate>Tue, 10 Jan 2012 15:10:51 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: David</title>
		<link>http://www.made2mentor.com/2009/11/pop-quiz-hotshot/comment-page-1/#comment-35564</link>
		<dc:creator>David</dc:creator>
		<pubDate>Sat, 30 Oct 2010 19:56:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.made2mentor.com/?p=1795#comment-35564</guid>
		<description>Larry, I glanced at your code and it&#039;s interesting. However, there are much easier ways to make a copy of the M2M database for reporting. The easiest I can think of is simply restoring a backup of your live data to another server for reporting. That way you don&#039;t have to worry about users being out of the system or other issues. 

BTW, you really should look into the new M-Data Analytics project. I think we could use your skills and you seem like someone who would like to go further with SQL Server as well. 

I&#039;ll be blogging prolifically about it in the coming weeks.</description>
		<content:encoded><![CDATA[<p>Larry, I glanced at your code and it&#8217;s interesting. However, there are much easier ways to make a copy of the M2M database for reporting. The easiest I can think of is simply restoring a backup of your live data to another server for reporting. That way you don&#8217;t have to worry about users being out of the system or other issues. </p>
<p>BTW, you really should look into the new M-Data Analytics project. I think we could use your skills and you seem like someone who would like to go further with SQL Server as well. </p>
<p>I&#8217;ll be blogging prolifically about it in the coming weeks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Larry</title>
		<link>http://www.made2mentor.com/2009/11/pop-quiz-hotshot/comment-page-1/#comment-35558</link>
		<dc:creator>Larry</dc:creator>
		<pubDate>Sat, 30 Oct 2010 19:13:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.made2mentor.com/?p=1795#comment-35558</guid>
		<description>I created a &quot;test/Report&quot; SQL server to provide access for Excel users to do as they please without affecting the prod environment. It runs without taking M2M offline - using a snapshot publication initially.

/* This procedure exists on the Report  M2M server - */
/* I also have a code snippet that confirms that there are no open tansacts or users on the table prior to copy*/
/* I drop the report server tabels, then move only the core M2M tables over, then run any SQL Stored Procedures on the report server - thus taking the load off the production server and generating whatever they need via a schedule task using VB.Net */

CREATE PROCEDURE spn_CopyFromM2MProdSQL
As
	/* Drop the Tables from the Report server - the report server name is M2MRPTSQLServer, the database is &#039;RPTM2MDATA01&#039;  */
	begin
		if exists(select * from RPTM2MDATA01.INFORMATION_SCHEMA.tables where TABLE_CATALOG = &#039;RPTM2MDATA01&#039; AND TABLE_SCHEMA=&#039;dbo&#039; AND TABLE_NAME=&#039;apitem&#039;)
			DROP TABLE RPTM2MDATA01.dbo.apitem
		if exists(select * from RPTM2MDATA01.INFORMATION_SCHEMA.tables where TABLE_CATALOG = &#039;RPTM2MDATA01&#039; AND TABLE_SCHEMA=&#039;dbo&#039; AND TABLE_NAME=&#039;apmast&#039;)
			DROP TABLE ReportM2MDATA01.dbo.apmast
		if exists(select * from RPTM2MDATA01.INFORMATION_SCHEMA.tables where TABLE_CATALOG = &#039;RPTM2MDATA01&#039; AND TABLE_SCHEMA=&#039;dbo&#039; AND TABLE_NAME=&#039;apvend&#039;)
			DROP TABLE ReportM2MDATA01.dbo.apvend
	
		/*repeat for each table you may need, like SOMAST, INMAST etc - Follow the same for other companies.*/
	end

	/* COPY the database tables from the production SQL M2M instance - M2MProdSQL to the new M2M Report Server - &#039;RPTM2MDATA01&#039; */
	begin
		/*M2MProdSQL is the production M2M SQL server */
		SELECT * INTO m2mdata01.dbo.apitem FROM M2MProdSQL.m2mdata01.dbo.apitem
		SELECT * INTO m2mdata01.dbo.apmast FROM M2MProdSQL.m2mdata01.dbo.apmast
		SELECT * INTO m2mdata01.dbo.apvend FROM M2MProdSQL.m2mdata01.dbo.apvend
	end
GO


Do you want to know how many connections you have to each SQL database? I find this useful, as every now and then I find old connections that should be cleared but hung for some reason or other.

()
select db_name(dbid),count(*) from master..sysprocesses
where spid &gt; 49 --everyting below 50 is SQL Server itself
group by db_name(dbid)


database		connections
M2MDATA01	6
M2MDATA50	2
master		1

Then run ()
exec sp_who2  

Just a little snippet if anyone needs</description>
		<content:encoded><![CDATA[<p>I created a &#8220;test/Report&#8221; SQL server to provide access for Excel users to do as they please without affecting the prod environment. It runs without taking M2M offline &#8211; using a snapshot publication initially.</p>
<p>/* This procedure exists on the Report  M2M server &#8211; */<br />
/* I also have a code snippet that confirms that there are no open tansacts or users on the table prior to copy*/<br />
/* I drop the report server tabels, then move only the core M2M tables over, then run any SQL Stored Procedures on the report server &#8211; thus taking the load off the production server and generating whatever they need via a schedule task using VB.Net */</p>
<p>CREATE PROCEDURE spn_CopyFromM2MProdSQL<br />
As<br />
	/* Drop the Tables from the Report server &#8211; the report server name is M2MRPTSQLServer, the database is &#8216;RPTM2MDATA01&#8242;  */<br />
	begin<br />
		if exists(select * from RPTM2MDATA01.INFORMATION_SCHEMA.tables where TABLE_CATALOG = &#8216;RPTM2MDATA01&#8242; AND TABLE_SCHEMA=&#8217;dbo&#8217; AND TABLE_NAME=&#8217;apitem&#8217;)<br />
			DROP TABLE RPTM2MDATA01.dbo.apitem<br />
		if exists(select * from RPTM2MDATA01.INFORMATION_SCHEMA.tables where TABLE_CATALOG = &#8216;RPTM2MDATA01&#8242; AND TABLE_SCHEMA=&#8217;dbo&#8217; AND TABLE_NAME=&#8217;apmast&#8217;)<br />
			DROP TABLE ReportM2MDATA01.dbo.apmast<br />
		if exists(select * from RPTM2MDATA01.INFORMATION_SCHEMA.tables where TABLE_CATALOG = &#8216;RPTM2MDATA01&#8242; AND TABLE_SCHEMA=&#8217;dbo&#8217; AND TABLE_NAME=&#8217;apvend&#8217;)<br />
			DROP TABLE ReportM2MDATA01.dbo.apvend</p>
<p>		/*repeat for each table you may need, like SOMAST, INMAST etc &#8211; Follow the same for other companies.*/<br />
	end</p>
<p>	/* COPY the database tables from the production SQL M2M instance &#8211; M2MProdSQL to the new M2M Report Server &#8211; &#8216;RPTM2MDATA01&#8242; */<br />
	begin<br />
		/*M2MProdSQL is the production M2M SQL server */<br />
		SELECT * INTO m2mdata01.dbo.apitem FROM M2MProdSQL.m2mdata01.dbo.apitem<br />
		SELECT * INTO m2mdata01.dbo.apmast FROM M2MProdSQL.m2mdata01.dbo.apmast<br />
		SELECT * INTO m2mdata01.dbo.apvend FROM M2MProdSQL.m2mdata01.dbo.apvend<br />
	end<br />
GO</p>
<p>Do you want to know how many connections you have to each SQL database? I find this useful, as every now and then I find old connections that should be cleared but hung for some reason or other.</p>
<p>()<br />
select db_name(dbid),count(*) from master..sysprocesses<br />
where spid &gt; 49 &#8211;everyting below 50 is SQL Server itself<br />
group by db_name(dbid)</p>
<p>database		connections<br />
M2MDATA01	6<br />
M2MDATA50	2<br />
master		1</p>
<p>Then run ()<br />
exec sp_who2  </p>
<p>Just a little snippet if anyone needs</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.made2mentor.com/2009/11/pop-quiz-hotshot/comment-page-1/#comment-5972</link>
		<dc:creator>David</dc:creator>
		<pubDate>Tue, 24 Nov 2009 03:33:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.made2mentor.com/?p=1795#comment-5972</guid>
		<description>I&#039;m using SQL 2008 on Microsoft Server 2003. I know that&#039;s not the ideal situation. I should be using SQL 2000 on my development/test machine, but I am experimenting and learning 2008. So far I have not run into any inconsistencies.</description>
		<content:encoded><![CDATA[<p>I&#8217;m using SQL 2008 on Microsoft Server 2003. I know that&#8217;s not the ideal situation. I should be using SQL 2000 on my development/test machine, but I am experimenting and learning 2008. So far I have not run into any inconsistencies.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://www.made2mentor.com/2009/11/pop-quiz-hotshot/comment-page-1/#comment-5819</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Fri, 20 Nov 2009 16:12:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.made2mentor.com/?p=1795#comment-5819</guid>
		<description>Thanks Brent. David, what do you use for a Test Server? Operating system? SQL Version?</description>
		<content:encoded><![CDATA[<p>Thanks Brent. David, what do you use for a Test Server? Operating system? SQL Version?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brent Ozar</title>
		<link>http://www.made2mentor.com/2009/11/pop-quiz-hotshot/comment-page-1/#comment-5777</link>
		<dc:creator>Brent Ozar</dc:creator>
		<pubDate>Wed, 18 Nov 2009 22:36:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.made2mentor.com/?p=1795#comment-5777</guid>
		<description>Andrew &amp; Richard - great questions, but here&#039;s the thing: some testing is better than no testing.  If you&#039;re sitting around waiting for the company to buy you an environment that&#039;s an exact duplicate for production as your very first test environment, you&#039;re working for someone with a lot more money than most.  Your job counts on your ability to restore your data, and if your company hasn&#039;t bought you a testing environment that&#039;s robust, you have to start somewhere.  David&#039;s article is about getting started with fire drill restores, and sadly, I just see way too many &quot;DBAs&quot; who have never tested their restores.  That&#039;s just dangerous.</description>
		<content:encoded><![CDATA[<p>Andrew &amp; Richard &#8211; great questions, but here&#8217;s the thing: some testing is better than no testing.  If you&#8217;re sitting around waiting for the company to buy you an environment that&#8217;s an exact duplicate for production as your very first test environment, you&#8217;re working for someone with a lot more money than most.  Your job counts on your ability to restore your data, and if your company hasn&#8217;t bought you a testing environment that&#8217;s robust, you have to start somewhere.  David&#8217;s article is about getting started with fire drill restores, and sadly, I just see way too many &#8220;DBAs&#8221; who have never tested their restores.  That&#8217;s just dangerous.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Losing Weight and Testing Code &#124; Brent Ozar - SQL Server DBA</title>
		<link>http://www.made2mentor.com/2009/11/pop-quiz-hotshot/comment-page-1/#comment-5775</link>
		<dc:creator>Losing Weight and Testing Code &#124; Brent Ozar - SQL Server DBA</dc:creator>
		<pubDate>Wed, 18 Nov 2009 22:30:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.made2mentor.com/?p=1795#comment-5775</guid>
		<description>[...] Weight and Testing Code  David Stein (Blog &#8211; Twitter) wrote a post called &#8220;Pop Quiz Hotshot&#8221; about starting your disaster recovery plan *now*.  It&#8217;s a great read with good points [...]</description>
		<content:encoded><![CDATA[<p>[...] Weight and Testing Code  David Stein (Blog &#8211; Twitter) wrote a post called &#8220;Pop Quiz Hotshot&#8221; about starting your disaster recovery plan *now*.  It&#8217;s a great read with good points [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://www.made2mentor.com/2009/11/pop-quiz-hotshot/comment-page-1/#comment-5773</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Wed, 18 Nov 2009 20:38:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.made2mentor.com/?p=1795#comment-5773</guid>
		<description>I read your Test Server article. Is a test server running on XP, actually a valid test? This kind of goes along with Rick&#039;s question. How do you know that code you write will work on your production server if you aren&#039;t running the same operating system on your test box?</description>
		<content:encoded><![CDATA[<p>I read your Test Server article. Is a test server running on XP, actually a valid test? This kind of goes along with Rick&#8217;s question. How do you know that code you write will work on your production server if you aren&#8217;t running the same operating system on your test box?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.made2mentor.com/2009/11/pop-quiz-hotshot/comment-page-1/#comment-5757</link>
		<dc:creator>David</dc:creator>
		<pubDate>Wed, 18 Nov 2009 04:14:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.made2mentor.com/?p=1795#comment-5757</guid>
		<description>Scott, 

You don&#039;t need to install Visual FoxPro on the server itself. Therefore you could use your company PC for that. Also, you can use Windows Server for a 60 day trial period at no cost. Of course you can complete disaster recovery exercises in less than 60 days.

In addition, a test server (for custom code and such) only needs Windows XP, not server and most office PC&#039;s come with a licensed copy so there&#039;s no extra cost there either.</description>
		<content:encoded><![CDATA[<p>Scott, </p>
<p>You don&#8217;t need to install Visual FoxPro on the server itself. Therefore you could use your company PC for that. Also, you can use Windows Server for a 60 day trial period at no cost. Of course you can complete disaster recovery exercises in less than 60 days.</p>
<p>In addition, a test server (for custom code and such) only needs Windows XP, not server and most office PC&#8217;s come with a licensed copy so there&#8217;s no extra cost there either.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: scott</title>
		<link>http://www.made2mentor.com/2009/11/pop-quiz-hotshot/comment-page-1/#comment-5731</link>
		<dc:creator>scott</dc:creator>
		<pubDate>Mon, 16 Nov 2009 18:41:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.made2mentor.com/?p=1795#comment-5731</guid>
		<description>What do you mean the only cost is $50?

For starters I doubt any of my old desktop PCs could run everything my server does (even at a drastically reduced speed).

Secondly I would also have to buy the following software to do it legally.

Windows Server 2003
Visual Fox Pro</description>
		<content:encoded><![CDATA[<p>What do you mean the only cost is $50?</p>
<p>For starters I doubt any of my old desktop PCs could run everything my server does (even at a drastically reduced speed).</p>
<p>Secondly I would also have to buy the following software to do it legally.</p>
<p>Windows Server 2003<br />
Visual Fox Pro</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.made2mentor.com/2009/11/pop-quiz-hotshot/comment-page-1/#comment-5730</link>
		<dc:creator>David</dc:creator>
		<pubDate>Mon, 16 Nov 2009 18:30:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.made2mentor.com/?p=1795#comment-5730</guid>
		<description>Rick, I personally would not use my production server for testing. In fact, I don&#039;t do any development or customization on it if I can help it. Everyone should have a &lt;a href=&quot;http://www.made2mentor.com/2008/09/hold-on-to-your-butts/&quot; rel=&quot;nofollow&quot;&gt;Test Server&lt;/a&gt;. If you (with your recovery plan) can build a server from scratch, install all the necessary components, there&#039;s no reason to think that it won&#039;t work flawlessly with your production Server.

Scott, as far as cost, you can build one of these out of an old, decommissioned desktop computer and the only cost you have is for SQL Server Developer edition. The cost is about $50.</description>
		<content:encoded><![CDATA[<p>Rick, I personally would not use my production server for testing. In fact, I don&#8217;t do any development or customization on it if I can help it. Everyone should have a <a href="http://www.made2mentor.com/2008/09/hold-on-to-your-butts/" rel="nofollow">Test Server</a>. If you (with your recovery plan) can build a server from scratch, install all the necessary components, there&#8217;s no reason to think that it won&#8217;t work flawlessly with your production Server.</p>
<p>Scott, as far as cost, you can build one of these out of an old, decommissioned desktop computer and the only cost you have is for SQL Server Developer edition. The cost is about $50.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

