<?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>MISDivision Blog</title>
	<atom:link href="http://www.misdivision.com/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://www.misdivision.com/blog</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Mon, 16 Apr 2012 16:47:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Sharepoint Notes and Tricks</title>
		<link>http://www.misdivision.com/blog/sharepoint-notes-and-tricks</link>
		<comments>http://www.misdivision.com/blog/sharepoint-notes-and-tricks#comments</comments>
		<pubDate>Mon, 16 Apr 2012 16:47:01 +0000</pubDate>
		<dc:creator>jonas</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Microsft SharePoint]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.misdivision.com/blog/?p=2573</guid>
		<description><![CDATA[When it comes to SharePoint and moving farms and databases from one server to the other, I felt it would be good to make some public notes and things for anyone who has to work with this program and configurations next. - When performing a backup, there are a couple different types you can choose [...]]]></description>
			<content:encoded><![CDATA[<p>When it comes to SharePoint and moving farms and databases from one server to the other, I felt it would be good to make some public notes and things for anyone who has to work with this program and configurations next.</p>
<p>- When performing a backup, there are a couple different types you can choose from, however, only two really matter; the Site Backup and Full Backup. Either way, both these options can be used for importing/exporting and can both be found in the Central Admin Console.<br />
<strong>Site Backup &#8211; </strong>this will backup the preferences of your site and its configurations for the actual site, not the data. If any custom changes are made to the Central Admin page or the site itself, this should be exported along with the full backup.<br />
<strong>Full Backup &#8211; </strong>this will backup everything when it comes to the SharePoint server: the farm, the configurations (data wise), the databases, SQL express settings, everything except custom site changes. This is basically the way to go to take the entire SharePoint server contents from one site to the other.</p>
<p>- Some things to keep in mind when you&#8217;re having issues is:</p>
<ul>
<li>The Central Admin Console a registered service with IIS, so any changes that are made that affect the operation to the point to where the console is no longer accessible might mean the service has to be restarted.</li>
<li>The Central Admin Console is basically the GUI for the site itself. It  will allow you to control everything about the site, its configurations,  and how it operates</li>
<li>There is a what&#8217;s called &#8220;SharePoint Products Configuration&#8221; app that comes with the installation that allows you to basically roll the clock back on different products within the SharePoint environment leaving the current data untouched, think of it as a Windows System Restore. If you have any issues with the farm configuration, the CA console, site issues, etc, run this app and it will set everything back to default. Just be sure when it asks you to keep it on the same farm/database. You&#8217;ll find this in the Start Menu.</li>
<li>In order for some changes to be made by either the CA console or the app mentioned above, the SharePoint Central Admin Service must be turned off for a certain period of time. A reboot is not necessary but once the service is turned off and no longer recognizable by the related apps, it allows you to make certain changes now that were refused before (i.e. rolling back the CA console and getting an error).</li>
<li>When you perform a backup and you designate the location its being stored to, make sure the location is accessible by everyone within the folder security properties. For example, if you put it on the root of the C drive and try to perform a backup it will give you access denied to that location.</li>
<li>If you accidently turn off the Central Admin Console and its no longer accessible on the server, use the &#8220;SharePoint Products Configuration&#8221; app in the Advanced Settings to remove the website from the current server (keep it attached to the farm). Stop the SharePoint IIS services in IIS Manager and leave them for about five minutes. Then use the same SharePoint app and select to have the web applet on the current server, make sure during this whole process you keep the current farm selected. If done correctly, the CA Console should now be working using the original ID and password.</li>
<li>There can be multiple farms per site but only one site per server. If a different site has to be created for whatever reason, it will have to be installed on a different server running the same operating system and SharePoint version.</li>
</ul>
<p>Think that about covers it but I might add more and come back to this.<br />
]]></content:encoded>
			<wfw:commentRss>http://www.misdivision.com/blog/sharepoint-notes-and-tricks/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Configure Database Mirroring and Database Replication with Publisher Fail-over Partnership With Microsoft SQL Server 2008 R2</title>
		<link>http://www.misdivision.com/blog/how-to-configure-database-mirroring-and-database-replication-with-publisher-fail-over-partnership-with-microsoft-sql-server-2008-r2-part1</link>
		<comments>http://www.misdivision.com/blog/how-to-configure-database-mirroring-and-database-replication-with-publisher-fail-over-partnership-with-microsoft-sql-server-2008-r2-part1#comments</comments>
		<pubDate>Fri, 24 Feb 2012 20:37:55 +0000</pubDate>
		<dc:creator>Andrew Kuhlmann</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Microsoft SQL Server 2008 R2]]></category>

		<guid isPermaLink="false">http://www.misdivision.com/blog/?p=2473</guid>
		<description><![CDATA[Database mirroring and replication are both very popular technologies utilized by organizations which rely on business critical SQL databases in order to distribute load among various Database nodes and to provide high availability. It is possible to setup either database mirroring or replication without using Publisher Failover Partnership, however this leads to scenarios where in [...]]]></description>
			<content:encoded><![CDATA[<p>Database mirroring and replication are both very popular technologies utilized by organizations which rely on business critical SQL databases in order to distribute load among various Database nodes and to provide high availability. It is possible to setup either database mirroring or replication without using Publisher Failover Partnership, however this leads to scenarios where in the case that the Primary mirror database fails over to the backup server replication connections are lost and servers which rely on replication will be unable to synchronize until the primary server comes back online. Furthermore this can lead to replication sessions becoming compromised in cases where there is a long time duration before the primary server is restored.</p>
<p><strong>For this case we have the following scenario:</strong></p>
<p>A critical set of database servers which has grown from a relatively small deployment has expanded over the course of some time to include fully redundant high capacity primary database servers which are utilizing mirroring to provide high availability. Additionally there has been several servers added over the life of this environment which are utilizing replication, wherein the primary database server has been configured as the sole publisher and distributor of the publication. It has become evident that the replication sessions are too critical to leave in this state and therefor they must be redeployed to utilize a remote distributor database and publisher failover partnership.</p>
<p><strong>In the lab environment I will demonstrate the following procedure:</strong></p>
<ol>
<li>Remove existing publications, subscriptions and distributor database.</li>
<li>Remove database mirroring.</li>
<li>Take backup of Live Production Database.</li>
<li>Restore Backup of Live Production Database to Mirror.</li>
<li>Create Distributor Database on Remote Witness and Distributor server.</li>
<li>Configure Privileges on Distributor Database to Allow Backup Publisher.</li>
<li>Create Publication.</li>
<li>Deploy Database Mirroring.</li>
<li>Associate Secondary Mirror Server as a Publisher on Distributor Database.</li>
<li>Add Mirrored Server as Publisher to Distributor.</li>
<li>Add Agent Parameters for Failover Partner.</li>
</ol>
<table border="0" cellspacing="0" cellpadding="0" width="588">
<col width="389"></col>
<col width="199"></col>
<tbody>
<tr>
<td width="389" height="20"><strong>Server   Role</strong></td>
<td width="199"><strong>Server Name</strong></td>
</tr>
<tr>
<td height="20">Primary Mirror</td>
<td>sqldev-01.itcloudsuite.com</td>
</tr>
<tr>
<td height="20">Backup Mirror</td>
<td>sqldev-02.itcloudsuite.com</td>
</tr>
<tr>
<td height="20">Distribution Database, Mirroring Witness</td>
<td>sqldev-03.itcloudsuite.com</td>
</tr>
<tr>
<td height="20">Subscriber Server</td>
<td>sqldev-04.itcloudsuite.com</td>
</tr>
<tr>
<td height="20">Subscriber Server</td>
<td>sqldev-05.itcloudsuite.com</td>
</tr>
</tbody>
</table>
<p><strong>Reference Articles:</strong></p>
<p>Replication and Database Mirroring: <a href="http://msdn.microsoft.com/en-us/library/ms151799.aspx">http://msdn.microsoft.com/en-us/library/ms151799.aspx</a></p>
<p>Configuring Remote Distributor: <a href="http://msdn.microsoft.com/en-us/library/ms147363.aspx">http://msdn.microsoft.com/en-us/library/ms147363.aspx</a></p>
<p>Manually Removing Replication: <a href="http://support.microsoft.com/kb/324401">http://support.microsoft.com/kb/324401</a></p>
<p>How To Prepare a Mirror Database for Mirroring: <a href="http://technet.microsoft.com/en-us/library/ms189047.aspx">http://technet.microsoft.com/en-us/library/ms189047.aspx</a></p>
<p><strong>Step 1. Remove existing publications, subscriptions and distributor database.</strong></p>
<div>As this environment has previously been configured to utilize both mirroring and replication, we&#8217;ll need to do some cleanup. Firstly we should run the following command at the existing Distributor database as a way to verify the presence of an existing distributor database.</div>
<div>
<blockquote>
<div>USE [master]</div>
<div>exec sp_get_distributor</div>
<div>GO</div>
</blockquote>
</div>
<div><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/02/Step1.sp_get_distributor1.png"><img class="alignnone size-full wp-image-2479" style="border-style: initial;border-color: initial" src="http://www.misdivision.com/blog/wp-content/uploads/2012/02/Step1.sp_get_distributor1.png" alt="" width="444" height="403" /></a></div>
<div>In the above screenshot the column &#8216;distribution db installed&#8217; returns a Boolean value of 1 indicating that a distribution database exists on this server. We need to remove this before we proceed as part of sterilizing the environment prior to configuring our environment for fail-over partnership. The procedure for removing all of this is formally documented by Microsoft <a href="http://support.microsoft.com/kb/324401">here</a>, however I&#8217;ll briefly run through as this is a very important part of this procedure and getting this wrong could lead to additional downtime in a live deployment.</div>
<p><span style="font-weight: bold">First we need to &#8216;Drop all subscriptions that are configured for the replication.&#8217;</span></p>
<div>Depending on your environment, you may need to perform slightly different queries in order to remove all of your subscriptions. In our case we have a single snapshot replication session which is configured as a Push subscription. The query I&#8217;ll use to remove the subscription will be run on the Publisher server where the Database name is &#8216;MirrorRepTest&#8217; and the Publication name is &#8216;MirrorRepTest-Pub&#8217; as follows:</div>
<div>
<blockquote>
<div>USE MirrorRepTest</div>
<div>GO</div>
<div>EXEC sp_dropsubscription @publication = N&#8217;MirrorRepTest-Pub&#8217;, @article = N&#8217;all&#8217;, @subscriber = N&#8217;all&#8217;, @destination_db = N&#8217;all&#8217;</div>
</blockquote>
<div>
<div>If you need to drop pull subscriptions instead, or in addition to some push subscriptions, then you would need to use the following query first on the Subscriber server:</div>
<blockquote>
<div>USE &lt;Subscription database name&gt;</div>
<div>GO</div>
<div>EXEC sp_droppullsubscription @publisher = N&#8217;&lt;Publisher server name&gt;&#8217;, @publisher_db = N&#8217;&lt;Publisher database name&gt;&#8217;, @publication = N&#8217;&lt;Publication name&gt;&#8217;</div>
</blockquote>
<div>And then from the Publisher server:</div>
<blockquote>
<div>USE &lt;Publication database name&gt;</div>
<div>GO</div>
<div>EXEC sp_dropsubscription @publication =N&#8217;&lt;Publication name&gt;&#8217;, @subscriber = N&#8217;&lt;Subscriber server name&gt;&#8217;, @article = N&#8217;all&#8217;, @destination_db = N&#8217;&lt;Destination database name&gt;&#8217;</div>
</blockquote>
</div>
</div>
<div>Note that the above procedure also varies for Merge subscriptions, see MS guidance if needed.</div>
<div><strong>The second step for cleanly removing existing replication is to &#8216;Drop all publications that are configured for the replication.&#8217;</strong></div>
<div>For this demonstration, we&#8217;re working with a &#8216;Transactional&#8217; Publication. The procedure to drop Merge publications differs from the following, if needed see MS guidance. The command I that follows will be run on the publisher server where the Publication database name is &#8216;MirrorRepTest&#8217; and the Publication name is &#8217;MirrorRepTest-Pub&#8217;. This query will utilize two stored procedures (sp_droppublication &amp; sp_replicationdboption) which will basically drop all of the articles from the publication and then configure the replicated database to no longer participate in replication.</div>
<div>
<blockquote>
<div>USE MirrorRepTest</div>
<div>GO</div>
<div>EXEC sp_droppublication @publication = N&#8217;MirrorRepTest-Pub&#8217;</div>
<div>USE master</div>
<div>GO</div>
<div>EXEC sp_replicationdboption @dbname = N&#8217;MirrorRepTest&#8217;, @optname = N&#8217;publish&#8217;, @value = N&#8217;false&#8217;</div>
</blockquote>
<div><strong>The final step for removing replication is to &#8216;Drop the distributor that is configured for the replication.&#8217;</strong></div>
<div>Firstly on the Publisher we will need to execute the following script in order to drop the subscriber designation which is assigned to the subscriber server.</div>
<div>
<blockquote>
<div>USE master</div>
<div>GO</div>
<div>EXEC sp_dropsubscriber @subscriber = N&#8217;sqldev-03&#8242;, @reserved = N&#8217;drop_subscriptions&#8217;</div>
</blockquote>
</div>
<div>Next, we will run the following script on the Distributor server in order to remove the Distributor.</div>
<div>
<blockquote>
<div>USE master</div>
<div>GO</div>
<div>EXEC sp_dropdistributor @no_checks = 1</div>
</blockquote>
<div>Now that all of the replication configurations have been cleanly removed, we can simply use the SQL Management Studio GUI to remove any lingering push subscription records on the subscriber servers.</div>
<div><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/02/Step1.Subscriber.GUIDelete.png"><img class="alignnone size-full wp-image-2489" src="http://www.misdivision.com/blog/wp-content/uploads/2012/02/Step1.Subscriber.GUIDelete.png" alt="" width="571" height="334" /></a></div>
<div><strong>Step 2. Remove database mirroring.</strong></div>
<div>Removing database mirroring is a lot less complicated than removing replication, for this I would advise simply using the GUI in SQL Studio. <strong>If for you need to fail-over first, remember to do this prior to removing mirroring.</strong></div>
<div><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/02/Step2.remove.mirroring.png"><img class="alignnone size-full wp-image-2501" src="http://www.misdivision.com/blog/wp-content/uploads/2012/02/Step2.remove.mirroring.png" alt="" width="495" height="198" /></a></div>
<div>After removing mirroring, whichever database was the mirror at the time the mirroring session was broken will end up in a restoring state.</div>
<div><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/02/Step2.PostFailover.DB_.Restoring.png"><img class="alignnone size-full wp-image-2505" src="http://www.misdivision.com/blog/wp-content/uploads/2012/02/Step2.PostFailover.DB_.Restoring.png" alt="" width="255" height="97" /></a></div>
<div>
<div>The restoring state indicates that the database is waiting for completion of the log restore before the database will enter a normal state. However, this also will prevent you from being able to remove this database. Although, if you intend to re-establish mirroring on this database this is a good state to leave the databaes in&#8230; But in some cases you may need to remove it. In that case, you would want to use the following script to force a recovery. In this case I&#8217;m executing against the DB called &#8216;MirrorRepTest&#8217;</div>
<blockquote>
<div>restore database MirrorRepTest with recovery</div>
</blockquote>
<div>Now that I&#8217;ve run this command, you can see the database is back to a normal state.</div>
<div><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/02/Step2.PostFailover.DB_.Normal.png"><img class="alignnone size-full wp-image-2507" src="http://www.misdivision.com/blog/wp-content/uploads/2012/02/Step2.PostFailover.DB_.Normal.png" alt="" width="357" height="85" /></a></div>
</div>
<div>If needed I can perform normal operations such as dropping or altering this database now.</div>
<div>Note that in cases where databases become stuck &#8220;In Recovery&#8221; the above will not work. In those cases, if you need to remove the database&#8230; My method is simply to stop the entire SQL server and delete the actual MDF/LDF files and then start the server. Once you do this and refresh the list of databases, the stuck database will be gone.</div>
<div><strong>Step 3. Take backup of Live Production Database. </strong></div>
<div>Now that all the preliminary cleanup of our environment is complete, we&#8217;re ready to proceed with taking a backup of the live production database in preparation for configuring Mirroring. In my experience with huge databases it&#8217;s often good to use something like a USB hard-drive in order to transport the databases efficiently. However, for this demonstration I&#8217;ll simply be taking a regular backup to the C: drive of the server. There&#8217;s nothing particularly special about this operation other than to make sure you include this in your planning as this operation can take a long time to complete when dealing with huge databases.</div>
<div><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/02/Step3.FullBackup.png"><img class="alignnone size-full wp-image-2509" src="http://www.misdivision.com/blog/wp-content/uploads/2012/02/Step3.FullBackup.png" alt="" width="422" height="374" /></a></div>
<div><strong>Step 4. Restore Backup of Live Production Database to Mirror.<br />
</strong></div>
<div>Please note that the following scenario is somewhat limited in scope and as always I would recommend reviewing the official <a href="http://technet.microsoft.com/en-us/library/ms189047.aspx">Microsoft guidance here</a> prior to performing this operation in a live environment.</div>
<div>The method I prefer for performing this operation starts with creating an empty database which will receive the backup taken in step 3. In our scenario this database will have the same name as the principal server &#8216;MirrorRepTest&#8217;. It&#8217;s important at this point to specify the correct logical drive/folder where you ultimately want your data files to reside.</div>
<div><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/02/Step4.CreateDB.png"><img class="alignnone size-full wp-image-2511" src="http://www.misdivision.com/blog/wp-content/uploads/2012/02/Step4.CreateDB.png" alt="" width="424" height="381" /></a></div>
<div>Now that the DB is ready to receive the data, we&#8217;ll go ahead and restore the backup to this database. Firstly you&#8217;ll need to click on the following:</div>
<div><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/02/Step4.RestoreDB.Menu_.png"><img class="alignnone size-full wp-image-2513" src="http://www.misdivision.com/blog/wp-content/uploads/2012/02/Step4.RestoreDB.Menu_.png" alt="" width="531" height="296" /></a></div>
<div>From the next menu I simply want to select my data source, in our case it&#8217;s just a file on the C: that I&#8217;ve copied via remote desktop&#8230; However in a production scenario it would likely be either a USB drive, or possibly a SAN location or something of that nature.</div>
<div><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/02/Step4.RestoreDB.Menu_.2.png"><img class="alignnone size-full wp-image-2515" src="http://www.misdivision.com/blog/wp-content/uploads/2012/02/Step4.RestoreDB.Menu_.2.png" alt="" width="420" height="248" /></a></div>
<div>Next I need to click on the &#8216;Options&#8217; tab on this menu and make sure to specify &#8216;RESTORE WITH NORECOVERY&#8217; in order for the DB to be in the correct state to initiate mirroring. You will also need to select WITH REPLACE as we&#8217;re over-writing the blank database that we created previously.</div>
<div><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/02/Step4.RestoreDB.Menu_.31.png"><img class="alignnone size-full wp-image-2519" src="http://www.misdivision.com/blog/wp-content/uploads/2012/02/Step4.RestoreDB.Menu_.31.png" alt="" width="419" height="379" /></a></div>
<div>Once you&#8217;ve completed the above you may be ready to go. However, in a lot of cases you&#8217;ll also need to take another backup of transaction logs. In that case you&#8217;ll simply take a transaction log backup instead of a full backup, and then restore it to the database in the same way except this time using the logs&#8230; You&#8217;ll need to select NORECOVERY during that procedure as well. Once that&#8217;s complete you will be ready to proceed with the rest of the setup and you will see the database in a &#8216;Restoring&#8230;&#8217; state on the SQL Studio GUI.</div>
<div><strong>Step 5. Create Distributor Database on Remote Witness and Distributor server.</strong></div>
<div>Official Microsoft guidance for this portion can <a href="http://msdn.microsoft.com/en-us/library/ms147363.aspx">be found here</a>.</div>
<div>Now we&#8217;re getting into the real meat of this setup. In our lab environment I&#8217;ve specified a single server as a witness and a distributor server however this distributor server does not have to be on the same server as the witness as they are completely independent of each other.</div>
<div>The first script we&#8217;ll use will utilize stored procedures to setup the distributor database itself on the specified server. <strong>This must be run against what is to be the Distributor server.</strong></div>
<div>
<blockquote>
<div>USE [master]</div>
<div>exec sp_adddistributor @distributor= &#8216;sqldev-03&#8242;, @password= &#8216;v3rys3cur3p4ss&#8217;</div>
<div>GO</div>
</blockquote>
<div>
<blockquote>
<div>USE [master]</div>
<div>exec sp_adddistributiondb @database= &#8216;distributor&#8217;, @data_folder= &#8216;C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA&#8217;, @data_file= &#8216;distributor.mdf&#8217;, @log_folder= &#8216;C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA&#8217;, @log_file= &#8216;distributor.ldf&#8217;</div>
<div>GO</div>
</blockquote>
</div>
<div>Assuming this script is successful you should get a return showing a bunch of tables and clustered indexes being created that will be used for the distributor database.</div>
</div>
<div><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/02/Step5.CreateDistributorDB.png"><img class="alignnone size-full wp-image-2521" src="http://www.misdivision.com/blog/wp-content/uploads/2012/02/Step5.CreateDistributorDB.png" alt="" width="430" height="307" /></a></div>
<div><strong>Step 6. Configure Privileges on Distributor Database to Allow Backup Publisher.</strong></div>
<div>Once the distributor database is created, we&#8217;ll need to configure it to allow what is to become our primary mirror server to act as a publisher. As an additional note, we will first need to create a shared folder on the distributor server. In order for replication to function properly you&#8217;ll need to grant access to the appropriate SQL Server Agents to access this folder.</div>
<div>For making the needed configuration we will use the following script:</div>
<div>
<blockquote>
<div>USE [master]</div>
<div>exec sp_adddistpublisher @working_directory= &#8216;\\sqldev-03\RepShare&#8217;, @publisher= &#8216;sqldev-01&#8242;, @distribution_db= &#8216;distributor&#8217;</div>
<div>GO</div>
</blockquote>
</div>
<div><strong>Step 7. Create Publication.</strong></div>
<div>We&#8217;re now ready to create our primary publication. In our case, SqlDev-01 is to be the primary publisher as it will be the primary mirror and so the configurations will be made on that server.</div>
<div>If you remember, the first thing we did was check to see if a distributor database was installed on our server using the following script:</div>
<div>
<blockquote>
<div>USE [master]</div>
<div>exec sp_get_distributor</div>
<div>GO</div>
</blockquote>
</div>
<div>If this distributor database is already installed, then we&#8217;ll need to use the following command to get rid of it.</div>
<div>
<blockquote>
<div>USE master</div>
<div>GO</div>
<div>EXEC sp_dropdistributor @no_checks = 1</div>
</blockquote>
<div>Assuming the distributor database is not present, when we go to create the publication using the SQL Studio GUI wizard, the first menu prompt will be asking us which Distributor database we want to use. At this point we&#8217;re going to want to select the remote distributor we created in step 5. Again, if this menu does not appear then you&#8217;ve messed up somewhere along the way removing the Distributor.</div>
</div>
<div><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/02/Step7.CreatePub.1.png"><img class="alignnone size-full wp-image-2523" src="http://www.misdivision.com/blog/wp-content/uploads/2012/02/Step7.CreatePub.1.png" alt="" width="347" height="312" /></a></div>
<div>The next screen will ask you for a password. This is the password that you&#8217;ve entered in the script in step 5. In my lab it was &#8216;v3rys3cur3p4ss&#8217;.</div>
<div>Once that password is entered the rest of the wizard is just your standard publication creation. Make sure to select the correct Database. In my lab environment we&#8217;ll be creating a &#8216;Transactional publication&#8217;. With all tables and views selected, and creating a snapshot immediately to later initialize subscriptions with.</div>
<div>For the Agent Security menu I&#8217;m simply using my administrator account in the domain. This account needs access to that share we created earlier.</div>
<div>As a general rule, <strong>always check &#8216;Generate a script file with steps to create the publication&#8217; even if you&#8217;re letting the default script run.</strong> This can come in very handy if you run into problems with a publication later on.</div>
<div>If you check the script that it generates, you&#8217;ll notice that the first command it issues is as follows:</div>
<blockquote>
<div>use master</div>
<div>exec sp_adddistributor @distributor = N&#8217;sqldev-03&#8242;, @password = N&#8217;<strong>&lt;password needed&gt;</strong>&#8216;</div>
<div>GO</div>
</blockquote>
<div>This is running a stored procedure which is configuring the distributor database used by this SQL Server. We basically made this configuration on the first screen when we chose sqldev-03 as the distributor, however the command isn&#8217;t actually issued until the script runs. Note that the password field is blank as a security measure.</div>
<div>The reason I&#8217;m pointing out this command is that if you think about it, the backup mirror server will need to have this configuration made as well. Why? Well, if it&#8217;s going to become the publisher in the event of a failover&#8230; It will need to know what distributor to connect to.</div>
<div><strong>Step 8. Deploy Database Mirroring.</strong></div>
<div>Previously we had prepared the database for mirroring, but didn&#8217;t actually get around to setting it up. We could have done it earlier, but we&#8217;re doing it now instead&#8230;</div>
<div>Since the databases are already created, all we need to do is use the SQL Studio GUI to create the mirroring session. One thing to note here, at least in my experience, you&#8217;ll have a lot easier time doing this if you first generate a couple SQL accounts with full privileges solely for the purpose of mirroring on the primary, secondary, and witness servers. Make sure to configure these accounts not to expire passwords too&#8230; For obvious reasons.</div>
<div><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/02/Step8.Create.Mirror.png"><img class="alignnone size-full wp-image-2525" src="http://www.misdivision.com/blog/wp-content/uploads/2012/02/Step8.Create.Mirror.png" alt="" width="311" height="202" /></a></div>
<div>For the first few screens you&#8217;re just picking the needed servers and specifying the service accounts that we intend to use for the mirroring session.</div>
<div><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/02/Step8.Create.Mirror.Accounts.png"><img class="alignnone size-full wp-image-2529" src="http://www.misdivision.com/blog/wp-content/uploads/2012/02/Step8.Create.Mirror.Accounts.png" alt="" width="296" height="265" /></a></div>
<div>Once you complete the wizard steps, you&#8217;ll be prompted as to whether you wish to start the mirroring session. Obviously you want to attempt this. At this point you may encounter a failure if SQL detects that it needs a transaction log backup. If that&#8217;s the case, refer back to step 4. Remember that you&#8217;re taking a transaction log backup though, and not another full backup. The transaction log backup should not take nearly as long on a large database as it would to take a full backup.</div>
<div>Also one thing to note, if you get stuck here and it seems like the restore transaction log menu is grayed out.. Don&#8217;t Panic! You simply need to cancel out of the mirroring session and refresh the secondary mirror database, and it will go back to being in a restoring state. This is caused by mirroring trying to grab the DB to bring it into the fold. The main thing here you need to be sure of is to <strong>leave the database in a NORECOVERY state</strong> by selecting the following:</div>
<div><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/02/Step8.Translog.Backup.png"><img class="alignnone size-full wp-image-2531" src="http://www.misdivision.com/blog/wp-content/uploads/2012/02/Step8.Translog.Backup.png" alt="" width="421" height="380" /></a></div>
<div>If all goes well, you should now have an active mirroring session. We&#8217;re now ready to move on to finalizing the replication configurations.</div>
<div><strong>Step 9. Associate Secondary Mirror Server as a Publisher on Distributor Database</strong></div>
<div>This command is going to specify that the secondary mirroring server is allowed to be a publisher on the distributor server. This is needed in the event of a fail-over.<strong> This command is run on the distributor server.</strong></div>
<div>
<blockquote>
<div>USE [master]</div>
<div>exec sp_adddistpublisher @working_directory= &#8216;\\sqldev-03\RepShare&#8217;, @publisher= &#8216;sqldev-02&#8242;, @distribution_db= &#8216;distributor&#8217;</div>
<div>GO</div>
</blockquote>
</div>
<div>In this case I&#8217;m specifying sqldev-02 which is the secondary mirror.</div>
<div><strong>Step 10. Add Mirrored Server as Publisher to Distributor.</strong></div>
<div>Remember the command I made you look at when we created the publication? Well we need to run that now, this command is going to be run on the Secondary Miror Server. This command is a stored procedure which is configuring the remote distributor server to be used as a distributor for any publications.</div>
<div>
<blockquote>
<div>use master</div>
<div>exec sp_adddistributor @distributor = N&#8217;sqldev-03&#8242;, @password = &#8216; v3rys3cur3p4ss&#8217;</div>
<div>GO</div>
</blockquote>
<div>If you&#8217;ll remember when we created the distributor we specified &#8216;v3rys3cur3p4ss&#8217; as the password. Hopefully it&#8217;s obvious that you&#8217;d be better off using something else.</div>
</div>
<div><strong>Step 11. Add Agent Parameters for Failover Partner.</strong></div>
<div>The last thing we need to do to the publication itself is to configure the &#8216;–PublisherFailoverPartner&#8217; parameter on the various agents involved in the publication. <strong>This operation should be taking place on the Distributor server.</strong></div>
<div>First we&#8217;ll want to use the sp_help_agent_profile stored procedure to return a list of agents via the following script.</div>
<blockquote>
<div>exec sp_help_agent_profile</div>
</blockquote>
<div><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/02/Step11.sp_help_agent_profile.png"><img class="alignnone size-full wp-image-2533" src="http://www.misdivision.com/blog/wp-content/uploads/2012/02/Step11.sp_help_agent_profile.png" alt="" width="529" height="252" /></a></div>
<div>As you can see in the above screenshot I&#8217;ve highlighted 4 rows. For the rest of this procedure we&#8217;ll be making configurations to each of these Agent profiles to configure the &#8217;–PublisherFailoverPartner&#8217; parameter. The agent_type field refers to the type of agent that each profile corresponds to. For this procedure requires that all snapshot, log reader, and queue reader agents be configured. Note that in some environments the profile_id&#8217;s will be different from the following commands and you will need to refer back to the &#8216;sp_help_agent_profile&#8217; output in order to script out the following configurations.</div>
<div>So for instance, with the above output I would need to run the following script</div>
<blockquote>
<div>exec sp_add_agent_parameter @profile_id = 1, @parameter_name = N&#8217;-PublisherFailoverPartner&#8217;, @parameter_value = N&#8217;SQLDEV-02&#8242;</div>
<div>exec sp_add_agent_parameter @profile_id = 2, @parameter_name = N&#8217;-PublisherFailoverPartner&#8217;, @parameter_value = N&#8217;SQLDEV-02&#8242;</div>
<div>exec sp_add_agent_parameter @profile_id = 3, @parameter_name = N&#8217;-PublisherFailoverPartner&#8217;, @parameter_value = N&#8217;SQLDEV-02&#8242;</div>
<div>exec sp_add_agent_parameter @profile_id = 11, @parameter_name = N&#8217;-PublisherFailoverPartner&#8217;, @parameter_value = N&#8217;SQLDEV-02&#8242;</div>
</blockquote>
<div>In the above command I am specifying the secondary mirror which is SQLDEV-02 as the parameter value for the publisherfailoverpartner parameter name.</div>
<div>Now that the above configurations have been made, you simply need to restart the SQL Agents on both of the servers involved in mirroring.</div>
<div>Once those servers are back online, you&#8217;re ready to proceed with deploying as many subscriptions as you need using push subscriptions. There shouldn&#8217;t be anything special about deploying the actual subscribers themselves assuming everything above has been completed successfully.</div>
</div>
</div>
<p>
]]></content:encoded>
			<wfw:commentRss>http://www.misdivision.com/blog/how-to-configure-database-mirroring-and-database-replication-with-publisher-fail-over-partnership-with-microsoft-sql-server-2008-r2-part1/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft SQL Server 2008: Resetting a SQL User Password</title>
		<link>http://www.misdivision.com/blog/microsoft-sql-server-2008-resetting-a-sql-user-password</link>
		<comments>http://www.misdivision.com/blog/microsoft-sql-server-2008-resetting-a-sql-user-password#comments</comments>
		<pubDate>Fri, 20 Jan 2012 18:18:54 +0000</pubDate>
		<dc:creator>ilya</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.misdivision.com/blog/?p=2433</guid>
		<description><![CDATA[Sometimes, you might run into a situation where you need to reset the password for a SQL user account. The process is quite simple and is described below. Step 1: Open an elevated command prompt and run the following command to stop SQL services: NET STOP MSSQLSERVER Step 2: Next, we will need to start [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes, you might run into a situation where you need to reset the password for a SQL user account. The process is quite simple and is described below.</p>
<p>Step 1: Open an elevated command prompt and run the following command to stop SQL services:</p>
<pre style="padding-left: 30px">NET STOP MSSQLSERVER
</pre>
<p><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/01/11.png"><img class="alignnone size-full wp-image-2447" src="http://www.misdivision.com/blog/wp-content/uploads/2012/01/11.png" alt="" width="422" height="45" /></a></p>
<p>Step 2: Next, we will need to start SQL Server in single-user mode. This is done by running the following command:</p>
<pre style="padding-left: 30px">NET START MSSQLSERVER /m
</pre>
<p><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/01/21.png"><img class="alignnone size-full wp-image-2449" src="http://www.misdivision.com/blog/wp-content/uploads/2012/01/21.png" alt="" width="427" height="51" /></a></p>
<p>Step 3: Now, open up SQL Server Management Studio and log in using Windows Authentication:</p>
<p><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/01/31.png"><img class="alignnone size-full wp-image-2451" src="http://www.misdivision.com/blog/wp-content/uploads/2012/01/31.png" alt="" width="449" height="312" /></a></p>
<p>Step 4: Expand Security, and then Logins. Find your SQL user account, right click it and select Properties.</p>
<p><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/01/41.png"><img class="alignnone size-full wp-image-2453" src="http://www.misdivision.com/blog/wp-content/uploads/2012/01/41.png" alt="" width="449" height="368" /></a></p>
<p>Step 5: Enter in the new password and confirm it, then click OK.</p>
<p><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/01/52.png"><img class="alignnone size-full wp-image-2457" src="http://www.misdivision.com/blog/wp-content/uploads/2012/01/52.png" alt="" width="396" height="356" /></a></p>
<p>Step 6: Go back to your elevated command prompt, and restart SQL Server with the following two commands:</p>
<pre style="padding-left: 30px">NET STOP MSSQLSERVER
NET START MSSQLSERVER</pre>
<p><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/01/61.png"><img class="alignnone size-full wp-image-2459" src="http://www.misdivision.com/blog/wp-content/uploads/2012/01/61.png" alt="" width="426" height="90" /></a></p>
<p>Step 7: Confirm that your new login is working and you&#8217;re done!<br />
]]></content:encoded>
			<wfw:commentRss>http://www.misdivision.com/blog/microsoft-sql-server-2008-resetting-a-sql-user-password/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to set up a transactional replication pull subscription in Windows SQL Server 2008 R2 using SQL commands</title>
		<link>http://www.misdivision.com/blog/how-to-set-up-a-transactional-replication-pull-subscription-in-windows-sql-server-2008-r2-using-sql-commands</link>
		<comments>http://www.misdivision.com/blog/how-to-set-up-a-transactional-replication-pull-subscription-in-windows-sql-server-2008-r2-using-sql-commands#comments</comments>
		<pubDate>Fri, 20 Jan 2012 08:41:57 +0000</pubDate>
		<dc:creator>William Gannon</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[replication]]></category>
		<category><![CDATA[sql server 2008]]></category>
		<category><![CDATA[subscription]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.misdivision.com/blog/?p=2319</guid>
		<description><![CDATA[In SQL server, replication allows data to be synchronized between two or more databases.  One server acts as a publisher which has a publication subscribed to by servers; the publication specifies what data is to be distributed to the subscriber servers.  In transactional replication, a snapshot of the publication is created on a subscriber server; [...]]]></description>
			<content:encoded><![CDATA[<p>In SQL server, replication allows data to be synchronized between two or more databases.  One server acts as a publisher which has a publication subscribed to by servers; the publication specifies what data is to be distributed to the subscriber servers.  In transactional replication, a snapshot of the publication is created on a subscriber server; any new transactions on the publication database are propagated onto the subscriber server.  In order to instantiate replication, you will need to create a subscription on the subscriber server.  This article will show you step by step how to create a transactional replication subscription.  It assumes you have create a publication and specified a publisher and distributor server.</p>
<p>The basic steps to create the subscription are as follows:</p>
<p>1. Run the snapshot agent.</p>
<p>2. Take a backup of the database to be replicated</p>
<p>3. Restore the backup onto the subscriber server</p>
<p>4. Run publisher SQL commands to add a subscription for the subscriber.</p>
<p>5. Run subscriber SQL commands to finish creating the subscription and to add the subscription agent.</p>
<p>Be aware that setting up replication can be a time intensive process.  For example, taking a backup of a 1TB database could take as long as 8 hours; the restore would take about the same amount of time.  After setting up replication, it may take up to several days for the involved databases are synchronized.</p>
<p>First, you&#8217;ll need to run the snapshot agent on the publication on the publisher server.  Inside of the SQL Server Management Studio, Right-click the publication and select <strong>View Snapshot Agent Status</strong>.</p>
<p><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication24b.png"><img class="alignnone size-full wp-image-2373" src="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication24b.png" alt="" width="387" height="623" /></a></p>
<p>Next, select <strong>Start </strong>to create the snapshot.  Wait until the snapshot has finished.</p>
<p><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication25.png"><img class="alignnone size-full wp-image-2375" src="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication25.png" alt="" width="600" height="280" /></a></p>
<p>So long as there aren&#8217;t any problems, you should see a screen like the one below.  You can close the dialog box.</p>
<p><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication26.png"><img class="alignnone size-full wp-image-2377" src="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication26.png" alt="" width="602" height="279" /></a></p>
<p>The next step is to create a backup of the database to be replicated.  Right-click the database, select <strong>Tasks </strong>and then select <strong>Back Up&#8230;</strong></p>
<p><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication19.png"><img class="alignnone size-full wp-image-2359" src="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication19.png" alt="" width="545" height="489" /></a></p>
<p>Here, you will specify the source database, the type of backup, the name of the backup set, and where the back up will be saved.  For the backup type, select <strong>Full</strong>.  If you are going to save to a hard drive, you need to select <strong>Disk </strong>under <strong>Destination </strong>and then select <strong>Add </strong>to specify where the backup will be saved.  Select <strong>OK </strong>to start the backup.</p>
<p><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication20.png"><img class="alignnone size-full wp-image-2361" src="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication20.png" alt="" width="703" height="633" /></a></p>
<p>This dialog box comes up when you select <strong>Add&#8230;</strong> Select <strong>&#8230;</strong> to browse for a backup destination.  Select <strong>OK </strong>when done.</p>
<p><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication20b.png"><img class="alignnone size-full wp-image-2363" src="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication20b.png" alt="" width="435" height="258" /></a></p>
<p>Once the backup has completed, a dialog box will appear saying so.  Even if the progress shows <strong>Executing (100%)</strong>, the backup is not really complete until you see the following dialog box appears.  Select <strong>OK </strong>to close out the backup window.</p>
<p><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication21.png"><img class="alignnone size-full wp-image-2365" src="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication21.png" alt="" width="703" height="632" /></a></p>
<p>Now on your subscriber server, restore the backup.  Move the backup file you specified in the previous step to the subscriber server.  In Management Studio, right-click <strong>Databases </strong>and select <strong>Restore Database&#8230;</strong></p>
<p><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication22.png"><img class="alignnone size-full wp-image-2367" src="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication22.png" alt="" width="310" height="330" /></a></p>
<p>Here you specify the database, the backup file to be used for the restore, and the backup sets to restore.  The database should be the same name as the database being replicated.  Check the box next to the backup set.  Select <strong>OK </strong>to start the restore.</p>
<p><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication23.png"><img class="alignnone size-full wp-image-2369" src="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication23.png" alt="" width="702" height="633" /></a></p>
<p>Similar to the backup, the restore is not complete until you see a success dialog box.</p>
<p><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication24.png"><img class="alignnone size-full wp-image-2371" src="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication24.png" alt="" width="703" height="632" /></a></p>
<p>Now, that the backup has been restored on the subscriber server, the commands to create the subscription need to be run.  Text in italics is a description of what to put into the command.  You can see specific examples in the images following each respective command.  On the publisher server, run the following command:</p>
<p>EXEC sp_addsubscription<br />
@publication = N&#8217;<em>publication name</em>&#8216;,<br />
@subscriber = N&#8217;<em>subscriber server</em>&#8216;,<br />
@destination_db = N&#8217;<em>destination database name</em>&#8216;,<br />
@subscription_type = N&#8217;pull&#8217;,<br />
@sync_type = N&#8217;initialize with backup&#8217;,<br />
@backupdevicetype = N&#8217;disk&#8217;,<br />
@backupdevicename = N&#8217;<em>backup file location</em>&#8216;,<br />
@article = N&#8217;all&#8217;,<br />
@update_mode = N&#8217;read only&#8217;,<br />
@subscriber_type = 0;</p>
<p>There are a few different subscription types.  A pull subscription will have agent processes run on the subscriber server, placing less load on the distributor server.  You should note that if you had placed a backup file and moved it via an external device, you&#8217;ll have to move the USB device back to the publisher after restoring the backup.</p>
<p><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication27.png"><img class="alignnone size-large wp-image-2379" src="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication27-1024x640.png" alt="" width="1024" height="640" /></a></p>
<p>Jump to the subscriber server and run the following command:</p>
<p>EXEC sp_addpullsubscription<br />
@publisher = N&#8217;<em>publisher server</em>&#8216;,<br />
@publisher_db =  N&#8217;<em>publisher database</em>&#8216;,<br />
@publication =  N&#8217;<em>publication name</em>&#8216;,<br />
@independent_agent =  &#8216;true&#8217;,<br />
@subscription_type =  &#8216;pull&#8217;,<br />
@description =  &#8216;description&#8217;,<br />
@update_mode =  &#8216;read only&#8217;,<br />
@immediate_sync =  1</p>
<p><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication28.png"><img class="alignnone size-large wp-image-2381" src="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication28-1024x640.png" alt="" width="1024" height="640" /></a></p>
<p>Lastly, run this command on the subscriber:</p>
<p>exec sp_addpullsubscription_agent<br />
@publisher =  N&#8217;<em>publisher name</em>&#8216;,<br />
@publisher_db =  N&#8217;<em>publisher database</em>&#8216;,<br />
@publication = N&#8217;<em>publication name</em>&#8216;,<br />
@distributor = N&#8217;<em>distributor name</em>&#8216;,<br />
@job_login = N&#8217;<em>login for job</em>&#8216;,<br />
@job_password = N&#8217;<em>password</em>&#8216;,<br />
@subscriber_security_mode = 1,<br />
@frequency_type = 64,<br />
@frequency_interval = 0,<br />
@frequency_relative_interval = 0,<br />
@frequency_recurrence_factor = 0,<br />
@frequency_subday = 0,<br />
@frequency_subday_interval = 0,<br />
@active_start_time_of_day = 0,<br />
@active_end_time_of_day = 235959,<br />
@active_start_date = 20120113,<br />
@active_end_date = 99991231,<br />
@enabled_for_syncmgr = N&#8217;False&#8217;,<br />
@distributor_security_mode = 1,<br />
@distributor_login = N&#8217;<em>login to connect to distributor</em>&#8216;,<br />
@distributor_password = N&#8217;<em>password</em>&#8216;,<br />
@alt_snapshot_folder = N&#8221;,<br />
@working_directory = N&#8221;,<br />
@use_ftp = N&#8217;False&#8217;</p>
<p>The security mode = 1 means using Windows authentication which is possible with domain user logins.  If you need to use SQL authentication, the security mode should be set to 0.</p>
<p><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication29b.png"><img class="alignnone size-large wp-image-2407" src="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication29b-1024x640.png" alt="" width="1024" height="640" /></a></p>
<p>If no errors occurred, the replication should be established now.  You can check replication status using the replication monitor.  Right-click the <strong>Replication </strong>folder and select <strong>Launch Replication Monitor</strong>.</p>
<p><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication30.png"><img class="alignnone size-full wp-image-2385" src="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication30.png" alt="" width="357" height="484" /></a></p>
<p>The replication monitor will show the replication latency between the publisher and subscriber servers.</p>
<p><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication31.png"><img class="alignnone size-full wp-image-2387" src="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication31.png" alt="" width="700" height="440" /></a></p>
<p>You can get a more accurate view of the replication health by viewing the details on the subscription.  Inside of the replication monitor, select the <strong>Subscription Watch List</strong> tab.  Right-click the subscription and select<strong> View Details</strong>.</p>
<p><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication34.png"><img class="alignnone size-full wp-image-2417" src="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication34.png" alt="" width="700" height="439" /></a></p>
<p>Inside of the details on the subscription, select the <strong>Undistributed Commands</strong> tab.  You will see the number of commands to be applied to the subscriber and a time estimate to apply the commands.  If you have a large production database to replicate, there will probably be a lot of commands to apply since taking the original backup.  You&#8217;ll know that the replication health is good so long as the number of commands is going down.  Once replication has caught up completely, the number of commands to applied will be 0; as stated earlier, it may take several days to catch up completely if you have a large database.</p>
<p><a href="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication35.png"><img class="alignnone size-full wp-image-2419" src="http://www.misdivision.com/blog/wp-content/uploads/2012/01/SQL_replication35.png" alt="" width="699" height="565" /></a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.misdivision.com/blog/how-to-set-up-a-transactional-replication-pull-subscription-in-windows-sql-server-2008-r2-using-sql-commands/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Configure MISDivision Hosted Lync</title>
		<link>http://www.misdivision.com/blog/how-to-configure-misdivision-hosted-lync</link>
		<comments>http://www.misdivision.com/blog/how-to-configure-misdivision-hosted-lync#comments</comments>
		<pubDate>Tue, 27 Sep 2011 21:33:35 +0000</pubDate>
		<dc:creator>Andrew Kuhlmann</dc:creator>
				<category><![CDATA[Featured]]></category>

		<guid isPermaLink="false">http://www.misdivision.com/blog/?p=2305</guid>
		<description><![CDATA[Configuring your hosted MISDivision Lync account is easy, simply follow these steps. From your Lync client, click the gear icon and then navigate to tools &#8211;&#62; options From here you will see the options menu. Next, click the &#8220;Personal&#8221; tab on the left and then the &#8220;Advanced&#8230;&#8221; button. This will pop-up Advanced Connection Settings. From [...]]]></description>
			<content:encoded><![CDATA[<p>Configuring your hosted MISDivision Lync account is easy, simply follow these steps.</p>
<p>From your Lync client, click the gear icon and then navigate to tools &#8211;&gt; options</p>
<p><a href="http://www.misdivision.com/blog/wp-content/uploads/2011/09/step1.jpg"><img class="alignnone size-full wp-image-2306" src="http://www.misdivision.com/blog/wp-content/uploads/2011/09/step1.jpg" alt="" width="259" height="151" /></a></p>
<p>From here you will see the options menu.</p>
<p>Next, click the &#8220;Personal&#8221; tab on the left and then the &#8220;Advanced&#8230;&#8221; button. This will pop-up Advanced Connection Settings.</p>
<p>From here, insert the internal server name or IP address and External server name or IP Address fields as seen below with the server: sip.misdivision.com</p>
<p><a href="http://www.misdivision.com/blog/wp-content/uploads/2011/09/step2.jpg"><img class="alignnone size-full wp-image-2307" src="http://www.misdivision.com/blog/wp-content/uploads/2011/09/step2.jpg" alt="" width="505" height="254" /></a></p>
<p>Once you have complete this, simply login with your assigned user name and password.<br />
]]></content:encoded>
			<wfw:commentRss>http://www.misdivision.com/blog/how-to-configure-misdivision-hosted-lync/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Automatically Login to External SharePoint Site</title>
		<link>http://www.misdivision.com/blog/how-to-automatically-login-to-external-sharepoint-site</link>
		<comments>http://www.misdivision.com/blog/how-to-automatically-login-to-external-sharepoint-site#comments</comments>
		<pubDate>Fri, 05 Aug 2011 17:07:20 +0000</pubDate>
		<dc:creator>Andrew Kuhlmann</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Microsft SharePoint]]></category>
		<category><![CDATA[Administration]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[sharepoint]]></category>

		<guid isPermaLink="false">http://www.misdivision.com/blog/?p=2301</guid>
		<description><![CDATA[The following steps will allow you to automatically log in to a SharePoint site which does not share your work stations Active Directory domain.]]></description>
			<content:encoded><![CDATA[<p>The following steps will allow you to automatically log in to a SharePoint site which does not share your work stations Active Directory domain.</p>
<p>1. In Internet Explorer, click &#8220;tools&#8221; then click &#8220;internet options&#8221;<br />
2. Click the &#8220;Secuirty&#8221; tab and then click the &#8220;Local Intranet&#8221; icon<br />
3. Click the &#8220;Sites&#8221; button and then click &#8220;Advanced&#8221;<br />
4. Type or otherwise enter the domain for the SharePoint site into the &#8220;add website to the zone:&#8221; input box and click the &#8220;Add&#8221; button</p>
<p><a href="http://www.misdivision.com/blog/wp-content/uploads/2011/08/IE.jpg"><img class="alignnone size-full wp-image-2302" src="http://www.misdivision.com/blog/wp-content/uploads/2011/08/IE.jpg" alt="" width="370" height="500" /></a></p>
<p>Next, as this is an external site you must store a credential for the site via this method:</p>
<p>1. Navigate to Control Panel\User Accounts\Credential Manager on your Windows computer. This can be accessed either via the control panel, or by simply entering &#8220;Control Panel\User Accounts\Credential Manager&#8221; into a My Computer window.<br />
2. Click &#8220;Add a windows credential&#8221;<br />
3. In the window that appears, enter your SharePoint sites domain.<br />
4. Enter in your username/password.</p>
<p><a href="http://www.misdivision.com/blog/wp-content/uploads/2011/08/cred.jpg"><img class="alignnone size-full wp-image-2303" src="http://www.misdivision.com/blog/wp-content/uploads/2011/08/cred.jpg" alt="" width="671" height="270" /></a></p>
<p>After completing the above steps you should automatically be logged into the SharePoint site without needing to authenticate each time.<br />
]]></content:encoded>
			<wfw:commentRss>http://www.misdivision.com/blog/how-to-automatically-login-to-external-sharepoint-site/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to set mailboxes to forward and save a copy in Exchange 2010</title>
		<link>http://www.misdivision.com/blog/how-to-set-mailboxes-to-forward-and-save-a-copy-in-exchange-2010</link>
		<comments>http://www.misdivision.com/blog/how-to-set-mailboxes-to-forward-and-save-a-copy-in-exchange-2010#comments</comments>
		<pubDate>Wed, 08 Jun 2011 19:51:13 +0000</pubDate>
		<dc:creator>Andrew Kuhlmann</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Microsoft Exchange]]></category>
		<category><![CDATA[Administration]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[Exchange]]></category>
		<category><![CDATA[Exchange 2010]]></category>
		<category><![CDATA[Powershell]]></category>

		<guid isPermaLink="false">http://www.misdivision.com/blog/?p=2297</guid>
		<description><![CDATA[As an Exchange 2010 administrator a common request is for a mailbox to exist for forwarding purposes, but also to reserve a copy of any received email in the mailbox.]]></description>
			<content:encoded><![CDATA[<p>As an Exchange 2010 administrator a common request is for a mailbox to exist for forwarding purposes, but also to reserve a copy of any received email in the mailbox.</p>
<p>Achieving this is simple when you&#8217;re using the Exchange management console. Simply edit the mailbox properties and click the mail flow tab, delivery options, and use the GUI to input values.</p>
<p>However when editing this using PowerShell commands isn&#8217;t immediately obvious due to the confusing names given to mailbox properties by Exchange.</p>
<p>See example code:</p>
<blockquote><p>$mailboxID = &#8220;example.local/Microsoft Exchange Hosted Organizations/example.com/John Smith&#8221;<br />
$ForwardingAddress = &#8220;johnsmith@contoso.com&#8221;<br />
set-mailbox -identity $mailboxID -forwardingsmtpaddress $ForwardingAddress -DeliverToMailboxAndForward $true</p></blockquote>
<p>This requires two input variables. The ID of the mailbox, found using the get-mailbox cmdlet&#8230; And the address to which email should be forwarded. The &#8220;DeliverToMailboxAndForward&#8221; property gets changed to $true which will enable sending a forward as well as keeping a copy.<br />
]]></content:encoded>
			<wfw:commentRss>http://www.misdivision.com/blog/how-to-set-mailboxes-to-forward-and-save-a-copy-in-exchange-2010/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to manage Usage Quotes in SharePoint 2010</title>
		<link>http://www.misdivision.com/blog/how-to-manage-usage-quotes-in-sharepoint-2010</link>
		<comments>http://www.misdivision.com/blog/how-to-manage-usage-quotes-in-sharepoint-2010#comments</comments>
		<pubDate>Wed, 08 Jun 2011 19:36:56 +0000</pubDate>
		<dc:creator>Andrew Kuhlmann</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Microsft SharePoint]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[disk usage]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[quota template]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[sharepoint]]></category>

		<guid isPermaLink="false">http://www.misdivision.com/blog/?p=2294</guid>
		<description><![CDATA[Sharepoint 2010 site collections are assigned Usage Quotas in order to dictate how much disk space and processing power is allocated to a given site. This is useful to allow multiple sites to co-exist on the same server without negatively impacting other sites due to excessive usage.]]></description>
			<content:encoded><![CDATA[<p>Sharepoint 2010 site collections are assigned Usage Quotas in order to dictate how much disk space and processing power is allocated to a given site. This is useful to allow multiple sites to co-exist on the same server without negatively impacting other sites due to excessive usage.</p>
<p>Managing usage quotas for a given site can be achieved through two methods. Either you can specify usage individually for each site, or you can assign templates to any number of sites effectively duplicating the usage quotas throughout.</p>
<p>Unfortunately there doesn&#8217;t appear to be an obvious Powershell method to manage quota templates, however there are ways to assign quota templates once you have created them through the web interface of the central administration site.</p>
<p>From central administration, click on Application Management, then click Specify Quota Templates. You will then be presented with the following interface:</p>
<p><a href="http://www.misdivision.com/blog/wp-content/uploads/2011/06/usage1.jpg"><img class="alignnone size-full wp-image-2295" src="http://www.misdivision.com/blog/wp-content/uploads/2011/06/usage1.jpg" alt="" width="641" height="549" /></a></p>
<p>In this example we have specified two items:</p>
<ol>
<li>100 MB of disk usage allowed with a warning at 75mb (this is very conservative level of usage allowed)</li>
<li>300 Usage points, with a warning at 200 points. (default amount)</li>
</ol>
<p>Edit these items based on an educated estimation of the potential growth of a given SharePoint site. For more information regarding planning quotas for your site, see <a title="Plan quota mangement" href="http://technet.microsoft.com/en-us/library/cc891489.aspx" target="_blank">this TechNet article</a>.</p>
<p>Assigning this template can be accomplished using the following PowerShell code at command line or in a script:</p>
<blockquote><p>$siteurlmain = &#8220;http://sharepoint.example.com&#8221;<br />
Set-SPSite -Identity $siteurlmain -QuotaTemplate &#8220;test&#8221;</p></blockquote>
<p>You may also configure usages for site collections on the central administration site using the GUI.<br />
]]></content:encoded>
			<wfw:commentRss>http://www.misdivision.com/blog/how-to-manage-usage-quotes-in-sharepoint-2010/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to rename a Domain Controller</title>
		<link>http://www.misdivision.com/blog/how-to-rename-a-domain-controller</link>
		<comments>http://www.misdivision.com/blog/how-to-rename-a-domain-controller#comments</comments>
		<pubDate>Sat, 04 Jun 2011 21:16:47 +0000</pubDate>
		<dc:creator>Kevin Viera</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[active directory]]></category>
		<category><![CDATA[domain controller]]></category>
		<category><![CDATA[Rename Domain]]></category>
		<category><![CDATA[Window Server 2008]]></category>

		<guid isPermaLink="false">http://www.misdivision.com/blog/?p=2280</guid>
		<description><![CDATA[Today I’m going to show you how to rename a Domain Controller. Before we can rename the DC, we must prepare the server first. You can use this checklist as a guide to make sure your server is ready or copy and paste this link into your browser http://technet.microsoft.com/en-us/library/cc816631(WS.10).aspx. The actual command to rename it [...]]]></description>
			<content:encoded><![CDATA[<p>Today I’m going to show you how to rename a Domain Controller. Before we can rename the DC, we must prepare the server first. You can use this <a href="http://technet.microsoft.com/en-us/library/cc816631(WS.10).aspx/">checklist</a> as a guide to make sure your server is ready or copy and paste this link into your browser http://technet.microsoft.com/en-us/library/cc816631(WS.10).aspx. The actual command to rename it is fairly simple. One thing yo must remember is that the Forest and Domain Functional Level should be Windows Server 2008 to proceed with the following task.</p>
<p><strong>Tutorial:</strong></p>
<ol>
<li>
Open your command prompt and run the following code:</p>
<blockquote><p>rendom /list </p></blockquote>
</li>
<li>The previous command will outputs an XML file (Domainlist.xml) to the directory where rendom resides. You edit that file to change your domain configuration to the new domain name. i.e ForestDNSZones, DomainDNSZones, Netbios name. After you modified that file you will need to run:<br />
<blockquote><p>rendom /showforest </p></blockquote>
<p>That command will shows you the future configuration, verify and make changes if necessary</li>
<li>
Next you will need to upload the changes you have made in the XML file by running: </p>
<blockquote><p>rendom /upload
</p></blockquote>
</li>
<li>
You will need to verify readiness of Domain Controller(s) by running:  </p>
<blockquote><p>rendom /prepare
</p></blockquote>
</li>
<li>
Next execute domain rename instructions by running: </p>
<blockquote><p>rendom /execute</p></blockquote>
</li>
<li>
After thats finishes up successfully, you should also run GPFIXUP tool to fix up GPO references to your old domain name by running:</p>
<blockquote><p>gpfixup /olddns:(your old dns)/newdns:(your new dns)</p></blockquote>
</li>
<li>
Lastly, run: </p>
<blockquote><p>rendom /clean
</p></blockquote>
<p>Once you are finish, the server will need a reboot. After the server reboot you can log back into your AD and verify your new domain.
</li>
<ol>
<p>
]]></content:encoded>
			<wfw:commentRss>http://www.misdivision.com/blog/how-to-rename-a-domain-controller/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why does allocating large databases take so long by default with Microsoft SQL?</title>
		<link>http://www.misdivision.com/blog/why-does-allocating-large-databases-take-so-long-by-default-with-microsoft-sql</link>
		<comments>http://www.misdivision.com/blog/why-does-allocating-large-databases-take-so-long-by-default-with-microsoft-sql#comments</comments>
		<pubDate>Wed, 25 May 2011 19:26:47 +0000</pubDate>
		<dc:creator>Andrew Kuhlmann</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[2005]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[Administration]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[Instant File Initialization]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[R2]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[windows server 2008]]></category>

		<guid isPermaLink="false">http://www.misdivision.com/blog/?p=2268</guid>
		<description><![CDATA[A common problem which occurs when going to allocate a new database in Microsoft SQL is an extremely long operation which will occur by default due to a disk zeroing operation that is performed when creating a new database. By default this will take a very long time even on the most powerful of database servers. ]]></description>
			<content:encoded><![CDATA[<p>A common problem which occurs when going to allocate a new database in Microsoft SQL is an extremely long operation which will occur by default due to a disk zeroing operation that is performed when creating a new database. By default this will take a very long time even on the most powerful of database servers.</p>
<p>The reason behind this is fairly simple to understand. Rather than deleting a file, SQL actually goes out and zeroes the space on the drive. Obviously zeroing the space on the drive is a lot more intensive of an operation than simply flagging it as deleted and allowing the disk controller to simply overwrite that sector next time it needs some space.</p>
<p>Of course there&#8217;s a very minor security risk here in that if someone were able to take total control of this disk they could theoretically use a disk recovery utility to read any data that was previously existing. Otherwise, there is really no disadvantage to simply erasing the space.</p>
<p>In order to allow SQL Server to allocate database quickly using Instant File Initialization, a security policy change needs to be made. This change can be made on either a computer level or a domain level. In most circumstances this would likely be made on a domain level in order to reduce administration overhead.</p>
<p><strong>To enable Instant File Initialization perform the following steps: </strong></p>
<p>1. Run secpol.msc on a SQL server. Expand Local Policies, click User Rights Assignment. On the right side, right click/properties &#8220;Perform Volume Maintenance Tasks.&#8221;<br />
<a href="http://www.misdivision.com/blog/wp-content/uploads/2011/05/blog1.jpg"><img class="alignnone size-full wp-image-2269" src="http://www.misdivision.com/blog/wp-content/uploads/2011/05/blog1.jpg" alt="" width="760" height="479" /></a></p>
<p>From there, you&#8217;ll see the following menu. Simply add the service account for your SQL database engine. You can also add the instance itself by its local object which will be something like: SQLServerMSSQLUser$ (computer name) $MSSQLSERVER</p>
<p><a href="http://www.misdivision.com/blog/wp-content/uploads/2011/05/blog2.jpg"><img class="alignnone size-full wp-image-2270" src="http://www.misdivision.com/blog/wp-content/uploads/2011/05/blog2.jpg" alt="" width="412" height="491" /></a></p>
<p>This may change based on if your SQL instance is named, and can be confirmed by using the secpol.msc snap-in to determine the actual name of the local account.</p>
<p>Also note that when you go to browse/add this in the properties menu for the actual security policy that you&#8217;ll need to select your computer name instead of the domain name.</p>
<p>Again, assigning this permission by the computer or by the domain service account accomplishes the same thing and is up to the administrator to determine based on their organizational security policy.<br />
]]></content:encoded>
			<wfw:commentRss>http://www.misdivision.com/blog/why-does-allocating-large-databases-take-so-long-by-default-with-microsoft-sql/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

