tag:blogger.com,1999:blog-10580989234311209442024-03-13T18:56:42.736+10:00Yet Another Computing BlogWindows, Linux, SQL Server and other stuffWillhttp://www.blogger.com/profile/01725430562728194875noreply@blogger.comBlogger59125tag:blogger.com,1999:blog-1058098923431120944.post-45968955571472112932019-06-19T07:47:00.001+10:002019-06-19T08:02:56.999+10:00Reference Architecture - Windows Failover Cluster - Two Nodes Multi-Site<br />
<h1>
Introduction<o:p></o:p></h1>
<div align="left" class="MsoNormal" style="text-align: left;">
A two node multi-site
Windows failover cluster is typically used in non-production environments. The
key benefits of such an approach include providing a “cut down” replica of a
standard four-node failover cluster used in production and facilitating
simplified failover of services to disaster recovery sites.<o:p></o:p></div>
<div align="left" class="MsoNormal" style="text-align: left;">
In this architecture we
are deploying a single Windows server in both the primary and secondary sites.
These are clustered using Windows failover clustering. A quorum file server is
deployed (if one does not already exist) in the primary site to provide a third
“tie-breaker” node when it comes to voting on the primary node in the cluster.<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="mso-no-proof: yes;"><!--[if gte vml 1]><v:shapetype
id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t"
path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f">
<v:stroke joinstyle="miter"/>
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0"/>
<v:f eqn="sum @0 1 0"/>
<v:f eqn="sum 0 0 @1"/>
<v:f eqn="prod @2 1 2"/>
<v:f eqn="prod @3 21600 pixelWidth"/>
<v:f eqn="prod @3 21600 pixelHeight"/>
<v:f eqn="sum @0 0 1"/>
<v:f eqn="prod @6 1 2"/>
<v:f eqn="prod @7 21600 pixelWidth"/>
<v:f eqn="sum @8 21600 0"/>
<v:f eqn="prod @7 21600 pixelHeight"/>
<v:f eqn="sum @10 21600 0"/>
</v:formulas>
<v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/>
<o:lock v:ext="edit" aspectratio="t"/>
</v:shapetype><v:shape id="Picture_x0020_2" o:spid="_x0000_i1062" type="#_x0000_t75"
style='width:450.6pt;height:291pt;visibility:visible;mso-wrap-style:square'>
<v:imagedata src="file:///C:/Users/william/AppData/Local/Temp/msohtmlclip1/01/clip_image001.jpg"
o:title="Windows Failover Cluster - Two Nodes Multi Site"/>
</v:shape><![endif]--><!--[if !vml]--><!--[endif]--></span><o:p></o:p></div>
<div class="MsoNormal" style="text-align: center;">
<o:p> <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi31MtOvybXM3Y7oo02HKpuLwcV23inB8qVMREFt5cJbXJF_yxSjnoKwzJp6Y-Z5RCKY_NaOsobjgvsmqY-A3-P2zmbTnfNCbs2fKTS4I5s3nx8-2Usqj1fIB0g7jyrR5UvFSheHOWaZgA/s1600/1.jpg" imageanchor="1"><img border="0" height="256" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi31MtOvybXM3Y7oo02HKpuLwcV23inB8qVMREFt5cJbXJF_yxSjnoKwzJp6Y-Z5RCKY_NaOsobjgvsmqY-A3-P2zmbTnfNCbs2fKTS4I5s3nx8-2Usqj1fIB0g7jyrR5UvFSheHOWaZgA/s400/1.jpg" width="400" /></a></o:p></div>
<div class="MsoNormal" style="text-align: left;">
<br />
<a name='more'></a><br /></div>
<h1>
Limitations<o:p></o:p></h1>
<div align="left" class="MsoNormal" style="text-align: left;">
This approach provides a
solid disaster recovery failover solution however has the following
limitations:<o:p></o:p></div>
<div align="left" class="MsoListParagraphCxSpFirst" style="margin-left: 54.0pt; mso-add-space: auto; mso-list: l2 level1 lfo1; text-align: left; text-indent: -36.0pt;">
<!--[if !supportLists]--><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">i)<span style="font: 7.0pt "Times New Roman";">
</span></span></span><!--[endif]-->No high availability in the primary and / or
secondary sites. There is no option to failover to a secondary node in the
primary data centre.<o:p></o:p></div>
<div align="left" class="MsoListParagraphCxSpMiddle" style="margin-left: 54.0pt; mso-add-space: auto; mso-list: l2 level1 lfo1; text-align: left; text-indent: -36.0pt;">
<!--[if !supportLists]--><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">ii)<span style="font: 7.0pt "Times New Roman";">
</span></span></span><!--[endif]-->Disaster recovery is a manual process. The
server node at the secondary site will only become the primary if both node A
fails and node B still has access to the quorum file server.<o:p></o:p></div>
<div align="left" class="MsoListParagraphCxSpLast" style="margin-left: 54.0pt; mso-add-space: auto; mso-list: l2 level1 lfo1; text-align: left; text-indent: -36.0pt;">
<!--[if !supportLists]--><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">iii)<span style="font: 7.0pt "Times New Roman";">
</span></span></span><!--[endif]-->This guide is aimed at Windows Server 2016 and
Server 2019. Settings definitely need to be reviewed for older versions of
Windows. <o:p></o:p></div>
<div align="left" class="MsoNormal" style="text-align: left;">
<br /></div>
<h1>
Out of Scope<o:p></o:p></h1>
<div class="MsoNormal">
The following items are out of scope in this document. They
may be incorporated into future revisions.<o:p></o:p></div>
<div class="MsoListParagraphCxSpFirst" style="margin-left: 54.0pt; mso-add-space: auto; mso-list: l1 level1 lfo3; text-indent: -36.0pt;">
<!--[if !supportLists]--><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">i)<span style="font: 7.0pt "Times New Roman";">
</span></span></span><!--[endif]-->SQL Server Always On. This can be deployed on
top of the Windows failover cluster and should be treated as a separate work
item.<o:p></o:p></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 54.0pt; mso-add-space: auto; mso-list: l1 level1 lfo3; text-indent: -36.0pt;">
<!--[if !supportLists]--><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">ii)<span style="font: 7.0pt "Times New Roman";">
</span></span></span><!--[endif]-->Shared storage – Not incorporated into this
document however may be added in future revisions.<o:p></o:p></div>
<div align="left" class="MsoListParagraphCxSpLast" style="margin-left: 54.0pt; mso-add-space: auto; mso-list: l1 level1 lfo3; text-align: left; text-indent: -36.0pt;">
<!--[if !supportLists]--><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="mso-list: Ignore;">iii)<span style="font: 7.0pt "Times New Roman";">
</span></span></span><!--[endif]-->Application resources and roles – Not
incorporated into this document however common roles may be added in future
revisions.<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<span style="font-family: "calibri" , sans-serif; font-size: 11.0pt; line-height: 105%;"><br clear="all" style="mso-special-character: line-break; page-break-before: always;" />
</span>
<br />
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<h1>
Pre-Build Checklist<o:p></o:p></h1>
<div align="left" class="MsoNormal" style="text-align: left;">
Before building the
Windows failover cluster confirm the following details for the cluster:<o:p></o:p></div>
<div align="left" class="MsoNormal" style="text-align: left;">
<br /></div>
<h2>
Cluster Details<o:p></o:p></h2>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTable15List4Accent3" style="border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-yfti-tbllook: 1152;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0;">
<td style="background: #EDEDED; border: solid windowtext 1.0pt; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 68;">
<b>Cluster Name<o:p></o:p></b></div>
</td>
<td style="background: #EDEDED; border-left: none; border: solid windowtext 1.0pt; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 64;">
<br /></div>
</td>
</tr>
<tr style="mso-yfti-irow: 1;">
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 4;">
<b>Cluster Primary Site IP Address</b><o:p></o:p></div>
<div align="left" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 4; text-align: left;">
<i>The IP address for the
cluster at the primary site. This resolves to the Clustered Server Name<o:p></o:p></i></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;">
<br /></div>
</td>
</tr>
<tr style="mso-yfti-irow: 2;">
<td style="background: #EDEDED; border-top: none; border: solid windowtext 1.0pt; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 68;">
<b>Cluster Secondary Site IP Address<o:p></o:p></b></div>
</td>
<td style="background: #EDEDED; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 64;">
<br /></div>
</td>
</tr>
<tr style="mso-yfti-irow: 3; mso-yfti-lastrow: yes;">
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 4;">
<b>Quorum File Share</b><o:p></o:p></div>
<div align="left" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 4; text-align: left;">
<i>Does a quorum file
server already exist or does one need to be created?<o:p></o:p></i></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;">
<br /></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal">
<br /></div>
<h2>
Server Node A Details<o:p></o:p></h2>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTable15List4Accent3" style="border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-yfti-tbllook: 1152;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0;">
<td style="background: #EDEDED; border: solid windowtext 1.0pt; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 68;">
<b>Server Node A Name</b><o:p></o:p></div>
<div align="left" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 68; text-align: left;">
<i>The name of the
server. This should be of the same format as the cluster name with A,B,C,or D
appended depending on which node this is in the cluster.<o:p></o:p></i></div>
</td>
<td style="background: #EDEDED; border-left: none; border: solid windowtext 1.0pt; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 64;">
<br /></div>
</td>
</tr>
<tr style="mso-yfti-irow: 1;">
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 4;">
<b>Server Node A Site</b><o:p></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 4;">
<i>Enter the data centre code here<o:p></o:p></i></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;">
<br /></div>
</td>
</tr>
<tr style="mso-yfti-irow: 2;">
<td style="background: #EDEDED; border-top: none; border: solid windowtext 1.0pt; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 68;">
<b>Server Node A Network</b><o:p></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 68;">
<i>The network the server will be deployed into. Eg.
10.254.34.65/27<o:p></o:p></i></div>
</td>
<td style="background: #EDEDED; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 64;">
<br /></div>
</td>
</tr>
<tr style="mso-yfti-irow: 3;">
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 4;">
<b>Server Node A IP Address</b><o:p></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 4;">
<i>IP address of the server.<o:p></o:p></i></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;">
<br /></div>
</td>
</tr>
<tr style="mso-yfti-irow: 4;">
<td style="background: #EDEDED; border-top: none; border: solid windowtext 1.0pt; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 68;">
<b>Server Node A vCPU</b><o:p></o:p></div>
<div align="left" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 68; text-align: left;">
<i># vCPUs allocated to
this server. This should generally be 4 or lower. It should not exceed 8
without management approval. <o:p></o:p></i></div>
</td>
<td style="background: #EDEDED; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 64;">
<br /></div>
</td>
</tr>
<tr style="mso-yfti-irow: 5;">
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 4;">
<b>Server Node A Memory</b><o:p></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 4;">
<i>Server memory in GB.<o:p></o:p></i></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;">
<br /></div>
</td>
</tr>
<tr style="mso-yfti-irow: 6;">
<td style="background: #EDEDED; border-top: none; border: solid windowtext 1.0pt; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 68;">
<b><span style="font-size: 10.0pt;">Server Node A –
Disk C</span></b><span style="font-size: 10.0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 68; text-align: left;">
<i><span style="font-size: 10.0pt;">Typically the standard 40GB unless otherwise
required.</span><o:p></o:p></i></div>
</td>
<td style="background: #EDEDED; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 64;">
<br /></div>
</td>
</tr>
<tr style="mso-yfti-irow: 7;">
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 4;">
<b><span style="font-size: 10.0pt;">Server Node A –
Disk E</span></b><span style="font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 4;">
<i><span style="font-size: 10.0pt;">Applications and
data drive</span><o:p></o:p></i></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;">
<br /></div>
</td>
</tr>
<tr style="mso-yfti-irow: 8;">
<td style="background: #EDEDED; border-top: none; border: solid windowtext 1.0pt; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 68;">
<b><span style="font-size: 10.0pt;">Server Node A –
Disk F</span></b><span style="font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 68;">
<i>F drive typically reserved for SQL Server files.
Eg. Filestream, replication extracts<o:p></o:p></i></div>
</td>
<td style="background: #EDEDED; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 64;">
<br /></div>
</td>
</tr>
<tr style="mso-yfti-irow: 9;">
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 4;">
<b><span style="font-size: 10.0pt;">Server Node A –
Disk L</span></b><span style="font-size: 10.0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 4; text-align: left;">
<i>L drive typically
reserved for SQL Server Transaction Logs (LDF)<o:p></o:p></i></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;">
<br /></div>
</td>
</tr>
<tr style="mso-yfti-irow: 10; mso-yfti-lastrow: yes;">
<td style="background: #EDEDED; border-top: none; border: solid windowtext 1.0pt; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 68;">
<b><span style="font-size: 10.0pt;">Server Node A –
Disk T</span></b><span style="font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 68;">
<i><span style="font-size: 10.0pt;">T drive typically
reserved for SQL Server tempdb (MDF and LDF)</span><o:p></o:p></i></div>
</td>
<td style="background: #EDEDED; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 64;">
<br /></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal">
<br /></div>
<h2>
Server Node B Details<o:p></o:p></h2>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTable15List4Accent3" style="border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-yfti-tbllook: 1152; width: 601px;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0;">
<td style="background: #EDEDED; border: solid windowtext 1.0pt; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 68;">
<b>Server Node B Name</b><o:p></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 68;">
<i>The name of the server. This should be of the
same format as the cluster name with A,B,C,orD appended depending on which
node this is in the cluster.</i><b><o:p></o:p></b></div>
</td>
<td style="background: #EDEDED; border-left: none; border: solid windowtext 1.0pt; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 64;">
<br /></div>
</td>
</tr>
<tr style="mso-yfti-irow: 1;">
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 4;">
<b>Server Node B Site</b><o:p></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 4;">
<i>Enter the data centre code here</i><b><o:p></o:p></b></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;">
<br /></div>
</td>
</tr>
<tr style="mso-yfti-irow: 2;">
<td style="background: #EDEDED; border-top: none; border: solid windowtext 1.0pt; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 68;">
<b>Server Node B Network</b><o:p></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 68;">
<i>The network the server will be deployed into. Eg.
10.254.34.65/27</i><b><o:p></o:p></b></div>
</td>
<td style="background: #EDEDED; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 64;">
<br /></div>
</td>
</tr>
<tr style="mso-yfti-irow: 3;">
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 4;">
<b>Server Node B IP Address</b><o:p></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 4;">
<i>IP address of the server.</i><b><o:p></o:p></b></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;">
<br /></div>
</td>
</tr>
<tr style="mso-yfti-irow: 4;">
<td style="background: #EDEDED; border-top: none; border: solid windowtext 1.0pt; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 68;">
<b>Server Node B vCPU</b><o:p></o:p></div>
<div align="left" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 68; text-align: left;">
<i># vCPUs allocated to
this server. This should generally be 4 or lower. It should not exceed 8
without management approval.</i><b><o:p></o:p></b></div>
</td>
<td style="background: #EDEDED; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 64;">
<br /></div>
</td>
</tr>
<tr style="mso-yfti-irow: 5;">
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 4;">
<b>Server Node B Memory</b><o:p></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 4;">
<i>Server memory in GB.</i><b><o:p></o:p></b></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;">
<br /></div>
</td>
</tr>
<tr style="mso-yfti-irow: 6;">
<td style="background: #EDEDED; border-top: none; border: solid windowtext 1.0pt; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 68;">
<b><span style="font-size: 10.0pt;">Server Node B –
Disk C</span></b><span style="font-size: 10.0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 68; text-align: left;">
<i><span style="font-size: 10.0pt;">Typically the standard 40GB unless otherwise
required.</span></i><b><o:p></o:p></b></div>
</td>
<td style="background: #EDEDED; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 64;">
<br /></div>
</td>
</tr>
<tr style="mso-yfti-irow: 7;">
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 4;">
<b><span style="font-size: 10.0pt;">Server Node B –
Disk E</span></b><span style="font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 4;">
<i><span style="font-size: 10.0pt;">Applications and
data drive</span></i><b><o:p></o:p></b></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;">
<br /></div>
</td>
</tr>
<tr style="mso-yfti-irow: 8;">
<td style="background: #EDEDED; border-top: none; border: solid windowtext 1.0pt; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 68;">
<b><span style="font-size: 10.0pt;">Server Node B –
Disk F</span></b><span style="font-size: 10.0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 68; text-align: left;">
<i>F drive typically
reserved for SQL Server files. Eg. Filestream, replication extracts</i><b><o:p></o:p></b></div>
</td>
<td style="background: #EDEDED; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 64;">
<br /></div>
</td>
</tr>
<tr style="mso-yfti-irow: 9;">
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 4;">
<b><span style="font-size: 10.0pt;">Server Node B –
Disk L</span></b><span style="font-size: 10.0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 4; text-align: left;">
<i>L drive typically
reserved for SQL Server Transaction Logs (LDF)</i><b><o:p></o:p></b></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;">
<br /></div>
</td>
</tr>
<tr style="mso-yfti-irow: 10; mso-yfti-lastrow: yes;">
<td style="background: #EDEDED; border-top: none; border: solid windowtext 1.0pt; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 68;">
<b><span style="font-size: 10.0pt;">Server Node B –
Disk T</span></b><span style="font-size: 10.0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 68; text-align: left;">
<i><span style="font-size: 10.0pt;">T drive typically reserved for SQL Server tempdb
(MDF and LDF)</span></i><b><o:p></o:p></b></div>
</td>
<td style="background: #EDEDED; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 225.4pt;" valign="top" width="301"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-yfti-cnfc: 64;">
<br /></div>
</td>
</tr>
</tbody></table>
<span style="font-family: "calibri" , sans-serif; font-size: 11.0pt; line-height: 105%;"><br clear="all" style="mso-special-character: line-break; page-break-before: always;" />
</span>
<br />
<div class="MsoNormal">
<br /></div>
<h1>
Cluster Quorum Server Build Process<o:p></o:p></h1>
<div align="left" class="MsoNormal" style="text-align: left;">
If a quorum file server
does not already exist, one will need to be created. If one does exist, skip
this section and create the file share witness on the existing server.<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<h2>
Quorum File Server Build<o:p></o:p></h2>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo2; text-indent: -18.0pt;">
<!--[if !supportLists]--><span style="font-family: "symbol"; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7.0pt "Times New Roman";">
</span></span></span><!--[endif]-->Deploy a Windows Server as per the standard
server build process. Resource requirements are low with 2 vCPU and 2GB ram
being enough. A small secondary drive of 5GB is enough to host multiple quorum
file shares.<o:p></o:p></div>
<div class="MsoNormal">
Create a quorums folder on the E drive of the server. (Note
screenshot shows C, this should be E)<o:p></o:p></div>
<div align="center" class="MsoNormal" style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZgfYc-uVisNpet6IBk_B1acXDzAg5GaEw5pQuJGS72Oi_PcCKyVLA7NF4NFfU0ZuZY-Gq35TQ0NaPlr9Ng_O1sEOjiniRTsF3f7rSC20eDMB4CzJzJ17ilyHpTTLM9sTxP0bKD64Qegs/s1600/2.png" imageanchor="1"><img border="0" height="211" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZgfYc-uVisNpet6IBk_B1acXDzAg5GaEw5pQuJGS72Oi_PcCKyVLA7NF4NFfU0ZuZY-Gq35TQ0NaPlr9Ng_O1sEOjiniRTsF3f7rSC20eDMB4CzJzJ17ilyHpTTLM9sTxP0bKD64Qegs/s400/2.png" width="400" /></a></div>
<div align="left" class="MsoNormal" style="text-align: left;">
Share this folder out.
The Windows share permissions are set to <b>Everyone</b> – <b>Full Control</b>.
Note that access to the share is restricted by NTFS. <o:p></o:p></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVfTXLrTZ3suJIIv3BOq7mJwHwNwaMA6hDcOU1f23k6k-_StET211odAhwJG4EsKq9h5tY_r_GAsaPkHJ3fX-bhnje41wvPpbal2ZOWs9m_2ovwNoRYkR1q0kdH7i61E5-6bN8WnUC5XA/s1600/3.png" imageanchor="1"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVfTXLrTZ3suJIIv3BOq7mJwHwNwaMA6hDcOU1f23k6k-_StET211odAhwJG4EsKq9h5tY_r_GAsaPkHJ3fX-bhnje41wvPpbal2ZOWs9m_2ovwNoRYkR1q0kdH7i61E5-6bN8WnUC5XA/s400/3.png" width="298" /></a></div>
<div align="center" class="MsoNormal" style="text-align: center;">
<br /></div>
<br />
<div align="left" class="MsoNormal" style="text-align: left;">
<o:p><br /> </o:p></div>
<div align="left" class="MsoNormal" style="text-align: left;">
On the NTFS<b> Security</b>
tab add the group <b>ROL SEC Quorum Clients</b> with <b>Full Control</b>.<o:p></o:p></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEJ0BcQ-mOK-qYWA8bIDrTxdbURKcJz6zGIpou_LB5c_IQwTA3yN25qcFP4K7dik7uyczvDfDUUqdzv09qFXOAr9LJ4MeJzycu5Ie5hhVqNNrUEVJPg0c9R0tnnhFX4d3QoEz5rlu-LKQ/s1600/5.png" imageanchor="1"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEJ0BcQ-mOK-qYWA8bIDrTxdbURKcJz6zGIpou_LB5c_IQwTA3yN25qcFP4K7dik7uyczvDfDUUqdzv09qFXOAr9LJ4MeJzycu5Ie5hhVqNNrUEVJPg0c9R0tnnhFX4d3QoEz5rlu-LKQ/s400/5.png" width="300" /></a></div>
<h2>
Configure Active Directory Groups<o:p></o:p></h2>
<div align="left" class="MsoNormal" style="text-align: left;">
In Active Directory if
the <b>ROL SEC Quorum Clients</b> group does not exist, create it. This group
will be used by computer server accounts to access the file share quorum.<o:p></o:p></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDTFI63REikbvTIZ-ltoH2RFTGz5wNBTVL35SlL7W46kILgVnWy-syYdOTk5XL-DiLReAJP1FnRMNyH5-nn8cyrN7vHpSrBzxmPut_hR4bSzcEiEN-gL1H8U5jubaiblwcK9PyzPe774g/s1600/6.png" imageanchor="1"><img border="0" height="140" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDTFI63REikbvTIZ-ltoH2RFTGz5wNBTVL35SlL7W46kILgVnWy-syYdOTk5XL-DiLReAJP1FnRMNyH5-nn8cyrN7vHpSrBzxmPut_hR4bSzcEiEN-gL1H8U5jubaiblwcK9PyzPe774g/s400/6.png" width="400" /></a></div>
<div align="center" class="MsoNormal" style="text-align: center;">
<br /></div>
<div align="left" class="MsoNormal" style="text-align: left;">
In the group membership
add the computer accounts for the cluster and nodes to the group.<o:p></o:p></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixNzChsM4tF_aGBCz3li5FtHGyIqBp27uSUH9MN_3QhHZu94pX-9AAJ9U_gg_CoeE09ZIUlIWzvJppfCMuNENvpGCh6joixa1Kn8kAh_0yyrmLD_HLktB_ZupXH8nEF77C2Tj8NigNA_I/s1600/7.png" imageanchor="1"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixNzChsM4tF_aGBCz3li5FtHGyIqBp27uSUH9MN_3QhHZu94pX-9AAJ9U_gg_CoeE09ZIUlIWzvJppfCMuNENvpGCh6joixa1Kn8kAh_0yyrmLD_HLktB_ZupXH8nEF77C2Tj8NigNA_I/s400/7.png" width="380" /></a></div>
<div align="left" class="MsoNormal" style="text-align: left;">
<br /></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjd8Vvwop_A9Mo5Z7ZmHx1Qu2V6RA4BmA_cyVG_NrJ6mG4XeyJ0H6MyLaPNqHCAf6-pOQJBa63u9oqfxwyv5tY5dtoLVwlqCgOKubTgVFTpmruudTndS1GgHZcPVz_HqmcaI22473IOZPs/s1600/8.png" imageanchor="1"><img border="0" height="370" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjd8Vvwop_A9Mo5Z7ZmHx1Qu2V6RA4BmA_cyVG_NrJ6mG4XeyJ0H6MyLaPNqHCAf6-pOQJBa63u9oqfxwyv5tY5dtoLVwlqCgOKubTgVFTpmruudTndS1GgHZcPVz_HqmcaI22473IOZPs/s400/8.png" width="400" /></a></div>
<div align="left" class="MsoNormal" style="text-align: left;">
<br /></div>
<h1>
Cluster Build Process<o:p></o:p></h1>
<h2>
Server Builds<o:p></o:p></h2>
<div class="MsoListParagraphCxSpFirst" style="mso-list: l0 level1 lfo2; text-indent: -18.0pt;">
<!--[if !supportLists]--><span style="font-family: "symbol"; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7.0pt "Times New Roman";">
</span></span></span><!--[endif]-->Deploy Server Node A using the standard server
build process<o:p></o:p></div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo2; text-indent: -18.0pt;">
<!--[if !supportLists]--><span style="font-family: "symbol"; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7.0pt "Times New Roman";">
</span></span></span><!--[endif]-->Install the <b>Failover Clustering</b> feature
on Server Node A as shown in figure 1 below.<o:p></o:p></div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo2; text-indent: -18.0pt;">
<!--[if !supportLists]--><span style="font-family: "symbol"; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7.0pt "Times New Roman";">
</span></span></span><!--[endif]-->Reboot the server<o:p></o:p></div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo2; text-indent: -18.0pt;">
<!--[if !supportLists]--><span style="font-family: "symbol"; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7.0pt "Times New Roman";">
</span></span></span><!--[endif]-->Deploy Server Node B using the standard server
build process<o:p></o:p></div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo2; text-indent: -18.0pt;">
<!--[if !supportLists]--><span style="font-family: "symbol"; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7.0pt "Times New Roman";">
</span></span></span><!--[endif]-->Install the <b>Failover Clustering</b> feature
on Server Node B as shown in figure 1 below.<o:p></o:p></div>
<div class="MsoListParagraphCxSpLast" style="mso-list: l0 level1 lfo2; text-indent: -18.0pt;">
<!--[if !supportLists]--><span style="font-family: "symbol"; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7.0pt "Times New Roman";">
</span></span></span><!--[endif]-->Reboot the server<o:p></o:p></div>
<div class="MsoNormal" style="margin-left: 18.0pt;">
<br /></div>
<br />
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6NjBC2r8Gc29p3Jr4Y9GNkSYypmS_UtmKOxuPUkFDHf-iPWgNy5NREmOMV-mdtH4lo3rPVK9v16ja3FURRmZ3nP6CCl08I1bkGzLy1lKzrG-SDE-zGlRf3OETSap-Birvk0OE2-loajQ/s1600/9.png" imageanchor="1"><img border="0" height="285" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6NjBC2r8Gc29p3Jr4Y9GNkSYypmS_UtmKOxuPUkFDHf-iPWgNy5NREmOMV-mdtH4lo3rPVK9v16ja3FURRmZ3nP6CCl08I1bkGzLy1lKzrG-SDE-zGlRf3OETSap-Birvk0OE2-loajQ/s400/9.png" width="400" /></a></div>
<div align="left" class="MsoNormal" style="text-align: left;">
<br /></div>
<h2>
Networking<o:p></o:p></h2>
<h3>
Test Inter-Node RPC Connectivity<o:p></o:p></h3>
<div align="left" class="MsoNormal" style="text-align: left;">
The Windows Failover
Clustering service on each node must have full communication with every other
node in the cluster over RPC. This occurs on TCP_135 but also my require high
or ephemeral ports in addition. Note that this may already be enabled on a per-zone
basis depending on the network implementation. To test connectivity between
nodes:<o:p></o:p></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="background: #E7E6E6; border-collapse: collapse; border: none; mso-background-themecolor: background2; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 450.8pt;" valign="top" width="601"><div align="left" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: left;">
From Server Node A run:<o:p></o:p></div>
<div align="left" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: left;">
<span style="font-family: "consolas"; font-size: 10.0pt;">telnet <server node B> 135<o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: left;">
This should enter into a connection on
Server Node B.<o:p></o:p></div>
<div align="left" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: left;">
<br /></div>
<div align="left" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: left;">
From Server Node B run:<o:p></o:p></div>
<div align="left" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: left;">
<span style="font-family: "consolas"; font-size: 10.0pt;">telnet <server node A> 135<o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: left;">
This should enter into a connection on
Server Node A.<o:p></o:p></div>
</td>
</tr>
</tbody></table>
<div align="left" class="MsoNormal" style="text-align: left;">
<br /></div>
<div align="left" class="MsoNormal" style="text-align: left;">
If either of these tests
fail troubleshoot connectivity between the two servers.<o:p></o:p></div>
<div align="left" class="MsoNormal" style="text-align: left;">
<br /></div>
<h3>
Test Quorum File share Connectivity<o:p></o:p></h3>
<div class="MsoNormal">
<br /></div>
<div align="left" class="MsoNormal" style="text-align: left;">
From Server Node A and
Server Node B run:<o:p></o:p></div>
<div align="left" class="MsoNormal" style="text-align: left;">
<span style="font-family: "consolas"; font-size: 10.0pt; line-height: 105%;">telnet <quorum file server>
445<o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="text-align: left;">
This should enter into a
connection on the quorum file server.<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div align="left" class="MsoNormal" style="text-align: left;">
<br /></div>
<h2>
VMWare Configuration<o:p></o:p></h2>
<div align="left" class="MsoNormal" style="text-align: left;">
Anti-affinity rules are
configured in VMWare to ensure that two server nodes of a cluster do not reside
on the same physical host. If this was to occur an issue with the physical host
would impact more than one node in the cluster and cause an extended outage.<o:p></o:p></div>
<div align="left" class="MsoNormal" style="text-align: left;">
As this is a two-node
cluster with one server node per data centre this is not an issue and
anti-affinity rules do not need to be configured.<span style="mso-spacerun: yes;"> </span><o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<h2>
Configure Cluster<o:p></o:p></h2>
<div align="left" class="MsoNormal" style="text-align: left;">
On the first Windows
failover cluster server node open <b>Failover Cluster Manager</b>: <o:p></o:p></div>
<br />
<div align="left" class="MsoNormal" style="text-align: left;">
<br /></div>
<div align="left" class="MsoNormal" style="text-align: left;">
Right click on <b>Failover
Cluster Manager</b> and click on <b>Create Cluster…<o:p></o:p></b></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieM7eA74FRSicq69NzRqqRCYOx0ge8grGH0wVbqYvnd5tvv57JHAMheBWjzMXn19BGhAb1eqGPwpnwAoboF-WCPWUQToMX8HxAV9MiBEy21QFwFMK3sSEa6W0ck7TP6OkZjfpGOu-A69Y/s1600/11.png" imageanchor="1"><img border="0" height="290" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieM7eA74FRSicq69NzRqqRCYOx0ge8grGH0wVbqYvnd5tvv57JHAMheBWjzMXn19BGhAb1eqGPwpnwAoboF-WCPWUQToMX8HxAV9MiBEy21QFwFMK3sSEa6W0ck7TP6OkZjfpGOu-A69Y/s400/11.png" width="400" /></a></div>
<div align="left" class="MsoNormal" style="text-align: left;">
This starts the wizard,
click <b>Next</b>.<o:p></o:p></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJqDW9yOkUMKzHcdxYa1h-uHnE8YvG4Xb8AJ9bfPO2OJCbBDSk4rR0jOeFeuoFH2pKYNPQ9g8q6KEEz-4-nFE3ZLL7T_hDAMaNusEhb_GE660ISj3jvHHFmc8e2FitZ3CnyocWzZWlycY/s1600/12.png" imageanchor="1"><img border="0" height="242" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJqDW9yOkUMKzHcdxYa1h-uHnE8YvG4Xb8AJ9bfPO2OJCbBDSk4rR0jOeFeuoFH2pKYNPQ9g8q6KEEz-4-nFE3ZLL7T_hDAMaNusEhb_GE660ISj3jvHHFmc8e2FitZ3CnyocWzZWlycY/s400/12.png" width="400" /></a></div>
<div align="left" class="MsoNormal" style="text-align: left;">
<br /></div>
<div align="left" class="MsoNormal" style="text-align: left;">
Next add the server nodes
deployed in the <b>Server </b>Builds section to the cluster.<o:p></o:p></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVrmmAMeRqFpodhdph_2c6pGEQk51mfqOHPNFko7MAU7Bzj9-tAx-zp6LExZIDapqVfmCfWcjQ1lKRCXjfY8Y1VeLQyJ_FoMcC4gmF8itCSykT5idnuPJYD4POqWZ46TxeT_V6kHmiqnw/s1600/13.png" imageanchor="1"><img border="0" height="243" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVrmmAMeRqFpodhdph_2c6pGEQk51mfqOHPNFko7MAU7Bzj9-tAx-zp6LExZIDapqVfmCfWcjQ1lKRCXjfY8Y1VeLQyJ_FoMcC4gmF8itCSykT5idnuPJYD4POqWZ46TxeT_V6kHmiqnw/s400/13.png" width="400" /></a></div>
<div align="left" class="MsoNormal" style="text-align: left;">
<br /></div>
<div align="left" class="MsoNormal" style="text-align: left;">
Now run the validation
tests. These tests are run to ensure that the hardware, operating system, and
software are all compatible with Windows Failover Clustering.<o:p></o:p></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuFfIdJAkkuIVIF1JLffobJCvSiWJ65z-7Ncx5cV3GzWUgSFCDFKJZluir5FSIOhMx4FNOFbuy_SbgOQtGpf2fJ71DAMvcY20wyu1ZbY-0WlWVm9XV1646-SSBUMU0m1dnxoVtFrz-qQk/s1600/14.png" imageanchor="1"><img border="0" height="242" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuFfIdJAkkuIVIF1JLffobJCvSiWJ65z-7Ncx5cV3GzWUgSFCDFKJZluir5FSIOhMx4FNOFbuy_SbgOQtGpf2fJ71DAMvcY20wyu1ZbY-0WlWVm9XV1646-SSBUMU0m1dnxoVtFrz-qQk/s400/14.png" width="400" /></a></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGYKtPlXqizsRdLjF7EBG2_-wSjlO_65XI30jTCKIMeRIribU1axkQ0dghO4GTqP0kGtzabCI6ZrvRePmvTI8m5g-BDH3taokzPxQWaMUS2S1dpoGX9LaEn_oBAvQpFC8kATb3AALcujU/s1600/15.png" imageanchor="1"><img border="0" height="252" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGYKtPlXqizsRdLjF7EBG2_-wSjlO_65XI30jTCKIMeRIribU1axkQ0dghO4GTqP0kGtzabCI6ZrvRePmvTI8m5g-BDH3taokzPxQWaMUS2S1dpoGX9LaEn_oBAvQpFC8kATb3AALcujU/s400/15.png" width="400" /></a></div>
<div align="left" class="MsoNormal" style="text-align: left;">
<br /></div>
<div align="left" class="MsoNormal" style="text-align: left;">
Select <b>Run all tests
(Recommended)<o:p></o:p></b></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_fwAaVQUoz5k9bJA2iUW4lDTHn28mLIDaIzjFoPHC0o7KdxO2vQYOrGp474bhr2PCgC1eXENSTqUC1cX2o35SXHh4jZHKyC1ycf-nqiBmQLbxsYIujGYFoo7x2AWkEcemUOp5_ufrHWQ/s1600/16.png" imageanchor="1"><img border="0" height="255" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_fwAaVQUoz5k9bJA2iUW4lDTHn28mLIDaIzjFoPHC0o7KdxO2vQYOrGp474bhr2PCgC1eXENSTqUC1cX2o35SXHh4jZHKyC1ycf-nqiBmQLbxsYIujGYFoo7x2AWkEcemUOp5_ufrHWQ/s400/16.png" width="400" /></a></div>
<div align="left" class="MsoNormal" style="text-align: left;">
<br /></div>
<div align="left" class="MsoNormal" style="text-align: left;">
Click <b>Next</b> to
continue.<o:p></o:p></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgWjUgHSQKiSHAhj1Tp62-ZqcUJ2XZ1Z616t2KBsvPztKZGKXHqF41jHTk0HGhtNt6DCyqiItJIorLxdWmn2wWizd-4KQY_dZjhZUFHhw3aI0SfepL67PDgLcIRjI-nYrnLyrHYG1xUQE/s1600/17.png" imageanchor="1"><img border="0" height="253" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgWjUgHSQKiSHAhj1Tp62-ZqcUJ2XZ1Z616t2KBsvPztKZGKXHqF41jHTk0HGhtNt6DCyqiItJIorLxdWmn2wWizd-4KQY_dZjhZUFHhw3aI0SfepL67PDgLcIRjI-nYrnLyrHYG1xUQE/s400/17.png" width="400" /></a></div>
<div align="left" class="MsoNormal" style="text-align: left;">
<br /></div>
<div align="left" class="MsoNormal" style="text-align: left;">
Once complete the
interface should display <b>The test passed</b>. This is mandatory for some
applications such as SQL Server Always On which will refuse to install unless
the cluster validation checks pass. <o:p></o:p></div>
<div align="left" class="MsoNormal" style="text-align: left;">
As shown in the
screenshot below the test <b>Validate Network Communication</b> will report a
warning. This test will only pass if there are at least two network interfaces
on each node and the inter-node connectivity checks pass. This is OK as we’re using
high availability of the underlying network rather than at the operating system
level. The underlying network is not exposed to the operating system hence
Windows cannot confirm redundancy and reports the warning. <o:p></o:p></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_A4jpA6V2NuxU3_tMysBRECYQTUyKizuqDRu4RLIsaSiTcgHXVykPmix7tFIhyfc04q3Y12pEIPhS5x0JwvqSool2K8P7ih6_Dg0SYmIY6SNhWZMJXHTG_aVAClBKbL5StD4fRC2TVnE/s1600/18.png" imageanchor="1"><img border="0" height="255" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_A4jpA6V2NuxU3_tMysBRECYQTUyKizuqDRu4RLIsaSiTcgHXVykPmix7tFIhyfc04q3Y12pEIPhS5x0JwvqSool2K8P7ih6_Dg0SYmIY6SNhWZMJXHTG_aVAClBKbL5StD4fRC2TVnE/s400/18.png" width="400" /></a></div>
<div style="text-align: center;">
<br /></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="background: #E7E6E6; border-collapse: collapse; border: none; mso-background-themecolor: background2; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 450.8pt;" valign="top" width="601"><div align="left" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: left;">
<i>It should also be noted that a pass
for the<b> Validate Network Communication </b>does not always meet Microsoft
requirements. If a secondary network adapter in Windows shares common
infrastructure with the primary network adapter and that underlying
infrastructure is not highly available this will technical not be a valid
configuration.<o:p></o:p></i></div>
</td>
</tr>
</tbody></table>
<div align="left" class="MsoNormal" style="text-align: left;">
<br /></div>
<div align="left" class="MsoNormal" style="text-align: left;">
Once the nodes have been
added and validation checks performed the cluster can be created. Enter the
cluster name and the IP addresses for the cluster itself. Note that the
screenshot below shows only one cluster IP address. In a multi-site
configuration, there will be one cluster IP address per site.<o:p></o:p></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiajF439iq0Metnf6-glBDUaBh-bpZWoMQbCka8HFhCtrUUXWLKJxQOvYNiEDQG_xh8AkDx8cMBt4p2pfMXG19jBOoBrPcR6cb6NK4zUp-sXjM8ML3qoHm4VEc06OVzXQXwCdzjFfWrtV8/s1600/19.png" imageanchor="1"><img border="0" height="241" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiajF439iq0Metnf6-glBDUaBh-bpZWoMQbCka8HFhCtrUUXWLKJxQOvYNiEDQG_xh8AkDx8cMBt4p2pfMXG19jBOoBrPcR6cb6NK4zUp-sXjM8ML3qoHm4VEc06OVzXQXwCdzjFfWrtV8/s400/19.png" width="400" /></a></div>
<div style="text-align: center;">
<br /></div>
<div align="left" class="MsoNormal" style="text-align: left;">
Click <b>Next</b> to
continue.<o:p></o:p></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvG8wctC-sgeOB5GeNfFQW-t_FdC0jHKw3Gj2edsNEOQZvqG6wkBqq2wKLHnPmzp_vM3WkAMVQnVK7phyphenhyphenjm7p7B9VCjOiuSbgE7xeqbw0eF-ty6VrLeHMnt5Yt0MRToW-uIs1eHsaWWxk/s1600/20.png" imageanchor="1"><img border="0" height="241" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvG8wctC-sgeOB5GeNfFQW-t_FdC0jHKw3Gj2edsNEOQZvqG6wkBqq2wKLHnPmzp_vM3WkAMVQnVK7phyphenhyphenjm7p7B9VCjOiuSbgE7xeqbw0eF-ty6VrLeHMnt5Yt0MRToW-uIs1eHsaWWxk/s400/20.png" width="400" /></a></div>
<div align="left" class="MsoNormal" style="text-align: left;">
<br /></div>
<div align="left" class="MsoNormal" style="text-align: left;">
Click <b>Finish</b> to
complete creation of the cluster.<o:p></o:p></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihUaxeCI7gksaZpGL1mW_jC9Z6x4uM8Vs85ypwUpNsr7MS0mIxxh8pJqrt2-frKDAJWTfD4V520TU2jGcZUGwKJKJ-n_3AK_HnfJgYtd2ajhyphenhyphenFhYayp4fRF06zxi9rc3dVZ83VGYwCXDY/s1600/21.png" imageanchor="1"><img border="0" height="241" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihUaxeCI7gksaZpGL1mW_jC9Z6x4uM8Vs85ypwUpNsr7MS0mIxxh8pJqrt2-frKDAJWTfD4V520TU2jGcZUGwKJKJ-n_3AK_HnfJgYtd2ajhyphenhyphenFhYayp4fRF06zxi9rc3dVZ83VGYwCXDY/s400/21.png" width="400" /></a></div>
<div align="left" class="MsoNormal" style="text-align: left;">
<br /></div>
<div align="left" class="MsoNormal" style="text-align: left;">
Cluster manager will now
show the newly created cluster. On the main dashboard we expect to see the
cluster server name and the cluster IP addresses online as shown below.<o:p></o:p></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPX8aXuXSCSISX3CXKQM64eFOQb5aew_zoeoITjQkiTd2s4Nq3qd5O4Ecra9D9_n_FAQdHBOM7MiOFykotP-SMfIuqiUkiwgRxDJPwHynHDRDCCEsk09sWBJ40pwtXLgVtILC_qRFyZnQ/s1600/22.png" imageanchor="1"><img border="0" height="238" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPX8aXuXSCSISX3CXKQM64eFOQb5aew_zoeoITjQkiTd2s4Nq3qd5O4Ecra9D9_n_FAQdHBOM7MiOFykotP-SMfIuqiUkiwgRxDJPwHynHDRDCCEsk09sWBJ40pwtXLgVtILC_qRFyZnQ/s400/22.png" width="400" /></a></div>
<div align="left" class="MsoNormal" style="text-align: left;">
<br /></div>
<div align="left" class="MsoNormal" style="text-align: left;">
Under <b>Nodes</b> we’re
expecting to see each cluster node. Each node should be online with <b>Status
Up</b>.<o:p></o:p></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5LLjzjiWOnwvq4gBu6bY779XP1R4OMk1TvOOjcH-xdwI21uhyphenhyphenHG5Qg5EcJuBmnoI0p05P-dSj2s9cHCxF8-ao9L_iY5ohNSYiM5lpoCikV5l4PfXkksx3AtJYgXN0uTep851NuKyqpmE/s1600/23.png" imageanchor="1"><img border="0" height="158" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5LLjzjiWOnwvq4gBu6bY779XP1R4OMk1TvOOjcH-xdwI21uhyphenhyphenHG5Qg5EcJuBmnoI0p05P-dSj2s9cHCxF8-ao9L_iY5ohNSYiM5lpoCikV5l4PfXkksx3AtJYgXN0uTep851NuKyqpmE/s400/23.png" width="400" /></a></div>
<div align="left" class="MsoNormal" style="text-align: left;">
<br /></div>
<div align="left" class="MsoNormal" style="text-align: left;">
Under <b>Networks</b> the
default setup should be correct. As we’re using a single network both the
cluster communications and clients should use the same network.<o:p></o:p></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhboEizusKgHp53Y_ZTd-TvOjLyaQ3BQjoFslh3jdMksBrQahZVBpz8d3sY0URKGhmy45tYOvkBF4p8NTvUjwLvIvf1v_O3wG3nKQCoqbaBbd1L8iNNQ-XM5JWsyfk2wWWBvF4hsYPsp7U/s1600/24.png" imageanchor="1"><img border="0" height="335" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhboEizusKgHp53Y_ZTd-TvOjLyaQ3BQjoFslh3jdMksBrQahZVBpz8d3sY0URKGhmy45tYOvkBF4p8NTvUjwLvIvf1v_O3wG3nKQCoqbaBbd1L8iNNQ-XM5JWsyfk2wWWBvF4hsYPsp7U/s400/24.png" width="400" /></a></div>
<div align="left" class="MsoNormal" style="text-align: left;">
<br /></div>
<div align="left" class="MsoNormal" style="text-align: left;">
<br /></div>
<h3>
Disk I/O Timeout Configuration<o:p></o:p></h3>
<div align="left" class="MsoNormal" style="text-align: left;">
VMWare recommend
increasing the Disk I/O timeout for Windows clusters. This is to make the
clustering less sensitive to vMotion events.<o:p></o:p></div>
<div align="left" class="MsoNormal" style="text-align: left;">
On each cluster node set
the disk I/O timeout to 60 seconds. Modify the registry key: <span style="font-family: "courier new";">HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Disk\TimeOutValue</span>.
<o:p></o:p></div>
<div align="left" class="MsoNormal" style="text-align: left;">
Note that the system
might reset this I/O timeout value if you re-create a cluster. <o:p></o:p></div>
<div align="left" class="MsoNormal" style="text-align: left;">
<br /></div>
<div align="left" class="MsoNormal" style="text-align: left;">
<br /></div>
<h3>
<a href="https://www.blogger.com/null" name="_Toc11401847"></a><span style="mso-bookmark: _Toc11401847;">Cluster HeartBeart
TimeOut</span><o:p></o:p></h3>
<div class="MsoNormal">
No modifications to the cluster heartbeat settings are
required for Windows Server 2016 and above. The best practice recommendations
for VMWare match the default values of Server 2016.<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<h3>
<a href="https://www.blogger.com/null" name="_Toc11401848"></a><span style="mso-bookmark: _Toc11401848;">Cluster Service Accounts</span><o:p></o:p></h3>
<div class="MsoNormal">
No service accounts are created. Give the cluster computer
account permissions to read / write / create objects on the parent OU.<o:p></o:p></div>
<div class="MsoNormal">
In ADUC ensure <b>Advanced Features</b> are shown.<o:p></o:p></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXhY9lwnO9Tr80ijgR7zzvOdqOPFa22oJWwYWaq3-XbZS9KJF5iAXcf927EJTANFvgqcrHelqDtV5Ui_S4Hi6ztwOOGyHiojlttcWppgD3Ac89w1UUD5SiGb0xRALuaiIJXIBYvr4tfz0/s1600/25.png" imageanchor="1"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXhY9lwnO9Tr80ijgR7zzvOdqOPFa22oJWwYWaq3-XbZS9KJF5iAXcf927EJTANFvgqcrHelqDtV5Ui_S4Hi6ztwOOGyHiojlttcWppgD3Ac89w1UUD5SiGb0xRALuaiIJXIBYvr4tfz0/s400/25.png" width="400" /></a></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Right click on the parent OU for the cluster and node
objects and select <b>properties</b>.<o:p></o:p></div>
<br />
<div align="left" class="MsoNormal" style="text-align: left;">
<br /></div>
<div align="left" class="MsoNormal" style="text-align: left;">
Add the cluster computer
account to the OU security. Ensure <b>Read</b>, <b>Write</b>, and <b>Create all
child objects </b>permissions are granted.<o:p></o:p></div>
<br />
<div class="MsoNormal">
In the advanced security properties for the account ensure <b>Create
Computer Objects</b> permission is granted.<o:p></o:p></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBgv5J7-d2qlDI2TdyHQRcZx-W8i1zns7IsQ-19cR4SK96dSkjTumnd9v3iaDA7SFZijrbpHAyJzcunzp7tDk40UT-BfIKNk3RoSqvmuPwZVL08rxfU3taRUSde3fSDB0U9k2Y_woYPCk/s1600/28.png" imageanchor="1"><img border="0" height="258" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBgv5J7-d2qlDI2TdyHQRcZx-W8i1zns7IsQ-19cR4SK96dSkjTumnd9v3iaDA7SFZijrbpHAyJzcunzp7tDk40UT-BfIKNk3RoSqvmuPwZVL08rxfU3taRUSde3fSDB0U9k2Y_woYPCk/s400/28.png" width="400" /></a></div>
<div class="MsoNormal">
<br /></div>
<h3>
Cluster Quorum Configuration<o:p></o:p></h3>
<div align="left" class="MsoNormal" style="text-align: left;">
Ensure the cluster and
server computer accounts have been added to the groups <b>ROL SEC Quorum
Clients</b>.<o:p></o:p></div>
<div align="left" class="MsoNormal" style="text-align: left;">
On the quorum file server
add a folder to the quorums share for this cluster. Note that this will inherit
the permissions <o:p></o:p></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhe74n8V6jcvEXKuZ3jWT50EL01n0pv7Wepf5m1a5APNRbwYo18d7nf6ZpbQgQSYSEpz5C3ES-FVTrKUXPGr0XeBPpAxzTvoT77e5u7ZwJ2PKk9q46PeKeCiNwOBLEJ_HDUUZ6c8vcK8Ls/s1600/30.png" imageanchor="1"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhe74n8V6jcvEXKuZ3jWT50EL01n0pv7Wepf5m1a5APNRbwYo18d7nf6ZpbQgQSYSEpz5C3ES-FVTrKUXPGr0XeBPpAxzTvoT77e5u7ZwJ2PKk9q46PeKeCiNwOBLEJ_HDUUZ6c8vcK8Ls/s400/30.png" width="386" /></a></div>
<div align="left" class="MsoNormal" style="text-align: left;">
From the cluster
dashboard click on <b>More Actions </b><b><span style="font-family: "wingdings"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-char-type: symbol; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;"><span style="mso-char-type: symbol; mso-symbol-font-family: Wingdings;">à</span></span>
Configure Cluster Quorum Settings…</b><o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzWouThV4j9TWJJlvL1JWCBA3tGL2CNbGHt07eElSO2J9p5UBwFqp-j9LnZN7wDmZuRc18fp64b0dneQiQaG_dbDViAzXQggQ-0O-3zdbX3EIWu44N9jIPHA0gL_ICyYofMChgCJ4OHmg/s1600/31.png" imageanchor="1"><img border="0" height="255" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzWouThV4j9TWJJlvL1JWCBA3tGL2CNbGHt07eElSO2J9p5UBwFqp-j9LnZN7wDmZuRc18fp64b0dneQiQaG_dbDViAzXQggQ-0O-3zdbX3EIWu44N9jIPHA0gL_ICyYofMChgCJ4OHmg/s400/31.png" width="400" /></a></div>
<div align="left" class="MsoNormal" style="text-align: left;">
<br /></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiIvwNPtHQ1K0QDYLu1oX9LlkEPrXjEVlX64KbCNqkfiqQ8z7jwmEKF6Z-dnKBvwwZ7SKK_UY-QKgGK5BXNLKfWzmoUJPYNQDOIC8rm53AHBAwn4KnVZp4yfE61nyMYm3mztmorKGfYlw/s1600/32.png" imageanchor="1"><img border="0" height="255" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiIvwNPtHQ1K0QDYLu1oX9LlkEPrXjEVlX64KbCNqkfiqQ8z7jwmEKF6Z-dnKBvwwZ7SKK_UY-QKgGK5BXNLKfWzmoUJPYNQDOIC8rm53AHBAwn4KnVZp4yfE61nyMYm3mztmorKGfYlw/s400/32.png" width="400" /></a></div>
<div align="left" class="MsoNormal" style="text-align: left;">
<br /></div>
<div align="left" class="MsoNormal" style="text-align: left;">
Select the option <b>Select
the quorum witness</b>.<o:p></o:p></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyZCmlULvFBDKQlzBrYt5daKT2G-5hZrMOj6VsO4Djw-9bdIA1fexjOLU1q_NMlyWbPBUEB4cC6O1tXcTIBv6mc0nLu3CQJsMMWhqVENEFe7GD7mOS6OVOThfzS0Ojua5i-dizoZfuqqk/s1600/33.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="252" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyZCmlULvFBDKQlzBrYt5daKT2G-5hZrMOj6VsO4Djw-9bdIA1fexjOLU1q_NMlyWbPBUEB4cC6O1tXcTIBv6mc0nLu3CQJsMMWhqVENEFe7GD7mOS6OVOThfzS0Ojua5i-dizoZfuqqk/s400/33.png" width="400" /></a></div>
<br />
<div align="left" class="MsoNormal" style="text-align: left;">
<br /></div>
<div align="left" class="MsoNormal" style="text-align: left;">
Select <b>Configure a
file share witness</b>.<o:p></o:p></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhemk3wrXGXzQTkj2sbLn6IphhuI-ucAXckCTHMgP0NgMFLNtVnGxUq5UFlZqaN4raqqg_rTVM2MI5TMJjCCijllybqgf2AWZApUTYDmr2IWdtvmZn6Yi-MDNFm6Gh4OjhuX6h-2Q9PmTY/s1600/34.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="255" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhemk3wrXGXzQTkj2sbLn6IphhuI-ucAXckCTHMgP0NgMFLNtVnGxUq5UFlZqaN4raqqg_rTVM2MI5TMJjCCijllybqgf2AWZApUTYDmr2IWdtvmZn6Yi-MDNFm6Gh4OjhuX6h-2Q9PmTY/s400/34.png" width="400" /></a></div>
<br />
<div align="left" class="MsoNormal" style="text-align: left;">
<br /></div>
<div align="left" class="MsoNormal" style="text-align: left;">
Add the full path of the
quorum file share as shown below. Make sure that the file share path terminates
into a dedicated folder for the cluster. <o:p></o:p></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHQmRJexv3GAxG5L0EEBuWnNKWtl3Kbi35MlTUMV7PfkkmUVgYc2OW8IfIjzeDVRSAxw3xA1sRQPCH9UU6tHe4_CCzly-cklQJW_GW54bqvqHGfiCoSJzPLMufXxrZ40EYqtkMZekKBFo/s1600/35.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="255" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHQmRJexv3GAxG5L0EEBuWnNKWtl3Kbi35MlTUMV7PfkkmUVgYc2OW8IfIjzeDVRSAxw3xA1sRQPCH9UU6tHe4_CCzly-cklQJW_GW54bqvqHGfiCoSJzPLMufXxrZ40EYqtkMZekKBFo/s400/35.png" width="400" /></a></div>
<br />
<div align="left" class="MsoNormal" style="text-align: left;">
<br /></div>
<div align="left" class="MsoNormal" style="text-align: left;">
Click <b>Next</b> and <b>Finish</b>
to complete the quorum configuration.<o:p></o:p></div>
<div align="center" class="MsoNormal" style="text-align: center;">
<span style="mso-no-proof: yes;"><!--[if gte vml 1]><v:shape id="Picture_x0020_32"
o:spid="_x0000_i1028" type="#_x0000_t75" style='width:451.8pt;height:4in;
visibility:visible;mso-wrap-style:square'>
<v:imagedata src="file:///C:/Users/william/AppData/Local/Temp/msohtmlclip1/01/clip_image065.png"
o:title=""/>
</v:shape><![endif]--><!--[if !vml]--><!--[endif]--></span><o:p></o:p></div>
<div align="left" class="MsoNormal" style="text-align: left;">
<span style="mso-no-proof: yes;"><!--[if gte vml 1]><v:shape id="Picture_x0020_33" o:spid="_x0000_i1027"
type="#_x0000_t75" style='width:451.2pt;height:286.8pt;visibility:visible;
mso-wrap-style:square'>
<v:imagedata src="file:///C:/Users/william/AppData/Local/Temp/msohtmlclip1/01/clip_image067.png"
o:title=""/>
</v:shape><![endif]--><!--[if !vml]--><!--[endif]--></span><o:p></o:p></div>
<div class="MsoNormal" style="text-align: left;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVHjE03WKsaajYPt9AbJhzHEGglbL1vZdR5PCilJ3oX9GT7vnEm-dDNqqP1dGiZ0JiMetoTuFWof0ddwXVBUoZHY-0AKexz3BVnA34NPHlTcheath2rHMzkwKgjUXdkiwbECyVcjAQ2Tg/s1600/36.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="253" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVHjE03WKsaajYPt9AbJhzHEGglbL1vZdR5PCilJ3oX9GT7vnEm-dDNqqP1dGiZ0JiMetoTuFWof0ddwXVBUoZHY-0AKexz3BVnA34NPHlTcheath2rHMzkwKgjUXdkiwbECyVcjAQ2Tg/s400/36.png" width="400" /></a></div>
</div>
<div align="left" class="MsoNormal" style="text-align: left;">
Once the quorum creation
has finished check the file share. Two folders like the screenshot below should
be present in the folder indicating that the quorum file share is being used by
the cluster.<o:p></o:p></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMwLGeDEmev7Bi8bMilditHol4D29Vw0-UucJRj5UnWJOx-wTOF6bJOomPcdCVWcFl2TkPZ2xyeDOzW2kQuXGXp4s_tARgGMYLfBbsuRKjJD0drPINQ7Xx070gm2vmfreGEsZQjjKKzPM/s1600/37.png" imageanchor="1"><img border="0" height="170" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMwLGeDEmev7Bi8bMilditHol4D29Vw0-UucJRj5UnWJOx-wTOF6bJOomPcdCVWcFl2TkPZ2xyeDOzW2kQuXGXp4s_tARgGMYLfBbsuRKjJD0drPINQ7Xx070gm2vmfreGEsZQjjKKzPM/s400/37.png" width="400" /></a></div>
<div align="left" class="MsoNormal" style="text-align: left;">
In the cluster dashboard
the <b>File Share Witness</b> should now be displayed as shown below.<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtTerJ349PpwsYwL7zUHf4j_tMK9LGQZ7Q7vIrltIcMG4-dUniFKsLWPNLnN1fic6PF-5wSTJJzSEaaLhpRuURDGQWE9GT0qHyJknbrf3Koc5ePUW50fQlKrhWF_E8H21b0xNkZcBvEBo/s1600/38.png" imageanchor="1"><img border="0" height="390" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtTerJ349PpwsYwL7zUHf4j_tMK9LGQZ7Q7vIrltIcMG4-dUniFKsLWPNLnN1fic6PF-5wSTJJzSEaaLhpRuURDGQWE9GT0qHyJknbrf3Koc5ePUW50fQlKrhWF_E8H21b0xNkZcBvEBo/s400/38.png" width="400" /></a></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<span style="font-family: "calibri" , sans-serif; font-size: 11.0pt; line-height: 105%;"><br clear="all" style="mso-special-character: line-break; page-break-before: always;" />
</span>
<br />
<div align="left" class="MsoNormal" style="text-align: left;">
<br /></div>
<h1>
Appendix A – References<o:p></o:p></h1>
<h2>
Windows Failover Clustering Requirements<o:p></o:p></h2>
<div class="MsoNormal">
<a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/dd197454(v=ws.10)#bkmk_account_infrastructure">https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/dd197454(v=ws.10)#bkmk_account_infrastructure</a><span class="MsoHyperlink"><o:p></o:p></span></div>
<h2>
VMWare Windows Clustering<o:p></o:p></h2>
<div class="MsoNormal">
<a href="https://docs.vmware.com/en/VMware-vSphere/6.5/vsphere-esxi-vcenter-server-651-setup-mscs.pdf">https://docs.vmware.com/en/VMware-vSphere/6.5/vsphere-esxi-vcenter-server-651-setup-mscs.pdf</a><o:p></o:p></div>
<h2>
Cluster Heartbeat Settings<o:p></o:p></h2>
<div class="MsoNormal">
<a href="https://techcommunity.microsoft.com/t5/Failover-Clustering/Tuning-Failover-Cluster-Network-Thresholds/ba-p/371834">https://techcommunity.microsoft.com/t5/Failover-Clustering/Tuning-Failover-Cluster-Network-Thresholds/ba-p/371834</a><o:p></o:p></div>
<span style="font-family: "calibri" , sans-serif; font-size: 11.0pt; line-height: 105%;"><br clear="all" style="mso-special-character: line-break; page-break-before: always;" />
</span>
<br />
<div class="MsoNormal">
<br /></div>
<h1>
Appendix B – Design Considerations<o:p></o:p></h1>
<h2>
Cluster Networking<o:p></o:p></h2>
<div align="left" class="MsoNormal" style="text-align: left;">
Traditional cluster
networking involved two discrete networks on each cluster node, a private
network for cluster communications and a public network for application
traffic. Since Windows 2008 there is no such thing as a dedicated cluster
network. Instead Windows now probes the networking state to determine the
optimal network connection to send heartbeat traffic over meaning that the
heartbeat traffic can go over any network adapter available to Windows.<o:p></o:p></div>
<div align="left" class="MsoNormal" style="text-align: left;">
The recommendation is to
eliminate single points of failure in the network by either providing multiple
redundant networks to the Windows Server or by providing a single network
connection with full redundancy built in.<o:p></o:p></div>
<div align="left" class="MsoNormal" style="text-align: left;">
From the Microsoft
documentation: <o:p></o:p></div>
<div class="MsoQuote">
In the network infrastructure that connects your cluster
nodes, avoid having single points of failure. There are multiple ways of
accomplishing this. You can connect your cluster nodes by multiple, distinct
networks. Alternatively, you can connect your cluster nodes with one network
that is constructed with teamed network adapters, redundant switches, redundant
routers, or similar hardware that removes single points of failure.<o:p></o:p></div>
<div align="left" class="MsoNormal" style="text-align: left;">
To maintain simplicity in
the environment the decision has been made to only use a single server network and
not implement a dedicated cluster network. As the cluster network makes use of
the same physical interface on the host and the same network fabric there is no
advantage in maintaining a dedicated cluster network.<o:p></o:p></div>
<div align="left" class="MsoNormal" style="text-align: left;">
<br /></div>
<h2>
Cluster Heartbeat<o:p></o:p></h2>
<div align="left" class="MsoNormal" style="text-align: left;">
For a Windows Server 2016
and above failover cluster no changes to heartbeat settings are recommended.
Server 2016 implemented default settings in-line with VMWare recommendations
supporting vMotion and DRS.<o:p></o:p></div>
<div align="left" class="MsoNormal" style="text-align: left;">
<br /></div>
<div style="mso-element: comment-list;">
<div style="mso-element: comment;">
<div class="msocomtxt" id="_com_3" language="JavaScript">
<!--[if !supportAnnotations]--></div>
<!--[endif]--></div>
</div>
<br />Willhttp://www.blogger.com/profile/01725430562728194875noreply@blogger.com0tag:blogger.com,1999:blog-1058098923431120944.post-52726515887985172862015-01-19T15:14:00.000+10:002015-01-19T15:14:03.391+10:00Encrypting Data In SQL Server<div data-mce-style="font-size: 13px;" style="border: 0px; color: #383838; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span style="font-family: inherit;"><span data-mce-style="font-family: 'courier new', courier, monospace;" face="Rod" style="line-height: 1.571428em;">This article covers the use of Transparent Database Encryption (TDE) in SQL Server. </span><span style="line-height: 1.571428em;">First we need to create a database master key. This is a symmetric key created at the database level and used to encrypt certificates within the database.</span></span></div>
<div data-mce-style="font-size: 13px;" style="border: 0px; color: #383838; font-family: gotham, helvetica, arial, sans-serif; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span style="font-family: 'courier new', courier, monospace; line-height: 1.571428em;"><a name='more'></a><br /></span></div>
<div data-mce-style="font-size: 13px;" style="border: 0px; color: #383838; font-family: gotham, helvetica, arial, sans-serif; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span style="font-size: x-small;"><span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; font-family: 'courier new', courier, monospace; line-height: 1.571428em;">IF</span><span style="font-family: 'courier new', courier, monospace; line-height: 1.571428em;"> </span><span color="#808080" data-mce-style="color: #808080;" style="color: grey; font-family: 'courier new', courier, monospace; line-height: 1.571428em;">NOT</span><span style="font-family: 'courier new', courier, monospace; line-height: 1.571428em;"> </span><span color="#808080" data-mce-style="color: #808080;" style="color: grey; font-family: 'courier new', courier, monospace; line-height: 1.571428em;">EXISTS</span></span></div>
<div data-mce-style="font-size: 13px;" style="border: 0px; line-height: 1.571428em; margin: 0px; padding: 0px;">
<div style="border: 0px; color: #383838; font-family: gotham, helvetica, arial, sans-serif; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span data-mce-style="font-family: 'courier new', courier, monospace;" face="Rod" style="font-family: 'courier new', courier, monospace; line-height: 1.571428em;"><span style="font-size: x-small;"><span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;"> </span> <span color="#808080" data-mce-style="color: #808080;" style="color: grey; line-height: 1.571428em;">(</span><span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;">SELECT</span> <span color="#808080" data-mce-style="color: #808080;" style="color: grey; line-height: 1.571428em;">*</span> <span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;">FROM</span> <span color="#008000" data-mce-style="color: #008000;" style="color: green; line-height: 1.571428em;">sys</span><span color="#808080" data-mce-style="color: #808080;" style="color: grey; line-height: 1.571428em;">.</span> <span color="#008000" data-mce-style="color: #008000;" style="color: green; line-height: 1.571428em;">symmetric_keys</span> <span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;">WHERE</span> <span color="#010101" data-mce-style="color: #010101;" style="color: #010101; line-height: 1.571428em;">symmetric_key_id</span> <span color="#808080" data-mce-style="color: #808080;" style="color: grey; line-height: 1.571428em;">=</span> <span color="#010101" data-mce-style="color: #010101;" style="color: #010101; line-height: 1.571428em;">101</span> <span color="#808080" data-mce-style="color: #808080;" style="color: grey; line-height: 1.571428em;">)</span></span></span></div>
<div style="border: 0px; color: #383838; font-family: gotham, helvetica, arial, sans-serif; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span data-mce-style="font-family: 'courier new', courier, monospace;" face="Rod" style="font-family: 'courier new', courier, monospace; line-height: 1.571428em;"><span style="font-size: x-small;"><span color="#010101" data-mce-style="color: #010101;" style="color: #010101; line-height: 1.571428em;"> </span> <span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;">CREATE</span> <span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;">MASTER</span> <span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;">KEY</span> <span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;">ENCRYPTION</span> <span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;">BY</span></span></span></div>
<div style="border: 0px; color: #383838; font-family: gotham, helvetica, arial, sans-serif; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span data-mce-style="font-family: 'courier new', courier, monospace;" face="Rod" style="font-family: 'courier new', courier, monospace; line-height: 1.571428em;"><span style="font-size: x-small;"><span color="#010101" data-mce-style="color: #010101;" style="color: #010101; line-height: 1.571428em;"> </span> <span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;">PASSWORD</span> <span color="#808080" data-mce-style="color: #808080;" style="color: grey; line-height: 1.571428em;">=</span> <span color="#FF0000" data-mce-style="color: #ff0000;" style="color: red; line-height: 1.571428em;">'Password1'</span></span></span></div>
<div style="border: 0px; color: #383838; font-family: gotham, helvetica, arial, sans-serif; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span color="#0000FF" data-mce-style="color: #0000ff; font-family: 'courier new', courier, monospace;" face="Rod" style="color: blue; font-family: 'courier new', courier, monospace; line-height: 1.571428em;"><span style="font-size: x-small;">GO</span></span></div>
<div style="border: 0px; color: #383838; font-family: gotham, helvetica, arial, sans-serif; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span color="#0000FF" data-mce-style="color: #0000ff; font-family: 'courier new', courier, monospace;" face="Rod" style="color: blue; font-family: 'courier new', courier, monospace; line-height: 1.571428em;"><br /></span></div>
<div style="border: 0px; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span color="#0000FF" data-mce-style="color: #0000ff; font-family: 'courier new', courier, monospace;" face="Rod" style="line-height: 1.571428em;"><span style="font-family: inherit;">Now create the certificate - by default the certificate will create a private key which is encrypted using the database master key.</span></span></div>
<div style="border: 0px; color: #383838; font-family: gotham, helvetica, arial, sans-serif; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span color="#0000FF" data-mce-style="color: #0000ff; font-family: 'courier new', courier, monospace;" face="Rod" style="color: blue; font-family: 'courier new', courier, monospace; line-height: 1.571428em;"><br /></span></div>
<div style="border: 0px; color: #383838; font-family: gotham, helvetica, arial, sans-serif; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span data-mce-style="font-family: 'courier new', courier, monospace;" face="Rod" style="font-family: 'courier new', courier, monospace; line-height: 1.571428em;"><span style="font-size: x-small;"><span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;">CREATE</span> <span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;">CERTIFICATE</span> <span color="#010101" data-mce-style="color: #010101;" style="color: #010101; line-height: 1.571428em;"><Certificate Name></span></span></span></div>
<div style="border: 0px; color: #383838; font-family: gotham, helvetica, arial, sans-serif; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span data-mce-style="font-family: 'courier new', courier, monospace;" face="Rod" style="font-family: 'courier new', courier, monospace; line-height: 1.571428em;"><span style="font-size: x-small;"><span color="#010101" data-mce-style="color: #010101;" style="color: #010101; line-height: 1.571428em;"> </span> <span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;">WITH</span> <span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;">SUBJECT</span> <span color="#808080" data-mce-style="color: #808080;" style="color: grey; line-height: 1.571428em;">=</span> <span color="#FF0000" data-mce-style="color: #ff0000;" style="color: red; line-height: 1.571428em;">'Certificate Description'</span><span color="#808080" data-mce-style="color: #808080;" style="color: grey; line-height: 1.571428em;">;</span></span></span></div>
<div style="border: 0px; color: #383838; font-family: gotham, helvetica, arial, sans-serif; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span color="#0000FF" data-mce-style="color: #0000ff; font-family: 'courier new', courier, monospace;" face="Rod" style="color: blue; font-family: 'courier new', courier, monospace; line-height: 1.571428em;"><span style="font-size: x-small;">GO</span></span></div>
<div style="border: 0px; color: #383838; font-family: gotham, helvetica, arial, sans-serif; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span color="#0000FF" data-mce-style="color: #0000ff; font-family: 'courier new', courier, monospace;" face="Rod" style="color: blue; font-family: 'courier new', courier, monospace; line-height: 1.571428em;"><br /></span></div>
<div style="border: 0px; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span color="#0000FF" data-mce-style="color: #0000ff; font-family: 'courier new', courier, monospace;" face="Rod" style="line-height: 1.571428em;"><span style="font-family: inherit;">Now create the symmetric key which will be used to encrypt data. This will be encrypted using the certificate created above.</span></span></div>
<div style="border: 0px; color: #383838; font-family: gotham, helvetica, arial, sans-serif; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span color="#0000FF" data-mce-style="color: #0000ff; font-family: 'courier new', courier, monospace;" face="Rod" style="color: blue; font-family: 'courier new', courier, monospace; line-height: 1.571428em;"><br /></span></div>
<div style="border: 0px; color: #383838; font-family: gotham, helvetica, arial, sans-serif; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span data-mce-style="font-family: 'courier new', courier, monospace;" face="Rod" style="font-family: 'courier new', courier, monospace; line-height: 1.571428em;"><span style="font-size: x-small;"><span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;">CREATE</span> <span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;">SYMMETRIC</span> <span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;">KEY</span> <span color="#010101" data-mce-style="color: #010101;" style="color: #010101; line-height: 1.571428em;"><Symmetric Key Name></span></span></span></div>
<div style="border: 0px; color: #383838; font-family: gotham, helvetica, arial, sans-serif; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span data-mce-style="font-family: 'courier new', courier, monospace;" face="Rod" style="font-family: 'courier new', courier, monospace; line-height: 1.571428em;"><span style="font-size: x-small;"><span color="#010101" data-mce-style="color: #010101;" style="color: #010101; line-height: 1.571428em;"> </span> <span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;">WITH</span> <span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;">ALGORITHM</span> <span color="#808080" data-mce-style="color: #808080;" style="color: grey; line-height: 1.571428em;">=</span> <span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;">AES_256</span></span></span></div>
<div style="border: 0px; color: #383838; font-family: gotham, helvetica, arial, sans-serif; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span data-mce-style="font-family: 'courier new', courier, monospace;" face="Rod" style="font-family: 'courier new', courier, monospace; line-height: 1.571428em;"><span style="font-size: x-small;"><span color="#010101" data-mce-style="color: #010101;" style="color: #010101; line-height: 1.571428em;"> </span> <span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;">ENCRYPTION</span> <span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;">BY</span> <span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;">CERTIFICATE</span> <span color="#010101" data-mce-style="color: #010101;" style="color: #010101; line-height: 1.571428em;"><Certificate Name></span><span color="#808080" data-mce-style="color: #808080;" style="color: grey; line-height: 1.571428em;">;</span></span></span></div>
<div style="border: 0px; color: #383838; font-family: gotham, helvetica, arial, sans-serif; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span color="#0000FF" data-mce-style="color: #0000ff; font-family: 'courier new', courier, monospace;" face="Rod" style="color: blue; font-family: 'courier new', courier, monospace; line-height: 1.571428em;"><span style="font-size: x-small;">GO</span></span></div>
</div>
<div data-mce-style="font-size: 13px;" style="border: 0px; color: #383838; font-family: gotham, helvetica, arial, sans-serif; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span data-mce-style="font-family: 'courier new', courier, monospace;" face="Rod" style="font-family: 'courier new', courier, monospace; line-height: 1.571428em;"><br /></span></div>
<div data-mce-style="font-size: 13px;" style="border: 0px; color: #383838; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span data-mce-style="font-family: 'courier new', courier, monospace;" face="Rod" style="line-height: 1.571428em;"><span style="font-family: inherit;">Once created users need to be assigned permissions to use the key. Minimum permissions are as follows:</span></span></div>
<div data-mce-style="font-size: 13px;" style="border: 0px; color: #383838; font-family: gotham, helvetica, arial, sans-serif; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span data-mce-style="font-family: 'courier new', courier, monospace;" face="Rod" style="font-family: 'courier new', courier, monospace; line-height: 1.571428em;"><br /></span></div>
<div data-mce-style="font-size: 13px;" style="border: 0px; color: #383838; font-family: gotham, helvetica, arial, sans-serif; line-height: 1.571428em; margin: 0px; padding: 0px;">
<div style="border: 0px; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span data-mce-style="font-family: 'courier new', courier, monospace;" face="Rod" style="font-family: 'courier new', courier, monospace; line-height: 1.571428em;"><span style="font-size: x-small;"><span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;">GRANT</span> <span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;">CONTROL</span> <span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;">ON</span> <span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;">CERTIFICATE</span> <span color="#808080" data-mce-style="color: #808080;" style="color: grey; line-height: 1.571428em;">::</span> <span color="#010101" data-mce-style="color: #010101;" style="color: #010101; line-height: 1.571428em;"><Certificate Name></span><span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;"> TO</span> <span color="#010101" data-mce-style="color: #010101;" style="color: #010101; line-height: 1.571428em;"><Principal></span></span></span></div>
<div style="border: 0px; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span data-mce-style="font-family: 'courier new', courier, monospace;" face="Rod" style="font-family: 'courier new', courier, monospace; line-height: 1.571428em;"><span style="font-size: x-small;"><span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;">GRANT</span> <span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;">VIEW</span> <span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;">DEFINITION</span> <span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;">ON</span> <span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;">SYMMETRIC</span> <span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;">KEY</span> <span color="#808080" data-mce-style="color: #808080;" style="color: grey; line-height: 1.571428em;">::</span> <span color="#010101" data-mce-style="color: #010101;" style="color: #010101; line-height: 1.571428em;"><Symmetric Key Name></span><span color="#0000FF" data-mce-style="color: #0000ff;" style="color: blue; line-height: 1.571428em;"> TO </span><span data-mce-style="color: #010101;" style="color: #010101; line-height: 1.571428em;"><Principal></span></span></span></div>
</div>
<div data-mce-style="font-size: 13px;" style="border: 0px; color: #383838; font-family: gotham, helvetica, arial, sans-serif; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span color="#010101" data-mce-style="color: #010101; font-family: 'courier new', courier, monospace;" face="Rod" style="color: #010101; font-family: 'courier new', courier, monospace; line-height: 1.571428em;"><br /></span></div>
<div data-mce-style="font-size: 13px;" style="border: 0px; line-height: 1.571428em; margin: 0px; padding: 0px;">
<div data-mce-style="font-size: 13px;" style="border: 0px; color: #383838; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span data-mce-style="color: #010101; font-family: 'courier new', courier, monospace;" style="color: #010101; line-height: 1.571428em;"><span style="font-family: inherit;">Now we can encrypt data by calling the <strong style="line-height: 1.571428em;">EncryptByKey</strong> function:</span></span></div>
<div data-mce-style="font-size: 13px;" style="border: 0px; color: #383838; font-family: gotham, helvetica, arial, sans-serif; font-size: 13px; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span data-mce-style="color: #010101; font-family: 'courier new', courier, monospace;" style="color: #010101; font-family: 'courier new', courier, monospace; line-height: 1.571428em;"><br data-mce-bogus="1" /></span></div>
<div data-mce-style="font-size: 13px;" style="border: 0px; color: #383838; font-size: 13px; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span data-mce-style="color: #010101; font-family: 'courier new', courier, monospace;" style="color: #010101; line-height: 1.571428em;"><span style="font-family: Courier New, Courier, monospace;"><span data-mce-style="color: #010101; font-family: 'courier new', courier, monospace;" style="line-height: 1.571428em;"></span></span></span><pre style="border: 0px; line-height: 1.571428em; padding: 0px;"><span style="font-family: Courier New, Courier, monospace;">-- Open the symmetric key with which to encrypt the data.
OPEN SYMMETRIC KEY <span style="line-height: 1.571428em;"><Symmetric Key Name></span>
DECRYPTION BY CERTIFICATE <span data-mce-style="color: #010101;" style="color: #010101; line-height: 1.571428em;"><Certificate Name></span><span data-mce-style="color: #808080;" style="color: grey; line-height: 1.571428em;">;</span>
-- Encrypt the value in column with symmetric key
UPDATE <table>
SET <Encrypted Column>
= EncryptByKey(Key_GUID(<Unencrypted Value>));</span></pre>
</div>
<div data-mce-style="font-size: 13px;" style="border: 0px; color: #383838; font-family: gotham, helvetica, arial, sans-serif; font-size: 13px; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span data-mce-style="color: #010101; font-family: 'courier new', courier, monospace;" style="color: #010101; font-family: 'courier new', courier, monospace; line-height: 1.571428em;"><br data-mce-bogus="1" /></span></div>
<div data-mce-style="font-size: 13px;" style="border: 0px; color: #383838; font-family: gotham, helvetica, arial, sans-serif; font-size: 13px; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span data-mce-style="color: #010101; font-family: 'courier new', courier, monospace;" style="color: #010101; font-family: 'courier new', courier, monospace; line-height: 1.571428em;"><br clear="none" /></span></div>
<div data-mce-style="font-size: 13px;" style="border: 0px; color: #383838; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span data-mce-style="color: #010101; font-family: 'courier new', courier, monospace;" style="color: #010101; line-height: 1.571428em;"><span style="font-family: inherit;">To decrypt the column we need to perform a similar process:</span></span></div>
<div data-mce-style="font-size: 13px;" style="border: 0px; color: #383838; font-family: gotham, helvetica, arial, sans-serif; font-size: 13px; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span data-mce-style="color: #010101; font-family: 'courier new', courier, monospace;" style="color: #010101; font-family: 'courier new', courier, monospace; line-height: 1.571428em;"><span data-mce-style="color: #010101; font-family: 'courier new', courier, monospace;" style="line-height: 1.571428em;"></span></span><pre style="border: 0px; font-family: Monaco, Courier, monospace; line-height: 1.571428em; padding: 0px;">-- Open the symmetric key with which to encrypt the data.
OPEN SYMMETRIC KEY <Symmetric Key Name>
DECRYPTION BY CERTIFICATE <span data-mce-style="color: #010101;" style="color: #010101; line-height: 1.571428em;"><Certificate Name></span><span data-mce-style="color: #808080;" style="color: grey; line-height: 1.571428em;">;
</span></pre>
</div>
<div data-mce-style="font-size: 13px;" style="border: 0px; color: #383838; font-family: gotham, helvetica, arial, sans-serif; font-size: 13px; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span data-mce-style="color: #010101; font-family: 'courier new', courier, monospace;" style="color: #010101; font-family: 'courier new', courier, monospace; line-height: 1.571428em;"><span data-mce-style="color: #010101; font-family: 'courier new', courier, monospace;" style="line-height: 1.571428em;"></span></span><pre style="border: 0px; font-family: Monaco, Courier, monospace; line-height: 1.571428em; padding: 0px;">SELECT <Unencrypted Column>,
<Encrypted Column> AS 'Encrypted ID Number',
CONVERT(nvarchar, DecryptByKey(<Encrypted Column>)) AS 'Decrypted Column
FROM <table>;</pre>
</div>
</div>
<div data-mce-style="font-size: 13px;" style="border: 0px; color: #383838; font-family: gotham, helvetica, arial, sans-serif; line-height: 1.571428em; margin: 0px; padding: 0px;">
<br /></div>
<div data-mce-style="font-size: 13px;" style="border: 0px; color: #383838; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span color="#010101" data-mce-style="color: #010101; font-family: 'courier new', courier, monospace;" face="Rod" style="color: #010101; line-height: 1.571428em;"><strong style="line-height: 1.571428em;"><span style="font-family: inherit;">Key Concerns</span></strong></span></div>
<div data-mce-style="font-size: 13px;" style="border: 0px; color: #383838; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span color="#010101" data-mce-style="color: #010101; font-family: 'courier new', courier, monospace;" face="Rod" style="color: #010101; line-height: 1.571428em;"><span style="font-family: inherit;">Database users need CONTROL permission on the certificate - this provides not only access to the certificate but also the ability to DROP and ALTER the certificate. The users shouldn't be able to drop the certificate however because there is a dependency with the symmetric key that is created. Having said that there are other metadata issues in SQL Server and I wouldn't like to rely on this.</span></span></div>
<div data-mce-style="font-size: 13px;" style="border: 0px; color: #383838; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span color="#010101" data-mce-style="color: #010101; font-family: 'courier new', courier, monospace;" face="Rod" style="color: #010101; line-height: 1.571428em;"><span style="font-family: inherit;"><br /></span></span></div>
<div data-mce-style="font-size: 13px;" style="border: 0px; color: #383838; line-height: 1.571428em; margin: 0px; padding: 0px;">
<span color="#010101" data-mce-style="color: #010101; font-family: 'courier new', courier, monospace;" face="Rod" style="color: #010101; line-height: 1.571428em;"><span style="font-family: inherit;">The consequence of dropping the certificate / symmetric key is that encrypted data cannot easily be recovered. Re-creating certificates and keys in the database with the same names will not allow data to be decrypted. To fix the encryption issues a backup of the database with a good copy of the key and certificate would need to be restored to the server. The key in this database could be used to decrypt the data in the original database. The encrypted data could then be re-written using regenerated certificate and key. This may take a long time to restore if there is a large amount of encrypted data to recover.</span></span></div>
Willhttp://www.blogger.com/profile/01725430562728194875noreply@blogger.com0tag:blogger.com,1999:blog-1058098923431120944.post-61263766297918844092014-12-26T08:52:00.000+10:002014-12-26T08:52:07.589+10:00Using The Command Line To Upgrade Windows Edition<div style="orphans: 2; text-align: -webkit-auto; widows: 2;">
<span style="font-family: inherit;">There may come a time when you need to upgrade the edition of Microsoft Windows you are using. Typically you need to do do this to access more memory, say greater than 32GB of Ram, or access advanced Enterprise features of the operating system. In the past you would need to do a full re-install of the operating system. Thankfully things have changed and it's now as easy as running an command to upgrade the edition of Windows.</span></div>
<div style="orphans: 2; text-align: -webkit-auto; widows: 2;">
<span style="font-family: inherit;"><br /></span></div>
<div style="orphans: 2; text-align: -webkit-auto; widows: 2;">
<a name='more'></a></div>
<div style="orphans: 2; text-align: -webkit-auto; widows: 2;">
<span style="font-family: inherit;"><br /></span></div>
<div style="orphans: 2; text-align: center; widows: 2;">
<span style="color: red; font-family: inherit;"><b><i>Note: All of the commands below need to be run from an administrative command prompt. </i></b></span></div>
<div style="orphans: 2; text-align: center; widows: 2;">
<span style="color: red; font-family: inherit;"><b><i>Note: After upgrading Microsoft Windows to a different edition you will need to re-activate Windows.</i></b></span></div>
<div style="orphans: 2; text-align: -webkit-auto; widows: 2;">
<span style="font-family: inherit;"><br /></span></div>
<div style="orphans: 2; text-align: -webkit-auto; widows: 2;">
<span style="font-family: inherit;">To confirm the edition of Microsoft Windows you are currently running use the following command:</span></div>
<div style="orphans: 2; text-align: -webkit-auto; widows: 2;">
<span style="font-family: Courier New, Courier, monospace;"><b>DISM /online /Get-CurrentEdition</b></span></div>
<div style="orphans: 2; text-align: -webkit-auto; widows: 2;">
<span style="font-family: inherit;"><br /></span></div>
<div style="orphans: 2; text-align: -webkit-auto; widows: 2;">
<span style="font-family: inherit;">This will return output similar to the following:</span></div>
<div style="orphans: 2; text-align: -webkit-auto; widows: 2;">
<span style="font-family: inherit;">Current Edition : ServerStandard</span></div>
<div style="orphans: 2; text-align: -webkit-auto; widows: 2;">
<span style="font-family: inherit;"><br /></span></div>
<div style="orphans: 2; text-align: -webkit-auto; widows: 2;">
<span style="font-family: inherit;">To determine what editions of Microsoft Windows you can upgrade to run the following command:</span></div>
<div style="orphans: 2; text-align: -webkit-auto; widows: 2;">
<b><span style="font-family: Courier New, Courier, monospace;">DISM /online /Get-TargetEditions</span></b></div>
<div style="orphans: 2; text-align: -webkit-auto; widows: 2;">
<span style="font-family: inherit;"><br /></span></div>
<div style="orphans: 2; text-align: -webkit-auto; widows: 2;">
<span style="font-family: inherit;">This will typically return multiple lines depending upon the number of editions available for upgrade. The results will be similar to the results shown below:</span></div>
<div style="orphans: 2; text-align: -webkit-auto; widows: 2;">
<span style="font-family: inherit;">Target Edition : ServerEnterprise</span></div>
<div style="orphans: 2; text-align: -webkit-auto; widows: 2;">
<span style="font-family: inherit;">Target Edition : ServerDataCenter</span></div>
<div style="orphans: 2; text-align: -webkit-auto; widows: 2;">
<span style="font-family: inherit;"><br /></span></div>
<div style="orphans: 2; text-align: -webkit-auto; widows: 2;">
<span style="font-family: inherit;">Now you can upgrade the edition using the command below. You need to enter the target edition from one of the target editions determined above. You will also need a valid product key for the edition you are upgrading to.</span></div>
<div style="orphans: 2; text-align: -webkit-auto; widows: 2;">
<span style="font-family: Courier New, Courier, monospace;"><b>DISM /online /Set-Edition:<Edition> /ProductKey:<XXXXX-XXXXX-XXXXX-XXXXX-XXXXX></b></span></div>
<div style="orphans: 2; text-align: -webkit-auto; widows: 2;">
<span style="font-family: inherit;"><br /></span></div>
<div style="orphans: 2; text-align: -webkit-auto; widows: 2;">
<span style="font-family: inherit;">Finally you will need to reboot Microsoft Windows for the changes to take affect. On restart boot screen Windows will continue with the upgrade process. This may take some time depending on your hardware.</span></div>
<div style="orphans: 2; text-align: -webkit-auto; widows: 2;">
<span style="font-family: inherit;"><br /></span></div>
<div style="orphans: 2; text-align: -webkit-auto; widows: 2;">
<span style="font-family: inherit;"><br /></span></div>
<div style="orphans: 2; text-align: -webkit-auto; widows: 2;">
<span style="font-family: inherit;"><br /></span></div>
Willhttp://www.blogger.com/profile/01725430562728194875noreply@blogger.com0tag:blogger.com,1999:blog-1058098923431120944.post-1753224150519428352014-10-23T08:12:00.001+10:002014-12-26T08:54:51.531+10:00Windows Server 2012 Deduplication - Powershell ReferenceSome key background points on deduplication on Windows Server 2012:<br />
<br />
<ul>
<li>There is a scheduler which runs one deduplication job / operation at any point in time</li>
<li>Powershell and windows commands add jobs to the scheduler queue - only one job may run at a given point in time</li>
<li>Types of deduplication operations:</li>
<ul>
<li>Optimization - deduplicates files on the filesystem. </li>
<li>Scrubbing - performs an integrity check of the deduplication store</li>
<li>GarbageCollection - files deleted from the filesystem do not automatically free up space on the disk. A garbage collection must be run to clean up the dedupe store</li>
</ul>
<li>You can configure the minimum age of files to deduplicate. Typically this should be set to a value greater than one day to ensure active files are not deduplicated.</li>
</ul>
<br />
<br />
Here are some handy powershell commands for managing deduplication on Windows Server 2012:<br />
<div class="gmail_default" style="font-family: arial, helvetica, sans-serif; font-size: small;">
<span style="color: blue;"><br /></span>
<span style="color: blue;"><br /></span></div>
<div style="font-size: 13px;">
<div class="gmail_default" style="font-size: small;">
<span style="color: blue; font-family: Courier New, Courier, monospace;"># Enqueue Full integrity check of the dedup store</span></div>
<div class="gmail_default">
<span style="color: blue; font-family: Courier New, Courier, monospace;">Start-DedupJob -Type Scrubbing -Full -Priority High -Volume D:</span></div>
<div class="gmail_default" style="font-size: small;">
<span style="color: blue; font-family: Courier New, Courier, monospace;"><br /></span></div>
<div class="gmail_default" style="font-size: small;">
<span style="color: blue; font-family: Courier New, Courier, monospace;"># Enqueue Garbage Collection of dedup store - deleted files won't reclaim space until GC is done</span></div>
<div class="gmail_default" style="font-size: small;">
<span style="color: blue; font-family: Courier New, Courier, monospace;">Start-DedupJob -Type GarbageCollection -Full -Priority High -Volume D:</span></div>
<div class="gmail_default" style="font-size: small;">
<span style="color: blue; font-family: Courier New, Courier, monospace;"><br /></span></div>
<div class="gmail_default" style="font-size: small;">
<span style="color: blue; font-family: Courier New, Courier, monospace;"># Get running / queued dedup jobs</span></div>
<div class="gmail_default" style="font-size: small;">
<span style="color: blue; font-family: Courier New, Courier, monospace;">get-dedupjob</span></div>
<div class="gmail_default" style="font-size: small;">
<span style="color: blue; font-family: Courier New, Courier, monospace;"><br /></span></div>
<div class="gmail_default" style="font-size: small;">
<span style="color: blue; font-family: Courier New, Courier, monospace;"># Get dedup summary status</span></div>
<div class="gmail_default">
<span style="color: blue; font-family: Courier New, Courier, monospace;">get-dedupstatus</span></div>
<div class="gmail_default">
<span style="color: blue; font-family: Courier New, Courier, monospace;"><br /></span></div>
<div class="gmail_default" style="font-size: small;">
<span style="color: blue; font-family: Courier New, Courier, monospace;"># Enqueue the optimization job</span></div>
</div>
<div class="gmail_default" style="font-size: small;">
<span style="color: blue; font-family: Courier New, Courier, monospace;">Start-DedupJob -Type Optimization -Full -Priority High -Volume D:</span><br />
<div style="font-family: arial, helvetica, sans-serif;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: arial, helvetica, sans-serif;">
<br /></div>
</div>
Willhttp://www.blogger.com/profile/01725430562728194875noreply@blogger.com0tag:blogger.com,1999:blog-1058098923431120944.post-29319899460308450682014-05-29T09:34:00.001+10:002014-05-29T09:34:34.580+10:00Renew A Windows Server Group Membership Without RebootingA Windows computer account will determine it's group membership when the computer is started. If the computer account is added to another group the group membership will not take affect automatically. This is painful in some situations such as modifying group policy based on group memberships. These settings will not take affect until the computer is restarted. To work around this you can perform the following steps:<br />
<br />
<a name='more'></a><br /><br />
<br /><i>Note - the following steps must be run from a command prompt with elevated privileges.</i><br />
<br />
First run the following command to purge the computers Kerberos tickets. This forces the computer account to re-authenticate with the domain controller and rebuild it's group memberships.<br />
<br />
<span style="font-family: "Courier New",Courier,monospace;">klist -lh 0 -li 0x3e7 purge</span><br />Now that the group memberships have been updated we can reapply Group Policy:<br /><span style="font-family: "Courier New",Courier,monospace;">gpupdate /force</span><br /><br />Finally check the results by running the Gpresult command. This will return the group memberships and policies applied to both the user and computer accounts.<br />
<br /><span style="font-family: "Courier New",Courier,monospace;">gpresult /r</span><br /><br />
<br />Willhttp://www.blogger.com/profile/01725430562728194875noreply@blogger.com0tag:blogger.com,1999:blog-1058098923431120944.post-36342737267380904992014-03-21T21:54:00.001+10:002014-03-21T21:56:19.908+10:00Setup SNMP On A Linux HostThis article will cover the basic setup of SNMP on a Linux host. Typically I enable this service to monitor the performance of a Linux host using Cacti.<br />
<br />
<a name='more'></a>First we install the SNMP daemon and SNMP tools:<br />
<div>
<span style="font-family: "Courier New",Courier,monospace;">sudo apt-get install snmp snmpd</span></div>
<div>
</div>
Next we take a backup of the default SNMP daemon configs:<br />
<div>
<span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: small;">sudo mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.old</span></span></div>
<br />
Then we create a new daemon config:<br />
<span style="font-family: "Courier New",Courier,monospace;">sudo nano /etc/snmp/snmpd.conf</span><br />
<br />
In the config file add the following information:<br />
<span style="font-family: "Courier New",Courier,monospace;">rocommunity public<br />syslocation "Data Center Location"<br />syscontact Sysadmin@email.com</span><br />
<br />
Next we update the daemon to use this snmpd.conf file:<br />
<span style="font-family: "Courier New",Courier,monospace;">sudo nano /etc/default/snmpd</span><br />
<br />
Replace the following line:<br />
<span style="font-family: "Courier New",Courier,monospace;">SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1'</span><br />
<br />
With:<br />
<span style="font-family: "Courier New",Courier,monospace;">#SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1'<br />SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid -c /etc/snmp/snmpd.conf'</span><br />
<br />
Now restart the SNMP daemon to reload the settings:<br />
<span style="font-family: "Courier New",Courier,monospace;">sudo service snmpd restart</span><br />
<br />
Basic SNMP V1 is now running. To test that SNMP is responding run the following command from the Linux host:<br />
<div>
<span style="font-size: small;"><span style="font-family: "Courier New",Courier,monospace;">snmpwalk -v 1 -c public localhost</span></span></div>
<div>
</div>
Willhttp://www.blogger.com/profile/01725430562728194875noreply@blogger.com0tag:blogger.com,1999:blog-1058098923431120944.post-30415930070190867442014-02-26T19:53:00.003+10:002014-02-26T19:54:41.720+10:00Deploying A SQL 2012 AlwaysOn ClusterThis document will cover the design and deployment of a SQL Server 2012 AlwaysOn cluster. SQL Server 2012 AlwaysOn clusters are a high availability technology. They build mirrored database instances across a Windows cluster. This provides the benefits of both technologies with clustering providing a single point of access and the mirroring providing redundant copies of the databases.<br />
<div>
<a name='more'></a><br /></div>
<div>
<br /></div>
<h2>
WINDOWS CLUSTER BUILD</h2>
SQL 2012 AlwaysOn clusters are built on top of standard Windows clusters. Refer to the document <a href="http://yetanothercomputingblog.blogspot.com.au/2014/02/building-windows-cluster-using-windows.html" target="_blank">Building A Windows Cluster Using Windows Server 2008 R2</a> to deploy Windows Clustering.<br />
<br />
<h2>
SQL SERVER INSTALLATIONS</h2>
Once the Windows cluster has been deployed SQL Server must be installed on each server node. Refer to the document DBA - SQL Server Standard Build to deploy the SQL Server Engine install. Note that the SQL Server Edition deployed must be Enterprise.<br />
<br />
<h2>
ENABLING ALWAYS ON</h2>
The following steps must be run on each cluster node:<br />
Open SQL Server Configuration Manager<br />
Select SQL Server Services<br />
Right click SQL Server (MSSQLSERVER) --> Properties<br />
On the AlwaysOn High Availabiliity tab ensure Enable AlwaysOn Availability Groups is checked. If not check the box and restart the SQL Server service.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvExDMVaFnlsaOTr3UWbWDg0L_9L87Z36sc8L07clUhB08zwRHXt23TknAQMAfnLH-elEgNeV8sTe58-ysRdRe0exbUrPO-Fsc6yvBB19shbLyvieWhZ-jr3q-XVSw8ZAmC9I5vR0Tkgg/s1600/2014-02-20+11_02_20-SQLUAT05A+on+REDSHEDPC12+-+Virtual+Machine+Connection.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvExDMVaFnlsaOTr3UWbWDg0L_9L87Z36sc8L07clUhB08zwRHXt23TknAQMAfnLH-elEgNeV8sTe58-ysRdRe0exbUrPO-Fsc6yvBB19shbLyvieWhZ-jr3q-XVSw8ZAmC9I5vR0Tkgg/s1600/2014-02-20+11_02_20-SQLUAT05A+on+REDSHEDPC12+-+Virtual+Machine+Connection.png" height="255" width="400" /></a></div>
<br />
<br />
<h2>
CREATING AN ALWAYSON ENDPOINT</h2>
An endpoint is required by the availability group to allow mirroring of databases between cluster nodes. Run the following on each server node to create the mirroring endpoints:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">use [master]</span><br />
<span style="font-family: Courier New, Courier, monospace;">CREATE ENDPOINT [Hadr_endpoint]</span><br />
<span style="font-family: Courier New, Courier, monospace;">STATE = STARTED</span><br />
<span style="font-family: Courier New, Courier, monospace;">AS TCP (LISTENER_PORT = 5022, LISTENER_IP = ALL)</span><br />
<span style="font-family: Courier New, Courier, monospace;">FOR DATA_MIRRORING (ROLE = ALL, AUTHENTICATION = WINDOWS NEGOTIATE, ENCRYPTION = REQUIRED ALGORITHM AES)</span><br />
<br />
<br />
<h2>
CREATING AN AVAILABILITY GROUP</h2>
Using SQL Server Management Studio connect to the first node in the cluster.<br />
Expand AlwaysOn High Availability<br />
Right click Availability Groups --> New Availability Group<br />
The databases can be added to the availability group at any point in time. It's generally easier to do this as a separate step.<br />
By default the Availability Replicas section at the bottom will only contain the primary database node - Add the secondary nodes manually.<br />
Availability Mode is set to Synchronous for all servers in the same primary site and Asynchronous for those servers in another data centre<br />
We always set Failover Mode to Manual. Ie. We want to control the failover<br />
Both nodes should have Readable Secondary set to Yes. This will allow read only connections to the secondary database for reporting purposes.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSpYJpb4uAtXgJ3nlfSGm5WjxHY0gKeRf18O4KWQ-491Pz68CS4q2cT_5Z4LrOCK7o6EMmppsIcNraC3OMHvKb1DEn0UMw79cJQdEINrbJyPfPslFZ9NUaZfB04gLX8daBj6D7eBQigp4/s1600/2014-02-20+11_32_13-SQLUAT05A+on+REDSHEDPC12+-+Virtual+Machine+Connection.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSpYJpb4uAtXgJ3nlfSGm5WjxHY0gKeRf18O4KWQ-491Pz68CS4q2cT_5Z4LrOCK7o6EMmppsIcNraC3OMHvKb1DEn0UMw79cJQdEINrbJyPfPslFZ9NUaZfB04gLX8daBj6D7eBQigp4/s1600/2014-02-20+11_32_13-SQLUAT05A+on+REDSHEDPC12+-+Virtual+Machine+Connection.png" height="282" width="400" /></a></div>
<br />
<br />
The availability group has now been created however the secondary node hasn't properly joined the cluster. As shown below there is a red down arrow on the secondary node and the availability group doesn't appear on the secondary node.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEil6rjIiaJ6qUnKImXzfDdhNOAstz_8cmqdhw57BB0lAbR6PyRJiXNL4e52BLpOt7l0b0JE9z_7sYa9f0eCbAKzg2krZurTycEf2TEtUDy8FyQAQiu1cNKLNVlSdYLjWIxCdxEEEW0yT6M/s1600/2014-02-20+11_34_09-SQLUAT05A+on+REDSHEDPC12+-+Virtual+Machine+Connection.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEil6rjIiaJ6qUnKImXzfDdhNOAstz_8cmqdhw57BB0lAbR6PyRJiXNL4e52BLpOt7l0b0JE9z_7sYa9f0eCbAKzg2krZurTycEf2TEtUDy8FyQAQiu1cNKLNVlSdYLjWIxCdxEEEW0yT6M/s1600/2014-02-20+11_34_09-SQLUAT05A+on+REDSHEDPC12+-+Virtual+Machine+Connection.png" height="400" width="315" /></a></div>
<br />
<br />
Right click on the secondary node and select Join to Availability Group. Follow the prompts to add the secondary node to the availability group.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfLg5XojiEPOEr8d5DFbYLIkjzWKwSa7DQd_Cho2B6Lz6oZxVBbUIwWVX9j0K6YDX7n0H0raIdq0RLKfoxwbkO_WIMDwP1PNGxxqCMJHJcVLM_0b1bRxdcJmxWouGmf0-Vj26ZL8LJHck/s1600/2014-02-20+11_34_22-SQLUAT05A+on+REDSHEDPC12+-+Virtual+Machine+Connection.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfLg5XojiEPOEr8d5DFbYLIkjzWKwSa7DQd_Cho2B6Lz6oZxVBbUIwWVX9j0K6YDX7n0H0raIdq0RLKfoxwbkO_WIMDwP1PNGxxqCMJHJcVLM_0b1bRxdcJmxWouGmf0-Vj26ZL8LJHck/s1600/2014-02-20+11_34_22-SQLUAT05A+on+REDSHEDPC12+-+Virtual+Machine+Connection.png" height="400" width="393" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<br />
<h2>
CREATING AN AVAILABILITY GROUP LISTENER</h2>
The availability group listener is used to route connections to the SQL Server cluster nodes. Standard connections are routed to the active primary replica whilst read-only connections are routed to the secondary replica. The availability group listener updates the routing based on availability group failover and provides a single point for database connections to occur.<br />
<br />
Expand the availability group and right click on Availability Group Lister --> Add Listener<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAaPbNWL9MBoOqi7lNcE9AaWkbu9kJaQCcLsqo_SnfuCwMs4r8Q54vb3mFJhurEP6qvNvVVkzBxmICnuMWCvT_lMrbo8Q9S8ca6l0hsQSFtBUH1MFN1KYJO_ZdQjOAMLKdczDxc25FlZo/s1600/2014-02-20+11_38_38-SQLUAT05A+on+REDSHEDPC12+-+Virtual+Machine+Connection.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAaPbNWL9MBoOqi7lNcE9AaWkbu9kJaQCcLsqo_SnfuCwMs4r8Q54vb3mFJhurEP6qvNvVVkzBxmICnuMWCvT_lMrbo8Q9S8ca6l0hsQSFtBUH1MFN1KYJO_ZdQjOAMLKdczDxc25FlZo/s1600/2014-02-20+11_38_38-SQLUAT05A+on+REDSHEDPC12+-+Virtual+Machine+Connection.png" height="400" width="388" /></a></div>
<br />
<br />
Configure the availability group listener as shown below. Setup the listener name, port, and IP address as per organizational standards. Note - The IP address must be unique - an IP cannot be reused even if another port number has been chosen.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHaUdDAuy4A5_cZr8-jb5nArgIhZc__YRJstsVvOnBHt7jo0Wda8u4H_u0mJywzY0pu7L24A010HMfDZYgUyQfshcOUIQszhwAsAuGgc2pogIHWRhEzjX9bHSKvW_WAHE97q8W-bfoYt8/s1600/2014-02-20+11_40_40-SQLUAT05A+on+REDSHEDPC12+-+Virtual+Machine+Connection.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHaUdDAuy4A5_cZr8-jb5nArgIhZc__YRJstsVvOnBHt7jo0Wda8u4H_u0mJywzY0pu7L24A010HMfDZYgUyQfshcOUIQszhwAsAuGgc2pogIHWRhEzjX9bHSKvW_WAHE97q8W-bfoYt8/s1600/2014-02-20+11_40_40-SQLUAT05A+on+REDSHEDPC12+-+Virtual+Machine+Connection.png" height="358" width="400" /></a></div>
<br />
<br />
<h2>
ADDING DATABASES TO AN AVAILABILITY GROUP</h2>
Expand the availability group. Right click on Availability Databases --> Add Database<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJALdvn9QaFnMLPI7cC5g-aGtra95N0zaSjQB1PHq6-1QstV0zejWPWNxmhWey2zqOtO4tXN6TkuumieB9VdM0l_tjj3XMnayWmL9I1jBuy7tUaetkVeok47o7zdo4CJDwTnbYrCNArVo/s1600/2014-02-20+11_53_31-SQLUAT05A+on+REDSHEDPC12+-+Virtual+Machine+Connection.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJALdvn9QaFnMLPI7cC5g-aGtra95N0zaSjQB1PHq6-1QstV0zejWPWNxmhWey2zqOtO4tXN6TkuumieB9VdM0l_tjj3XMnayWmL9I1jBuy7tUaetkVeok47o7zdo4CJDwTnbYrCNArVo/s1600/2014-02-20+11_53_31-SQLUAT05A+on+REDSHEDPC12+-+Virtual+Machine+Connection.png" height="400" width="287" /></a></div>
<br />
<br />
Select the databases to add to the availability group. Only databases that meet prerequisites (Full recovery, full backup taken, and not part of an availability group) can be added.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEscTV8aV5CUcfyeetAMjLPkRSulfHIabr4Pf4lcd_sxeX9KDRVQRtTFXiN5g1ui-_s3qrNk5Q7MmygHg1-19nlhfkr2AxG4hm3YqTiA0noCjHs7qfn47N0tYqoyyRYk1SI2iOMR34AlY/s1600/2014-02-20+11_55_02-SQLUAT05A+on+REDSHEDPC12+-+Virtual+Machine+Connection.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEscTV8aV5CUcfyeetAMjLPkRSulfHIabr4Pf4lcd_sxeX9KDRVQRtTFXiN5g1ui-_s3qrNk5Q7MmygHg1-19nlhfkr2AxG4hm3YqTiA0noCjHs7qfn47N0tYqoyyRYk1SI2iOMR34AlY/s1600/2014-02-20+11_55_02-SQLUAT05A+on+REDSHEDPC12+-+Virtual+Machine+Connection.png" height="370" width="400" /></a></div>
<br />
<br />
Add in a networked file share that is accessible by all nodes in the SQL Always On cluster.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmIH1x_FMyu3zaj41fnZyVV2neu_WY-o7woatxCCcN0CZR4ps0c879rUGhh6qEo6AuMGyQ8Ye3jZgMSspWNYWiSZ7pKbXZri9U9XceQeYXXfgFNz0Dx4O4bhjQ3M0Q-mq2vn2d5pULJpw/s1600/2014-02-20+11_55_37-SQLUAT05A+on+REDSHEDPC12+-+Virtual+Machine+Connection.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmIH1x_FMyu3zaj41fnZyVV2neu_WY-o7woatxCCcN0CZR4ps0c879rUGhh6qEo6AuMGyQ8Ye3jZgMSspWNYWiSZ7pKbXZri9U9XceQeYXXfgFNz0Dx4O4bhjQ3M0Q-mq2vn2d5pULJpw/s1600/2014-02-20+11_55_37-SQLUAT05A+on+REDSHEDPC12+-+Virtual+Machine+Connection.png" height="366" width="400" /></a></div>
<br />
<br />
Follow the prompts to finish adding the database. Once complete the Availability Databases should look like the screenshot below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWKgANBd88h1SBCVsnZF-OA1oYc6k6N6HsDzrilCWfBBBg7oE920J7tOdijY4LDpcPDXkGiXeA7DWKWO4LtAUtER9yt8g_SChAgHdtKaWU8wLtnbGqu_scXCnminXKgwy8tuKTrfoukaw/s1600/2014-02-20+12_05_30-SQLUAT05A+on+REDSHEDPC12+-+Virtual+Machine+Connection.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWKgANBd88h1SBCVsnZF-OA1oYc6k6N6HsDzrilCWfBBBg7oE920J7tOdijY4LDpcPDXkGiXeA7DWKWO4LtAUtER9yt8g_SChAgHdtKaWU8wLtnbGqu_scXCnminXKgwy8tuKTrfoukaw/s1600/2014-02-20+12_05_30-SQLUAT05A+on+REDSHEDPC12+-+Virtual+Machine+Connection.png" height="400" width="240" /></a></div>
<br />
<h2>
TESTING AVAILABILITY GROUP FAILOVER</h2>
Under Availability Replicas check which nodes hold the primary and secondary roles.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQPKeMCIHufu2nAE-TnB90PxKzLlQ6hTxbfrSnYwpxEbhYoQVlpDmLVk65dQbltvZ6WTHKpr_cv1kAxMQ-mNm44LmZMHSySTkGHM2MBwq0rPicvjozOrAs6I6piZfh6X_ciqVR-xvM8xA/s1600/2014-02-20+13_06_11-SQLUAT05A+on+REDSHEDPC12+-+Virtual+Machine+Connection.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQPKeMCIHufu2nAE-TnB90PxKzLlQ6hTxbfrSnYwpxEbhYoQVlpDmLVk65dQbltvZ6WTHKpr_cv1kAxMQ-mNm44LmZMHSySTkGHM2MBwq0rPicvjozOrAs6I6piZfh6X_ciqVR-xvM8xA/s1600/2014-02-20+13_06_11-SQLUAT05A+on+REDSHEDPC12+-+Virtual+Machine+Connection.png" height="213" width="400" /></a></div>
<br />
<br />
Right click on the availability group and select Failover<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgetflx91CUlR4MsuSk4-U4nH8tKrQHP-5qxqAWYjfFw29ARzV3fxahZWKmAxvPSUL01xpmn141dTIk3Fc5wGdjz5LO0IP-_aegpMe2IdmV_nYqlOC_pnJytRa6jWNAn49dQR0J8m3wkoA/s1600/2014-02-20+13_06_26-SQLUAT05A+on+REDSHEDPC12+-+Virtual+Machine+Connection.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgetflx91CUlR4MsuSk4-U4nH8tKrQHP-5qxqAWYjfFw29ARzV3fxahZWKmAxvPSUL01xpmn141dTIk3Fc5wGdjz5LO0IP-_aegpMe2IdmV_nYqlOC_pnJytRa6jWNAn49dQR0J8m3wkoA/s1600/2014-02-20+13_06_26-SQLUAT05A+on+REDSHEDPC12+-+Virtual+Machine+Connection.png" height="356" width="400" /></a></div>
<br />
<br />
Select the node to fail over to and follow the prompts.<br />
<br />
<br />
Check that the secondary replica is now the primary replica.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwZSOLI9aHnw168BDNc-JcNYBoMScwBZ7rsA9ioK1ZemEjZVfIuzyZLUFXYyp-Z8PJ4g9fPEI26jrzw1USaFsMDZx8eLTtwwjLEo7wpDMJwT1HKnZwzstkFOlmxCCYI8Wh3kf6z3QUZNw/s1600/2014-02-20+13_07_46-SQLUAT05A+on+REDSHEDPC12+-+Virtual+Machine+Connection.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwZSOLI9aHnw168BDNc-JcNYBoMScwBZ7rsA9ioK1ZemEjZVfIuzyZLUFXYyp-Z8PJ4g9fPEI26jrzw1USaFsMDZx8eLTtwwjLEo7wpDMJwT1HKnZwzstkFOlmxCCYI8Wh3kf6z3QUZNw/s1600/2014-02-20+13_07_46-SQLUAT05A+on+REDSHEDPC12+-+Virtual+Machine+Connection.png" height="122" width="400" /></a></div>
<br />
<br />
Also check the databases on the new primary replica. They should be in a Synchronized state (as opposed to Synchronizing on the secondary)<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1V6w2RC8PIA93kpcCkHIttSeeBQ4VR7dUUZ-qcuHGTL-_5unCou-8sf_s-HOfYnnk_-7nZMTyS70U6kmrBbYrb5J-IWJGg4UztCa2VRIS3DVJF_te7XBKEMGkzVH70To_r6g0zorpAG4/s1600/2014-02-20+13_11_06-SQLUAT05B+on+REDSHEDPC12+-+Virtual+Machine+Connection.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1V6w2RC8PIA93kpcCkHIttSeeBQ4VR7dUUZ-qcuHGTL-_5unCou-8sf_s-HOfYnnk_-7nZMTyS70U6kmrBbYrb5J-IWJGg4UztCa2VRIS3DVJF_te7XBKEMGkzVH70To_r6g0zorpAG4/s1600/2014-02-20+13_11_06-SQLUAT05B+on+REDSHEDPC12+-+Virtual+Machine+Connection.png" height="195" width="400" /></a></div>
<br />
<br />
As a final check, review the SQL Server error logs on each node. There may be detailed errors in the log that do not show up elsewhere.<br />
<br />
<h2>
TROUBLESHOOTING</h2>
<h3>
ENDPOINT PERMISSIONS</h3>
The computer account for each node in the cluster requires permissions to the HA database mirroring endpoints on every other node in the HA cluster. When these permissions are missing the following error will be displayed in the SQL error logs:<br />
Database Mirroring login attempt by user '<Computer Account>' failed with error: 'Connection handshake failed. The login '<Computer Account>' does not have CONNECT permission on the endpoint. State 84.<br />
To resolve this first create the SQL login for the computer account. This account requires no permissions other than those given by the following script:<br />
Grant CONNECT ON ENDPOINT::HaDR_Endpoint to <Computer Account>Willhttp://www.blogger.com/profile/01725430562728194875noreply@blogger.com0tag:blogger.com,1999:blog-1058098923431120944.post-64820551764379842692014-02-21T06:05:00.001+10:002014-02-22T15:43:00.180+10:00Building A Windows Cluster Using Windows Server 2008 R2Building a windows cluster is the first stage in deploying a high availability SQL Server 2012 Always On cluster. This document covers the design, installation, and configuration of a Windows Cluster on which a SQL Server 2012 HA Cluster can be deployed.<br />
<a name='more'></a><h2>
NETWORKING</h2>
The network design is crucial in the design and implementation of a cluster. A cluster relies heavily on advanced networking features to route traffic hitting a Virtual Network Name (VNN) with it's corresponding IP address to the correct node in the cluster. Another management layer of networking enables the cluster nodes to conduct a voting process which enables the cluster nodes as a group to decide which nodes are healthy and which node is the active primary. An misconfiguration in the networking can cause cluster instability and outages. <br />
<br />
<h3>
VLANS / CLIENT NETWORKING ZONES</h3>
For more information on networking refer to the DBA - GRID Networking Document. <br />
<br />
<h4>
SINGLE SITE</h4>
A cluster that is located completely within a single site / data centre requires two VLANs, one for internal cluster communications and one for general application connectivity. <br />
<h4>
INTERNAL CLUSTER COMMUNICATIONS</h4>
This is a private, non-routable network used exclusively by the nodes within the cluster. Cluster node heartbeat and the quorum voting process between nodes happen on this network. <br />
<h4>
PUBLIC NETWORK (APPLICATIONS)</h4>
The public network is used by applications on the cluster to provide services. Client applications will connect to the cluster over this network. This network is fully routable in the same manner as a standard server connection. <br />
<br />
<h4>
MULTI SITE</h4>
A cluster that spans multiple sites / data centres requires four VLANS. The two VLANs described above are duplicated at each site. Networking and routing needs to be setup to allow communications between the client networking zones at each site. Eg. The cluster network at site A requires connectivity with the cluster network at site B. <br />
<h4>
INTERNAL CLUSTER COMMUNICATIONS</h4>
As stated above the internal cluster network at site A requires routing to the internal cluster network at site B. Connectivity between the two sites must allow traffic on the port TCP_3343. <br />
<h4>
PUBLIC NETWORK (APPLICATIONS)</h4>
The public networks must route traffic between site A and site B. The ports that are required depend on the application. <br />
<br />
<h3>
NETWORK DESIGN</h3>
Before building a cluster the networking requirements should be fully mapped out. The IPs assigned should map in a logical fashion across the networks. For each node in the cluster the following networking requirements need to be identified: <table border="0" cellpadding="0"> <tbody>
<tr> <td width="125"><b></b></td> <td width="529"><b></b></td> <td><b>Example</b></td></tr>
<tr> <td width="125">SITE</td> <td width="529">Which site will the cluster node reside?</td> <td></td></tr>
<tr> <td width="125">PUBLIC IP</td> <td width="529">What will be the public IP address of this node?</td> <td>192.168.100.10</td></tr>
<tr> <td width="125">CLUSTER IP</td> <td width="529">What will be the cluster internal IP address of this node? <br />
Also note - the IP address should match between networks. Eg. .10 should refer to the same cluster node in both subnets.<br />
</td> <td>192.168.0.10</td></tr>
</tbody></table>
<br />
The cluster will also require a virtual IP in each subnet. Ie a single site cluster will require one IP, a two site cluster will require two IPs. Again these should be logically assigned so they map across network zones. <br />
<br />
<h2>
STANDARD FIREWALL RULES</h2>
Inter public site <br />
Public communications <br />
Inter private cluster comms <br />
Quorum file server comms <br />
<br />
<h2>
QUORUMS</h2>
<h3>
IS A QUORUM FILE SHARE WITNESS REQUIRED?</h3>
A quorum file share witness is required whenever there are an even number of nodes in the cluster. The quorum file share witness is used in the voting process to break any deadlocks that may occur when there are an even number of nodes in a cluster. If there are an odd number of nodes in the cluster the quorum file share witness should not be configured. <br />
<br />
<h3>
CREATING A QUORUM FILE SHARE</h3>
The quorum file server is configured with a folder called E:\FileShares. Create a folder under this with the name of the cluster. Share this folder out with default permissions. Make sure to change the share permissions so that <strong>Everyone</strong> has read / write access. <br />
<br />
<h2>
SERVER BUILDS</h2>
<h3>
NETWORK CONFIGURATION</h3>
Each node in the cluster has two network interfaces - an interface for cluster communications (CLUSTER) and another for general server traffic (PUBLIC - eg. SQL, SMB, RDP). Each of these interfaces is on a separate subnet. In particular the cluster communications is segregated on it's own subnet so that the cluster heartbeat does not get interrupted by general network traffic. <br />
<br />
<h3>
RENAMING THE NICS</h3>
As shown below we rename the network connections on each cluster node. This makes network identification and cluster troubleshooting much easier. Open the <strong>Network Connections</strong> page in <strong>Control Panel</strong>. Select each network interface and press <strong>F2</strong> to rename the connection. <br />
<a href="http://lh6.ggpht.com/-j9V3Y9gJymc/UwaQN4RMWPI/AAAAAAAALyA/RADjPgmhCvY/s1600-h/clip_image002%25255B3%25255D.jpg"><img alt="clip_image002" border="0" src="http://lh4.ggpht.com/-gHc5igPYOzA/UwaQOu-77SI/AAAAAAAALyI/Mo4SuNTz9HA/clip_image002_thumb.jpg?imgmax=800" height="101" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="clip_image002" width="244" /></a> <br />
<br />
<h3>
NIC ADAPTER ORDER</h3>
It's also important to set the NIC adapter order in the network settings. We want the public interface to be used for communications first. If the cluster interface is first then the server will try and use the cluster network for communications first. This will cause general network problems as the cluster network is a private network without access to general network resources and the internet. <br />
The screen to configure the NIC Adapter order can be found by navigating to the <strong>Network Connections</strong> page in <strong>Control Panel</strong>. Press the <strong>Alt</strong> key to bring the window menu up --> <strong>Advanced Settings</strong>. <br />
<a href="http://lh6.ggpht.com/-QBN9iTXwqU4/UwaQPlshI1I/AAAAAAAALyQ/SWOq26T3_jo/s1600-h/clip_image004%25255B3%25255D.jpg"><img alt="clip_image004" border="0" src="http://lh6.ggpht.com/-6gNiAACbpiE/UwaQQWICYQI/AAAAAAAALyY/_HA5cBzfqvg/clip_image004_thumb.jpg?imgmax=800" height="244" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="clip_image004" width="198" /></a> <br />
<br />
<h3>
WINDOWS IP SETTINGS</h3>
The CLUSTER network settings should be setup similar to below. Note - no DNS servers should be set. This is a private network, no DNS traffic will be sent out over the cluster network and in any event, DNS traffic cannot be routed to a DNS server. <br />
<a href="http://lh6.ggpht.com/-GzKfclezvqU/UwaQQ3pYq-I/AAAAAAAALyg/KoeqNeQHa5A/s1600-h/clip_image006%25255B3%25255D.jpg"><img alt="clip_image006" border="0" src="http://lh6.ggpht.com/-B0S0WbYL-1U/UwaQRzS0wYI/AAAAAAAALyo/3DzCzj_tqNc/clip_image006_thumb.jpg?imgmax=800" height="244" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="clip_image006" width="222" /></a> <br />
<br />
The PUBLIC network settings should be as per normal server build. <br />
<a href="http://lh3.ggpht.com/-qf7_AqGBab4/UwaQSt6aoWI/AAAAAAAALyw/OYmjYC8kkh0/s1600-h/clip_image008%25255B3%25255D.jpg"><img alt="clip_image008" border="0" src="http://lh6.ggpht.com/-qnoai_r3lz4/UwaQTYciodI/AAAAAAAALy4/a6o5Idyu0hQ/clip_image008_thumb.jpg?imgmax=800" height="244" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="clip_image008" width="219" /></a> <br />
<br />
<br />
<h2>
PREPARING THE SERVER</h2>
<h3>
UPGRADING WINDOWS SERVER STANDARD EDITION TO ENTERPRISE</h3>
Clustering is a Windows Enterprise feature. If Windows Standard template has been deployed the Windows edition will require an upgrade. Run the following command from and elevated command prompt to upgrade the Windows edition: <br />
DISM /online /Set-Edition:ServerEnterprise /ProductKey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX <br />
After running this command Windows requires a reboot. This reboot will take a while as there is reconfiguration on both shutdown and restart. <br />
<br />
<h2>
SETUP THE FAILOVER CLUSTER</h2>
<h3>
SETUP FAILOVER CLUSTERING</h3>
The Failover Clustering feature needs to be added to each node in the cluster. Accept the defaults to enable the feature. <br />
<a href="http://lh3.ggpht.com/-gNR0hN0vTvs/UwaQUBN8KRI/AAAAAAAALzA/EuY6kTFbjLw/s1600-h/clip_image010%25255B3%25255D.jpg"><img alt="clip_image010" border="0" src="http://lh6.ggpht.com/-7XuyJ_A8Tx8/UwaQU3g8fCI/AAAAAAAALzE/b5DKKnM2wX8/clip_image010_thumb.jpg?imgmax=800" height="174" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="clip_image010" width="244" /></a> <br />
<br />
<h3>
CREATING THE CLUSTER</h3>
Expand Features on the primary node. <br />
Right click on <strong>Failover Cluster Manager</strong> and select <strong>Create a Cluster</strong> <br />
<a href="http://lh5.ggpht.com/-jue3jp4qgdk/UwaQVt6UCCI/AAAAAAAALzQ/29fXnSBGaco/s1600-h/clip_image012%25255B3%25255D.jpg"><img alt="clip_image012" border="0" src="http://lh4.ggpht.com/-rJImuEtU0_U/UwaQWh2zvMI/AAAAAAAALzY/ZS-LfPhK9KI/clip_image012_thumb.jpg?imgmax=800" height="204" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="clip_image012" width="244" /></a> <br />
<br />
Add each server node in the following screen: <br />
<a href="http://lh3.ggpht.com/-xmhM49opAkQ/UwaQXaFfZBI/AAAAAAAALzg/tBHgDfBc2B4/s1600-h/clip_image014%25255B3%25255D.jpg"><img alt="clip_image014" border="0" src="http://lh4.ggpht.com/-JYUV-TnIFuQ/UwaQYPZNj4I/AAAAAAAALzo/qBfhe5QfmEw/clip_image014_thumb.jpg?imgmax=800" height="164" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="clip_image014" width="244" /></a> <br />
<br />
Run the validation tests. Select the defaults and run all tests. <br />
<em>The validation tests make sure that the server node hardware and software are valid for the configuration. Any entries that fail should be fixed before continuing with the cluster creation. There will be some warnings and this is typically OK as we are not using SAN visible to the node or shared disks.</em> <br />
<a href="http://lh5.ggpht.com/-dQ5ooZdJ5NI/UwaQY4IrKLI/AAAAAAAALzw/uu6tXs-Nia8/s1600-h/clip_image016%25255B3%25255D.jpg"><img alt="clip_image016" border="0" src="http://lh3.ggpht.com/-JgX3ztFZRuA/UwaQZ-59B9I/AAAAAAAALz4/j7sTyCYci6w/clip_image016_thumb.jpg?imgmax=800" height="163" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="clip_image016" width="244" /></a> <br />
<br />
Setup the cluster name in the next screen. Disable the CLUSTER network as we will be managing the cluster via the PUBLIC network. Also assign the clustered IP address <br />
<a href="http://lh5.ggpht.com/-Zgm_pOZ9vco/UwaQarncrPI/AAAAAAAAL0A/BAsza4Yj9o8/s1600-h/clip_image018%25255B3%25255D.jpg"><img alt="clip_image018" border="0" src="http://lh6.ggpht.com/-JLwM2Zg5ln8/UwaQbcjKv9I/AAAAAAAAL0I/SiObZ_hRa6s/clip_image018_thumb.jpg?imgmax=800" height="163" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="clip_image018" width="244" /></a> <br />
<br />
Keep following the prompts to finish the cluster build. <br />
<br />
<h3>
UPDATE CLUSTER NETWORKING</h3>
Re-name each cluster network to accurately reflect the VLAN topology as shown below. In this particular case there will only be two Networks in Failover Cluster Manager: SQL-UAT (PUBLIC) and CLUSTER. <br />
<a href="http://lh6.ggpht.com/-tJdSHw6RVOY/UwaQcAgXuEI/AAAAAAAAL0Q/3rRHYwqTXVg/s1600-h/clip_image020%25255B3%25255D.jpg"><img alt="clip_image020" border="0" src="http://lh3.ggpht.com/-1TyKmJORusc/UwaQc0aRw3I/AAAAAAAAL0Y/7H0KpENzRFY/clip_image020_thumb.jpg?imgmax=800" height="244" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="clip_image020" width="160" /></a> <br />
<br />
Update the CLUSTER networks and uncheck the box "<strong>Allow clients to connect through this network</strong>". This will reserve the network for cluster communications (eg. Cluster heartbeat). <br />
<a href="http://lh5.ggpht.com/-AhRV9CrNNeg/UwaQdjzwXeI/AAAAAAAAL0g/JQXzhczw5Ac/s1600-h/clip_image022%25255B3%25255D.jpg"><img alt="clip_image022" border="0" src="http://lh4.ggpht.com/--3we_I3T8_U/UwaQeas4kiI/AAAAAAAAL0o/48cr_tHL9NU/clip_image022_thumb.jpg?imgmax=800" height="244" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="clip_image022" width="206" /></a> <br />
<br />
The PUBLIC cluster networks should be setup so that the cluster does not use these networks for cluster communications as shown below: <br />
<a href="http://lh5.ggpht.com/-51IU0lpEblk/UwaQfWZJVZI/AAAAAAAAL0w/DOgny9odjlc/s1600-h/clip_image024%25255B3%25255D.jpg"><img alt="clip_image024" border="0" src="http://lh6.ggpht.com/-4R9bu_R8Kqg/UwaQgDzfyAI/AAAAAAAAL04/9qxqutEO5KQ/clip_image024_thumb.jpg?imgmax=800" height="244" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="clip_image024" width="204" /></a> <br />
<br />
<br />
<h3>
ADDING THE QUORUM FILE SHARE WITNESS</h3>
<strong><i>Note - this step is only required for clusters with an even number of server nodes. if there are an odd number of server nodes skip this.</i></strong> <br />
Clusters much reach a quorum on which server is the primary node of the cluster. Clusters do this by requiring each node to vote on which node is the active node - the node with the majority of the votes is the active node. When there are an even number of nodes in a cluster a quorum file share can be used as a witness and provide an additional vote, thus breaking deadlocks in the quorum votes. <br />
In this case our two node UAT HA cluster requires a quorum to ensure that a node has a majority vote at all times. To configure Quorum settings right click on the cluster name --> <strong>More Actions</strong> --> <strong>Configure Cluster Quorum Settings</strong>: <br />
<a href="http://lh3.ggpht.com/-9X_QEdOWfIY/UwaQhDsUQOI/AAAAAAAAL1A/fBoWOAY2gk0/s1600-h/clip_image025%25255B3%25255D.png"><img alt="clip_image025" border="0" src="http://lh5.ggpht.com/-7IU1fVnx_1s/UwaQh3QHr0I/AAAAAAAAL1I/xWaTDoeyyS4/clip_image025_thumb.png?imgmax=800" height="194" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="clip_image025" width="244" /></a> <br />
<br />
From the <strong>Select Quorum Configuration</strong> screen select the third option - <strong>Node and File Share Majority</strong> <br />
<a href="http://lh3.ggpht.com/-nlcJyvmpiG0/UwaQivCa2lI/AAAAAAAAL1Q/8-8szQ_rWbs/s1600-h/clip_image027%25255B3%25255D.jpg"><img alt="clip_image027" border="0" src="http://lh4.ggpht.com/-zEDUUGx-xR8/UwaQjc8IDUI/AAAAAAAAL1U/mGc0omv-Vlk/clip_image027_thumb.jpg?imgmax=800" height="177" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="clip_image027" width="244" /></a> <br />
<br />
When prompted enter the details of the Quorum file share (\\<QuorumServer>\Quorums\<ClusterName). This will create a small folder inside the share with cluster specific quorum information. <br />
<br />
<h2>
POST CLUSTER CREATION TESTS</h2>
Post cluster build the cluster needs to be reviewed to ensure that it is configured properly. Key tests performed are: <br />
<ol>
<li>Review the <strong>Failover Cluster</strong> <strong>Manager</strong> MMC snap-in and ensure there are no errors / warnings </li>
<li>Perform ping tests on the cluster name and make sure it resolves </li>
<li>Check the current owner of the cluster </li>
<li>Perform a cluster failover to the secondary node <ol>
<li>Open a powershell prompt as an administrator </li>
<li>Run the following command: <strong>get-clustergroup | move-clustergroup -Node "SQLUAT05A"</strong> </li>
<li>Check the status of the cluster in <strong>Failover Cluster Manager</strong></li>
</ol>
</li>
<li>Perform a cluster fail back to the primary node<strong> </strong> <ol>
<li>Open a powershell prompt as an administrator </li>
<li>Run the following command: <strong>get-clustergroup | move-clustergroup -Node "SQLUAT05B"</strong> </li>
<li>Check the status of the cluster in <strong>Failover Cluster Manager</strong></li>
</ol>
</li>
</ol>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Willhttp://www.blogger.com/profile/01725430562728194875noreply@blogger.com0tag:blogger.com,1999:blog-1058098923431120944.post-27629235885524089082014-02-01T08:18:00.000+10:002014-02-21T06:24:43.993+10:00Upgrading Powershell on Windows Server 2008 R2<br />
The latest version of Powershell, version 4, has been released by Microsoft in late October 2013. It brings a lot of additional functionality and performance improvements to the table. This document covers how to upgrade Powershell from your current version to Powershell 4.0.<br />
<br />
<a name='more'></a><br />
Powershell 4.0 is now included as part of the Windows Management Framework 4.0 which bundles together a few additional providers. Windows Management Framework 4.0 can be downloaded from Microsoft at the following link:<br />
<br />
<a href="http://www.microsoft.com/en-us/download/details.aspx?id=40855" target="_blank">http://www.microsoft.com/en-us/download/details.aspx?id=40855</a><br />
<br />
To check your current version of Powershell open up a Powershell command prompt. In the prompt type $host and press enter. You should see something similar to the following:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkv-htZKnIMftY6fJhtRBfquBXSYNav_qGe6pp-uEfeoaqT4RRygZFDeD-ukojHQC-LfZecq94JGQ0dec8z0Emk2aqjhQK8ftzCIdfn_F_JSDxBgBRicsLbekZoTmfmFL147bEghT893o/s1600/Powershell+Version.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkv-htZKnIMftY6fJhtRBfquBXSYNav_qGe6pp-uEfeoaqT4RRygZFDeD-ukojHQC-LfZecq94JGQ0dec8z0Emk2aqjhQK8ftzCIdfn_F_JSDxBgBRicsLbekZoTmfmFL147bEghT893o/s1600/Powershell+Version.png" /></a></div>
<br />
If it says version 4.0 your current, anything less and you may want to upgrade to the latest version.<br />
<br />
<br />
It's important to note that there are multiple packages available for installation and download. You need to choose the right package for your operating system. As per the release notes on the download page:<br />
<br />
<b>Windows 7 SP1</b><br />
x64: Windows6.1-KB2819745-x64-MultiPkg.msu<br />
x86: Windows6.1-KB2819745-x86.msu<br />
<b><br /></b>
<b>Windows Server 2008 R2 SP1</b><br />
x64: Windows6.1-KB2819745-x64-MultiPkg.msu<br />
<b><br /></b>
<b>Windows Server 2012</b><br />
x64: Windows8-RT-KB2799888-x64.msu<br />
<br />
<br />
<br />Willhttp://www.blogger.com/profile/01725430562728194875noreply@blogger.com0tag:blogger.com,1999:blog-1058098923431120944.post-43017577653681977322013-08-06T08:51:00.001+10:002013-08-06T08:51:25.088+10:00SQL Server Filestream Of Limited Use For Publicly Accessible Websites?<p>We have a new feature being developed for our publicly accessible websites that enables users to upload files into “the system”. At first glance the SQL Server Filestream feature looks perfect for this type of scenario however there are several limitations that cripple it’s usefulness in publicly accessible environments.</p> <p>The SQL Server Filestream feature has two modes of operation. In the first mode all file access is performed through transact SQL. Even though the file is stored on the SQL Server’s filesystem it is access via T-SQL and is returned as a blob (varbinary(max)). This is essentially the same as storing the file in the database as a blob.</p> <p>In the second mode, the application queries the filestream enabled table to get the handle of the file. It then “streams” the file using a SMB connection to the SQL Server. This is by far more efficient that accessing the file via T-SQL. It’s more efficient because SQL Server is doing what it does best, returning data sets, and Windows Server is doing what it does best, file serving.</p> <p>For maximum performance we want to use the second mode however there are a few problems using the streaming feature.</p> <ol> <li>The fileshare is located on the SQL Server itself. For a webserver in the DMZ to use the streaming feature it needs SMB access to the SQL Server. This is generally a port that we’d rather not open up.</li> <li>Often the DMZ servers are not on the same domain as internal servers. This causes issues with authentication to the fileshare. There may be ways around this such as passing credentials from the application to the fileshare but even so this may be a cludgy approach.</li></ol> <p>After reviewing the filestream feature we’re still using it, however we’re using it in T-SQL mode. It looks as though the streaming mode is probably best used on internal applications where security isn’t a major factor. Typical examples that come to mind are intranets, document management systems, Customer Relationship Management systems etc.</p> Willhttp://www.blogger.com/profile/01725430562728194875noreply@blogger.com0tag:blogger.com,1999:blog-1058098923431120944.post-58768119403844764502013-07-29T19:11:00.001+10:002013-07-29T19:11:26.444+10:00Problems Booting Centos Guest In A Virtual Machine<h2>
Problem</h2>
Booting into a fresh Centos installation inside a virtual machine results in a black screen. The Centos login screen does not appear. This problem has been replicated in VMWare Workstation 9, VMWare ESX 4.0, and Virtual Box.<br />
<br />
<h2>
Resolution</h2>
This problem occurs when the Centos ISO is still attached to the virtual guest. Disconnect the Centos ISO and reboot the virtual machine.<br />
<br />Willhttp://www.blogger.com/profile/01725430562728194875noreply@blogger.com0tag:blogger.com,1999:blog-1058098923431120944.post-3976721956176253712013-07-13T15:28:00.003+10:002013-07-13T15:28:25.015+10:00Linux Error Message: inter-device move failed, unable to remove target: Is a directory Trying to move some files from a network share to a USB drive on the Linux terminal and came up with the following unexpected error message:<br />
<br />
<blockquote class="tr_bq">
<span style="font-family: "Courier New", Courier, monospace;">inter-device move failed, unable to remove target: Is a directory </span></blockquote>
<br />
<br />
In my case it turned out to be that the destination folder already existed. By changing the destination folder to a folder that didn't exist and the move worked straight away. It's weird because I would've assumed that the default behaviour would've been to merge the contents of the two folders and delete the source folder. I'll do some more research on this one when I get the chance.Willhttp://www.blogger.com/profile/01725430562728194875noreply@blogger.com0tag:blogger.com,1999:blog-1058098923431120944.post-55157676314266673012013-05-09T08:42:00.001+10:002013-05-09T08:42:45.126+10:00Building The SQL Server 2012 Template (Version 1–With Windows Server 2008 R2 Core)<p>Why would we want to develop a SQL Server template? I can think of two main reasons. Firstly, configuring a SQL Server can be a time consuming process. By the time all the local policy settings, SQL settings etc have been configured it can take a full day!!! Templating speeds this up so that SQL Server deployment should take no longer than 30 minutes – simply deploy the template and reconfigure a handful of settings specific to the instance. Secondly templates help standardise the environment. This is particularly important when you have a number of DBAs in a team and everyone does things that little bit different.</p> <p>Before I go too much further it’s important to understand the design philosophy I’m taking with this approach. Rather than having a few large monolithic virtual SQL Servers I’m looking at having numerous smaller virtual SQL Servers. These smaller SQL Servers are easier to move around in virtual environments that use high availability technologies like Vmotion or Live Migration. They can also help segregate the load and risk between applications and clients.</p> <p>As a starting point I’m setting up a VMWare based SQL Server 2012 template running on Windows 2008 R2 Core. I’ve deliberately chosen Windows 2008 R2 Core Standard Edition for the following reasons:</p> <ol> <li>Windows Server 2012 requires VMWare ESX 5.1 or greater to run. As this is “relatively” new Server 2008 R2 is a much more ubiquitous choice.</li> <li>Windows Server Core uses around 25% of the memory of Windows with a GUI leaving more resources available to applications.</li> <li>Windows Server Core also requires far fewer patches than the full GUI version. For example there’s no Internet Explorer or other GUI components that require patching.</li></ol> <p>The final piece of the puzzle is that sysprepping of SQL Server 2012 is now supported as of SP1 CU2. This now gives us the ability to cleanly and rapidly deploy SQL Server 2012 in a uniform manner.</p> <h2>The SQL Server Template Design</h2> <h3>Template Design</h3> <ul> <li>Windows Server 2008 R2 Core (Standard Edition)</li> <ul> <li>E: – Data file drive</li> <li>F: – Files drive. Filestream data and backups</li> <li>L: – Log files</li> <li>T: – TempDB files</li></ul> <li>.NET 3.5 SP1 (SQL Server 2012 pre-requisite)</li> <li>SQL Server 2012 SP1 CU3</li> <ul> <li>Database Engine</li> <li>Replication</li> <li>Full-Text Indexing</li> <li>Integration Services</li> <li>Filestream Enabled</li></ul> <li>Antivirus Software (Optional and Recommended)</li> <li>Monitoring Software (Optional and Recommended)</li></ul> <h3>Service Accounts</h3> <p>I’ll be using the virtual service accounts which are the default option. The reason behind this is that I’ll be deploying this template into both workgroup and domain configuration. The second reason is that these virtual service accounts can also access domain resources. They do this under the context of the computer machine account (eg. as <DOMAIN>/<COMPUTERNAME>%)</p> <h2>Template Build Process</h2> <h3>Virtual Machine</h3> <p>Firstly deploy a virtual machine with the following configuration:</p> <ul> <li>1 vCPU</li> <li>2GB Ram</li> <li>C Drive – 30GB</li> <li>E Drive – 10GB</li> <li>F Drive – 2GB</li> <li>L Drive – 2GB</li> <li>T Drive – 2GB</li></ul> <p>As you can see the drive sizes are quite small. These are stub drives that should be expanded to the required size during deployment.</p> <h3>Windows Server 2008 R2 Core Install</h3> <p>Perform a vanilla Windows Server 2008 R2 Core install onto the C drive of the virtual machine. Once completed we’ll customise the base operating system.</p> <h4></h4> <h4>Fix the Page File</h4> <p>First I’m going to fix the page file to 2GB in size. This is enough for a minidump but not enough for any serious paging to occur. Our goal with SQL Sever is to have it not page so the 2GB should be fine.</p> <p>< insert instructions here></p> <h4>Enable Remote Management</h4> <p>The remote management tools allow you to use MMC from another computer to manage this SQL Server. You may find this handy as without the interface you cannot run a lot of the configuration tools on Windows Core. Run the sconfig command for an easy menu driven approach to configuring a Windows Core server. (<strong><em>Note lines with # in front are comments and should not be entered as input!</em></strong>)</p> <div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"> <div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum1" style="color: #606060"> 1:</span> # Configure remote management</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060"> 2:</span> sconfig</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum3" style="color: #606060"> 3:</span> 4) Configure Remote Management</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060"> 4:</span> # Allow MMC Remote Management</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum5" style="color: #606060"> 5:</span> 1) Allow MMC Remote Management <Enter></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060"> 6:</span> # Enable Windows PowerShell. Sets execution policy to remote <span style="color: #0000ff">signed</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum7" style="color: #606060"> 7:</span> 2) Enable Windows PowerShell <Enter></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060"> 8:</span> 13) Exit to Command Line</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum9" style="color: #606060"> 9:</span> shutdown /r /t 0</pre><!--CRLF--></div></div><br /><br /><h4>Enable Remote Desktop</h4><br /><p>Next we’ll enable the Remote Desktop. Despite having no GUI it is useful to be able to directly access the command line via Remote Desktop.</p><br /><div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"><br /><div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum1" style="color: #606060"> 1:</span> sconfig</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060"> 2:</span> 4) Configure Remote Management</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum3" style="color: #606060"> 3:</span> 3) Allow Server Manager Remote Management <Enter></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060"> 4:</span> #Enable remote desktop</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum5" style="color: #606060"> 5:</span> 5) Return to main menu</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060"> 6:</span> 7) Remote Desktop:</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum7" style="color: #606060"> 7:</span> (E)nable or (D)isable Remote Desktop? (Blank=Cancel)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060"> 8:</span> E <Enter></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum9" style="color: #606060"> 9:</span> # Option 2 is mandatory in <span style="color: #0000ff">this</span> instance. Not running on a domain at <span style="color: #0000ff">this</span> stage.</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum10" style="color: #606060"> 10:</span> 2) Allow clients running any version of Remote Desktop (less secure) <Enter><Enter></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum11" style="color: #606060"> 11:</span> 13) Exit to Command Line</pre><!--CRLF--></div></div><br /><br /><br /><h4><br /><p><br /><h4> </h4></p></h4><br /><br /><h4>Install all Windows Updates</h4><br /><p>Using sconfig install all Windows updates and ensure the server is fully patched.</p><br /><h4>Install .NET 3.5 SP1 Framework</h4><br /><p>By default this feature is not enabled. As this is a requirement for SQL Server 2012 you need to enable it by running the following command:</p><br /><div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"><br /><div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum1" style="color: #606060"> 1:</span> Start /w ocsetup NetFx3-ServerCore</pre><!--CRLF--></div></div><br /><p> </p><br /><h4>Setup the Disk Partitions</h4><br /><p>Next we’ll setup the disk partitions and filesystem structures so they are ready for SQL Server. We’re using the diskpart utility to create the disk structures and once again, the # symbol is used for comments. Diskpart wont recognize the # symbol or comments so don’t copy those lines into the utility. Also take note that these disk assignments match up to the disks I assigned my virtual template. The first “list disk” command can be used to determine your drive mapping.</p><br /><div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"><br /><div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum1" style="color: #606060"> 1:</span> diskpart</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060"> 2:</span> # Create boundary aligned volumes</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum3" style="color: #606060"> 3:</span> list disk</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060"> 4:</span> select disk 1</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum5" style="color: #606060"> 5:</span> create partition primary align=1024</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060"> 6:</span> select disk 2</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum7" style="color: #606060"> 7:</span> create partition primary align=1024</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060"> 8:</span> select disk 3</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum9" style="color: #606060"> 9:</span> create partition primary align=1024</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum10" style="color: #606060"> 10:</span> select disk 4</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum11" style="color: #606060"> 11:</span> create partition primary align=1024</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum12" style="color: #606060"> 12:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum13" style="color: #606060"> 13:</span> # Assign drive letters to volumes</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum14" style="color: #606060"> 14:</span> list volume</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum15" style="color: #606060"> 15:</span> select volume 3</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum16" style="color: #606060"> 16:</span> assign letter=e</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum17" style="color: #606060"> 17:</span> select volume 4</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum18" style="color: #606060"> 18:</span> assign letter=l</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum19" style="color: #606060"> 19:</span> select volume 5</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum20" style="color: #606060"> 20:</span> assign letter=t</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum21" style="color: #606060"> 21:</span> select volume 6</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum22" style="color: #606060"> 22:</span> assign letter=f</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum23" style="color: #606060"> 23:</span> exit</pre><!--CRLF--></div></div><br /><p>Next we’ll format the drives. I’m going to format the three SQL drives ( E:, L:, T: ) with 64K block size. The F drive could also be formatted with a 64K block size however I’m keeping it as a 4KB block size. My logic behind this is that I want to use compression for the filestream folder and this is only supported on 4KB block sizes.</p><br /><div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"><br /><div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum1" style="color: #606060"> 1:</span> format e: /fs:ntfs /a:64k</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060"> 2:</span> format l: /fs:ntfs /a:64k</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum3" style="color: #606060"> 3:</span> format t: /fs:ntfs /a:64k</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060"> 4:</span> format f: /fs:ntfs </pre><!--CRLF--></div></div><br /><p>Finally I’ll create the folder structures I’ll be using in my SQL Server template:</p><br /><div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"><br /><div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum1" style="color: #606060"> 1:</span> mkdir e:\MSSQL</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060"> 2:</span> mkdir e:\MSSQL\DATA</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum3" style="color: #606060"> 3:</span> mkdir l:\MSSQL</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060"> 4:</span> mkdir l:\MSSQL\LOGS</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum5" style="color: #606060"> 5:</span> mkdir f:\MSSQL</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060"> 6:</span> mkdir f:\MSSQL\BACKUPS</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum7" style="color: #606060"> 7:</span> mkdir f:\MSSQL\FileStream</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060"> 8:</span> mkdir f:\REPL</pre><!--CRLF--></div></div><br /><p> </p><br /><h4>Filestream Disk Optimizations</h4><br /><p>Next step there’s a couple of disk based optimizations we can make for the filestream features.</p><br /><p>First we’ll disable short file names. This is a backwards compatibility feature that creates a secondary 16 bit compatible filename for each and every file on the filesystem. This is no longer required (unless you’re running a 16 bit application on this server!)</p><br /><div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"><br /><div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum1" style="color: #606060"> 1:</span> fsutil.exe behavior query disable8dot3</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060"> 2:</span> fsutil behavior set disable8dot3 1</pre><!--CRLF--></div></div><br /><p>Next we’ll disable the Last Access Time file attribute. You may want to avoid this if you’re going to keep your backups on this drive (I’ll be moving them off post template deployment)</p><br /><div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"><br /><div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum1" style="color: #606060"> 1:</span> fsutil.exe behavior set disablelastaccess 1</pre><!--CRLF--></div></div><br /><br /><br /><br /><br /><br /><br /><br /><h4>Set the Power Plan to “High Performance”</h4><br /><p>By default Windows Server runs on the “Balanced” power plan. This will try and save power by ramping up and down the frequency of the CPU as required. The problem is that the ramp up process can take a while depending upon your load profiles. By the time the CPU ramps up the frequency the short burst of load may have been processed. Rather than letting Windows determine the frequency of your CPU. The first command below shows us what the power plan is currently in use.</p><br /><div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"><br /><div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum1" style="color: #606060"> 1:</span> # List all the power schemes</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060"> 2:</span> powercfg.exe -L</pre><!--CRLF--></div></div><br /><p>This will return output similar to what is below:</p><br /><div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"><br /><div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">Existing Power Schemes (* Active)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">-----------------------------------</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">Power Scheme GUID: 381b4222-f694-41f0-9685-ff5bb260df2e (Balanced) *</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">Power Scheme GUID: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c (High performance)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">Power Scheme GUID: a1841308-3541-4fab-bc81-f71556f20b4a (Power saver)</pre><!--CRLF--></div></div><br /><p>Here we’re interested in the GUID for the “High peformance” power scheme. We set it as active using the GUID above as shown below:</p><br /><div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"><br /><div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum1" style="color: #606060"> 1:</span> powercfg.exe -SETACTIVE <span style="color: #006080">"8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c"</span></pre><!--CRLF--></div></div><br /><p> </p><br /><h2>Installing SQL Server</h2><br /><p>The next step is to perform the SQL Server install. In the approach I’m taking I’m performing a vanilla install of SQL Server using the local virtual accounts and providing a default sa password. These can be customised post install as required.</p><br /><p>The command line install is show below. </p><br /><div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"><br /><div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">d:\setup.exe /action=install /IACCEPTSQLSERVERLICENSETERMS /UpdateEnabled /FEATURES=SQL,IS,Replication,FullText /QS /SQLSYSADMINACCOUNTS=Administrator /INSTANCENAME=<span style="color: #006080">"MSSQLSERVER"</span> /SECURITYMODE=SQL /SAPWD=Password1 /INSTANCEDIR=E:\MSSQL /TCPENABLED=1 /BROWSERSVCSTARTUPTYPE=Automatic /SQLBACKUPDIR=F:\MSSQL\BACKUPS /SQLTEMPDBDIR=T:\MSSQL /SQLTEMPDBLOGDIR=T:\MSSQL /SQLUSERDBDIR=E:\MSSQL\DATA /SQLUSERDBLOGDIR=L:\MSSQL\LOGS /FILESTREAMLEVEL=1 /INSTALLSQLDATADIR=E:\MSSQL\DATA </pre><!--CRLF--></div></div><br /><p>A quick run down of the script options and the reason I’ve chosen those options is as follows:</p><br /><ul><br /><li>FEATURES – The SQL database engine, Integration Services, Replication, and Full-text indexing. Some of these features may not be used on all deployed instances however there’s no harm in deploying them just in case.</li><br /><li>SQLSYSADMINACCOUNT – I’ve added the local administrator account as a sysadmin on SQL Server. You may want to remove this depending on your security policy.</li><br /><li>INSTANCENAME – The default MSSQLSERVER instance. I’m trying to move away from multiple instances on a single server in favour of multiple smaller virtual servers. It’s easier from a resourcing perspective and keeps the environment consistent.</li><br /><li>SECURITYMODE – SQL. Need for access in a workgroup environment (remember – there’s no GUI!). Can be changed to Windows post install.</li><br /><li>SAPASSWD – The sysadmin password is set to a default and should be changed manually post install.</li><br /><li>INSTANCEDIR – The SQL Server instance will be installed to the E drive</li><br /><li>TCPENABLED – By default TCP connectivity is disabled to the SQL Server. Turn it on.</li><br /><li>BROWSERVERSVCSTARTUPTYPE - Automatic. </li><br /><li>SQLBACKUPDIR – the default location of backups. I will typically change this to a network share for centralised backups where possible. </li><br /><li>SQLTEMPDBDIR – Put the tempDB on the T drive</li><br /><li>SQLTEMPDBLOGDIR – Put the tempDB log files on the T drive. In high performance scenarios this may be located on another drive / another LUN.</li><br /><li>SQLUSERDBDIR – The default location for user database files is on the E drive</li><br /><li>SQLUSERDBLOGDIR – The default location for user database log files is on the L drive</li><br /><li>FILESTREAMLEVEL – Set to 1. Ie. Access via SQL only. For level 2 and higher to work we need to open up SMB access to the SQL Server. As this is potentially a security risk I’ve left this disabled.</li></ul><br /><p> </p><br /><p>As a final setup, install the current Service Pack and Cumulative Update.</p><br /><h3>Post Installation Configuration - Operating System</h3><br /><h4>The Firewall</h4><br /><p>The next step is to allow SQL Server to talk through the firewall. In this instance I’ve just opened up communication to the SQL Server and Browser executables. You can update this to lock it down further as required.</p><br /><div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"><br /><div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">netsh advfirewall firewall add rule name=<span style="color: #006080">"SQL Server"</span> dir=in program=<span style="color: #006080">"e:\mssql\MSSQL11.MSSQLSERVER\MSSQL\Binn\sqlservr.exe"</span> action=allow</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">netsh advfirewall firewall add rule name=<span style="color: #006080">"SQL Server Browser"</span> dir=in program=<span style="color: #006080">"c:\Program Files (x86)\Microsoft SQL Server\90\Shared\sqlbrowser.exe"</span> action=allow</pre><!--CRLF--></div></div><br /><p> </p><br /><h3>Post Installation Configuration - SQL Server </h3><br /><br /><br /><br /><br /><h4>Enable TCP/IP and Change the Default Port</h4><br /><p>I tend to change the default port from 1433. The main reason for this is that we can have external parties connecting to some of our sandboxed SQL instances and I’d rather not use the standard ports just as an extra layer of security. First run a SQL Powershell session using the sqlps.exe command, then run the following code:</p><br /><div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"><br /><div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">[reflection.assembly]::LoadWithPartialName(<span style="color: #006080">"Microsoft.SqlServer.Smo"</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">[reflection.assembly]::LoadWithPartialName(<span style="color: #006080">"Microsoft.SqlServer.SqlWmiManagement"</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">$smo = <span style="color: #006080">'Microsoft.SqlServer.Management.Smo.'</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">$wmi = <span style="color: #0000ff">new</span>-object ($smo + <span style="color: #006080">'Wmi.ManagedComputer'</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">$uri = <span style="color: #006080">"ManagedComputer[@Name='W2008R2SQL2012S']/ ServerInstance[@Name='MSSQLSERVER']/ServerProtocol[@Name='Tcp']"</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">$Tcp = $wmi.GetSmoObject($uri)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">$Tcp.IsEnabled = $true</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">$Tcp.Alter()</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">$Tcp</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"># want to repeat <span style="color: #0000ff">this</span> <span style="color: #0000ff">for</span> all IP addresses</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">$wmi.GetSmoObject($uri + <span style="color: #006080">"/IPAddress[@Name='IPAll']"</span>).IPAddressProperties[1].Value = <span style="color: #006080">"9033"</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">$TCP.alter()</pre><!--CRLF--></div></div><br /><p> </p><br /><br /><h4>Grant Lock Pages In Memory Privilege to The SQL Server Service Account</h4><br /><p>There’s conflicting advice on whether to grant this privilege or not. Personally I use it everywhere. On production systems it’s mandatory, on non-production systems optional. This setting will force SQL Server to hold onto the memory it grabs and not release it back to the operating system. </p><br /><p><font color="#ff0000">This can be dangerous if you have other applications running on that server that try and access memory when none is available. Paging will occur. If you perform this step make sure that you leave memory free on the OS for the OS and other applications.</font></p><br /><p><font color="#000000">My approach here is to use the setting, then lock down the Max Memory setting in SQL Server such that there is always a certain amount of memory free for the operating system.</font></p><br /><div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"><br /><div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span style="color: #006080">"C:\Admin\ntrights.exe"</span> -u <span style="color: #006080">"NT SERVICE\MSSQLSERVER"</span> +r SeLockMemoryPrivilege</pre><!--CRLF--></div></div><br /><p> </p><br /><h4>Enable Instant File Initialization</h4><br /><p>Less controversial is adding the SQL Server service account to the “Perform Volume Tasks” privilege. This permission is required for instant file initialization. Instant file initialization allows SQL to allocate addition space to new and existing files without zeroing out that region of disk first. This is a massive performance boost for database growth and backups in particular.</p><br /><div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"><br /><div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span style="color: #006080">"C:\Admin\ntrights.exe"</span> -u <span style="color: #006080">"NT SERVICE\MSSQLSERVER"</span> +r SeManageVolumePrivilege</pre><!--CRLF--></div></div><br /><p> </p><br /><h4>Enable Backup Compression As Default</h4><br /><p>By default backup compression is not enabled. This setting turns it on and in turn compresses your backups. Typically compressed backups run faster and are around 1/3rd of the size of uncompressed backups.</p><br /><div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"><br /><div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">EXEC sp_configure <span style="color: #006080">'backup compression default'</span>, 1;</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">RECONFIGURE WITH OVERRIDE;</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">GO</pre><!--CRLF--></div></div><br /><p> </p><br /><h4>Enable Remote Administration Connections</h4><br /><p>It’s worth turning this on so you can access your SQL Server in case of emergency.</p><br /><div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"><br /><div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">sp_configure <span style="color: #006080">'remote admin connections'</span> , 1</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span style="color: #0000ff">GO</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span style="color: #0000ff">RECONFIGURE</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span style="color: #0000ff">GO</span></pre><!--CRLF--></div></div><br /><p> </p><br /><h4>Enable XP Command Shell</h4><br /><p>This one may be controversial but I turn it on by default. I’ve got a few maintenance jobs that require it plus quite a few of our developer jobs require this feature.</p><br /><div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"><br /><div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span style="color: #0000ff">EXEC</span> sp_configure <span style="color: #006080">'show advanced options'</span>, 1</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span style="color: #0000ff">RECONFIGURE</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span style="color: #0000ff">GO</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span style="color: #0000ff">EXEC</span> sp_configure <span style="color: #006080">'xp_cmdshell'</span>, 1</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span style="color: #0000ff">GO</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span style="color: #0000ff">RECONFIGURE</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span style="color: #0000ff">GO</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"> </pre><!--CRLF--></div></div><br /><p> </p><br /><h4>Split the TempDB</h4><br /><p>Splitting the tempDB helps reduce contention by creating more IO threads (one per data file). In this script I’ve created 4 tempDB data files, each 1GB in size. This needs to be reconfigure based on your server requirements. The guideline here is 1 data file per processor. Unless you have a lot of processors, then its more like 1 data file per 2 processors. The size also depends on your workload and the tempDB needs to be monitored so that it does not fill up.</p><br /><div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"><br /><div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span style="color: #0000ff">alter</span> <span style="color: #0000ff">database</span> tempdb</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span style="color: #0000ff">modify</span> <span style="color: #0000ff">file</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">(</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"> name = tempdev, <span style="color: #0000ff">size</span> = 1000MB , maxsize = 1000 MB, filegrowth = 0MB</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span style="color: #0000ff">GO</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span style="color: #0000ff">ALTER</span> <span style="color: #0000ff">DATABASE</span> tempdb <span style="color: #0000ff">ADD</span> <span style="color: #0000ff">FILE</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">(NAME = tempdev_2 ,</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">MAXSIZE = 1000MB,</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span style="color: #0000ff">SIZE</span>=1000 MB ,</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">FILENAME = <span style="color: #006080">'T:\MSSQL\tempdb_2.ndf'</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span style="color: #0000ff">GO</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span style="color: #0000ff">ALTER</span> <span style="color: #0000ff">DATABASE</span> tempdb <span style="color: #0000ff">ADD</span> <span style="color: #0000ff">FILE</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">(NAME = tempdev_3 ,</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">MAXSIZE = 1000MB,</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span style="color: #0000ff">SIZE</span>=1000 MB ,</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">FILENAME = <span style="color: #006080">'T:\MSSQL\tempdb_3.ndf'</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span style="color: #0000ff">GO</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span style="color: #0000ff">ALTER</span> <span style="color: #0000ff">DATABASE</span> tempdb <span style="color: #0000ff">ADD</span> <span style="color: #0000ff">FILE</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">(NAME = tempdev_4 ,</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">MAXSIZE = 1000MB,</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span style="color: #0000ff">SIZE</span>=1000 MB ,</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">FILENAME = <span style="color: #006080">'T:\MSSQL\tempdb_4.ndf'</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span style="color: #0000ff">GO</span></pre><!--CRLF--></div></div><br /><p> </p><br /><h4>Optimize For Adhoc Workloads</h4><br /><p>This setting is used to combat procedure cache bloat generated by adhoc queries. There’s no size limit to the procedure cache so in theory you can have GB’s of adhoc one-time queries being cached that will never be used again. This feature will tell SQL Server to only cache a query on the second time it is used.</p><br /><div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"><br /><div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">sp_CONFIGURE <span style="color: #006080">'show advanced options'</span> ,1</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span style="color: #0000ff">RECONFIGURE</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span style="color: #0000ff">GO</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">sp_CONFIGURE <span style="color: #006080">'optimize for ad hoc workloads'</span> ,1</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span style="color: #0000ff">RECONFIGURE</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span style="color: #0000ff">GO</span></pre><!--CRLF--></div></div><br /><p> </p><br /><br /><br /><h4>Other Manual Stuff</h4><br /><p>I’ve put all the above into scripts so that my SQL Server deployments are uniform. There is however some outstanding items that are beyond the scope of the template but still need to be looked at:</p><br /><ul><br /><li>SQL Server Min and Max memory – this may go into the template at some point. These settings really depend on your server and as such don’t fit into the template.</li><br /><li>Network Configuration – Server IPs etc.</li><br /><li>Antivirus Configuration – skip mdfs, ldfs, ndfs</li><br /><li>Database mail – depends on environment (ie. SMTP info)</li><br /><li>Backup and Maintenance jobs – may include into template using default locations</li><br /><li>Failsafe Operator</li></ul> Willhttp://www.blogger.com/profile/01725430562728194875noreply@blogger.com0tag:blogger.com,1999:blog-1058098923431120944.post-51807169650961085972013-05-03T06:11:00.001+10:002013-05-03T06:16:18.859+10:00SQL Server–Tiered Server Installs And Automated DeploymentsAn idea I’ve been playing with for a while and saw at the recent SQL Saturday Pass sessions is with creating Tiered SQL Server installs. For me this comes out of the increasing use of virtualization and the exponentially increasing number of SQL Servers this spawns. Without some sort of system in place it becomes incredibly difficult to standardize our SQL Server installs and we end up with a non-uniform environment.<br />
The idea is relatively simple in theory – in order to standardize our SQL Server environments we define a number of tiers. The tiers should relate to how we use SQL Server in our environments but at the same time we want them to be standard across a tier. Each tier should add to the previous tier in terms of functionality and performance.<br />
Furthermore by standardizing our installs into tiers we can also automate our SQL Server deployments. The approach I’ll be taking will be to develop a template that can be automatically deployed to a base tier. Ideally the server can easily be upgraded to higher tiers through upgrade wizards and by reconfiguring the resources in the hypervisor.<br />
First I’m going to define the tiers I have in mind and how I want them to look.<br />
<h1>
Tier 3 – Entry-Level SQL Server Platform</h1>
The Tier 3 server is more designed with system administrators, developers, and non-DBAs in mind. It may also be necessary if the SQL Server is an application server which needs applications installed that are cannot run on Windows Core.<br />
<table border="0" cellpadding="2" cellspacing="0" style="width: 484px;"> <tbody>
<tr> <td valign="top" width="198">Operating System</td> <td valign="top" width="284">Windows Server Standard Edition w/GUI</td></tr>
<tr> <td valign="top" width="198">SQL Server Edition</td> <td valign="top" width="284">2012 SP1 CU2 or greater, Standard Edition</td></tr>
<tr> <td valign="top" width="198">Components Installed</td> <td valign="top" width="284"><ul>
<li>SQL Engine </li>
<li>Replication </li>
<li>Full Text Indexing </li>
<li>Integration Services </li>
<li>Management Studio</li>
</ul>
</td></tr>
<tr> <td valign="top" width="198">Drive Layouts</td> <td valign="top" width="284"><ul>
<li>C - Operating System </li>
<li>E – Data </li>
<li>L – Logs</li>
</ul>
</td></tr>
<tr> <td valign="top" width="198">Processors</td> <td valign="top" width="284">Start at 1 vCPU. Can be customised higher.</td></tr>
<tr> <td valign="top" width="198">Memory</td> <td valign="top" width="284">Start at 2GB. Can be customised higher.</td></tr>
</tbody></table>
<br />
<h1>
Tier 2 – The Mid Range SQL Server Platform</h1>
The Tier 2 standard is designed for non-critical business applications and is a compromise between performance and resources.<br />
By using the core editions of SQL and Windows we save on resources. Windows Server 2008 R2 uses 2 to 4GB compared to around 600MB on Windows Server Core. Across many virtual machines this is a huge saving. The core editions also require far fewer patches (and hopefully restarts) compared to the editions with full GUIs.<br />
<table border="0" cellpadding="2" cellspacing="0" style="width: 484px;"> <tbody>
<tr> <td valign="top" width="198">Operating System</td> <td valign="top" width="284">Windows Server Standard Edition (Core)</td></tr>
<tr> <td valign="top" width="198">SQL Server Edition</td> <td valign="top" width="284">2012 SP1 CU2 or greater, Standard Edition</td></tr>
<tr> <td valign="top" width="198">Components Installed</td> <td valign="top" width="284"><ul>
<li>SQL Engine </li>
<li>Replication </li>
<li>Full Text Indexing </li>
<li>Integration Services </li>
</ul>
</td></tr>
<tr> <td valign="top" width="198">Drive Layouts</td> <td valign="top" width="284"><ul>
<li>C - Operating System </li>
<li>E – Data </li>
<li>L – Logs </li>
<li>T- TempDB</li>
</ul>
</td></tr>
<tr> <td valign="top" width="198">Processors</td> <td valign="top" width="284">Start at 1 vCPU. Should be customised higher.</td></tr>
<tr> <td valign="top" width="198">Memory</td> <td valign="top" width="284">Start at 2GB. Should be customised higher.</td></tr>
</tbody></table>
<br />
<h1>
Tier 1 –The High Performance SQL Server Platform</h1>
The high performance Tier is designed for high performance SQL applications but doesn’t provide for much in the way of high availability. I’ve deliberately left the operating system at Standard Edition as in many virtual environments the high availability is rightly or wrongly provided at the virtualisation layer. <br />
The Enterprise edition of SQL Server provides much better performance over the Standard edition in a number of areas both in terms of internal engine performance and additional features to boost performance.<br />
Of note is that both the processor and memory should be customised to suit the workloads on the server. The figures quoted below are simply a starting point and need to be revised accordingly.<br />
<table border="0" cellpadding="2" cellspacing="0" style="width: 484px;"> <tbody>
<tr> <td valign="top" width="198">Operating System</td> <td valign="top" width="284">Windows Server Standard Edition (Core)</td></tr>
<tr> <td valign="top" width="198">SQL Server Edition</td> <td valign="top" width="284">2012 SP1 CU2 or greater, Enterprise Edition</td></tr>
<tr> <td valign="top" width="198">Components Installed</td> <td valign="top" width="284"><ul>
<li>SQL Engine </li>
<li>Replication </li>
<li>Full Text Indexing </li>
<li>Integration Services </li>
</ul>
</td></tr>
<tr> <td valign="top" width="198">Drive Layouts</td> <td valign="top" width="284"><ul>
<li>C - Operating System </li>
<li>E – Data </li>
<li>L – Logs </li>
<li>T – TempDB</li>
</ul>
</td></tr>
<tr> <td valign="top" width="198">Processors</td> <td valign="top" width="284">Start at 1 vCPU. Should be customised higher.</td></tr>
<tr> <td valign="top" width="198">Memory</td> <td valign="top" width="284">Start at 2GB. Should be customised higher.</td></tr>
</tbody></table>
<br />
<br />
<h1>
Tier 0 – Ultra-High Performance SQL Server Platform</h1>
This tier is very similar to Tier 1 except it has additional features added for High Availability. The main difference is that we’re now using Windows Server Enterprise edition which is mandatory for clustering and AlwaysOn technologies.<br />
Of note is that both the processor and memory should be customised to suit the workloads on the server. The figures quoted below are simply a starting point and need to be revised accordingly.<br />
<table border="0" cellpadding="2" cellspacing="0" style="width: 484px;"> <tbody>
<tr> <td valign="top" width="198">Operating System</td> <td valign="top" width="284">Windows Server Enterprise Edition (Core)</td></tr>
<tr> <td valign="top" width="198">SQL Server Edition</td> <td valign="top" width="284">2012 SP1 CU2 or greater, Enterprise Edition</td></tr>
<tr> <td valign="top" width="198">Components Installed</td> <td valign="top" width="284"><ul>
<li>SQL Engine </li>
<li>Replication </li>
<li>Full Text Indexing </li>
<li>Integration Services </li>
</ul>
</td></tr>
<tr> <td valign="top" width="198">Drive Layouts</td> <td valign="top" width="284"><ul>
<li>C - Operating System </li>
<li>E – Data </li>
<li>L – Logs </li>
<li>T- TempDB</li>
</ul>
</td></tr>
<tr> <td valign="top" width="198">Processors</td> <td valign="top" width="284">Start at 1 vCPU. Should be customised higher.</td></tr>
<tr> <td valign="top" width="198">Memory</td> <td valign="top" width="284">Start at 2GB. Should be customised higher.</td></tr>
</tbody></table>
<br />
<h1>
Using SQL Server Templates</h1>
Now that we’ve defined the tiers I want to build a SQL Serer template that can easily be deployed into these tiers. It’s a work in progress but I’m working on templates which fit into the Tier 2 and Tier 3 categories. The idea is to build fully sysprepped images(supported by SQL Server 2012 SP1 CU2 and onwards) which can easily and quickly be deployed to the standards.<br />
To upgrade from Tier 2 to Tier 1 we would simply run the SQL Server Edition Upgrade to turn it into a SQL Enterprise server. We could also move the virtual disks to higher performing disk sets to upgrade performance.<br />
Can we upgrade from Tier 1 to Tier 0? There is a tool to upgrade Windows editions by entering the new product key so this should be easy to accomplish.Willhttp://www.blogger.com/profile/01725430562728194875noreply@blogger.com0tag:blogger.com,1999:blog-1058098923431120944.post-9333254733247510022013-04-29T19:15:00.001+10:002013-05-03T06:15:33.720+10:00Handy Date Functions<p>These date functions are especially useful for BI and reporting type scenarios. Used properly they can simply SQL code making it much, much easier to read. Used properly they can also make SQL queries perform better!!!</p> <p>First let’s install the date functions by running the following code snippets:</p> <p>1. The first day of the month </p> <div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"> <div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum1" style="color: #606060"> 1:</span> <span style="color: #0000ff">SET</span> ANSI_NULLS <span style="color: #0000ff">ON</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060"> 2:</span> <span style="color: #0000ff">GO</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum3" style="color: #606060"> 3:</span> <span style="color: #0000ff">SET</span> QUOTED_IDENTIFIER <span style="color: #0000ff">ON</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060"> 4:</span> <span style="color: #0000ff">GO</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum5" style="color: #606060"> 5:</span> <span style="color: #008000">-- =============================================</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060"> 6:</span> <span style="color: #008000">-- Author: William Brown</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum7" style="color: #606060"> 7:</span> <span style="color: #008000">-- Create date: 2013-04-29</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060"> 8:</span> <span style="color: #008000">-- Description: Return the first day of the month</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum9" style="color: #606060"> 9:</span> <span style="color: #008000">-- For more information check out</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum10" style="color: #606060"> 10:</span> <span style="color: #008000">-- http://yetanothercomputingblog.blogspot.com.au/</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum11" style="color: #606060"> 11:</span> <span style="color: #008000">-- =============================================</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum12" style="color: #606060"> 12:</span> <span style="color: #0000ff">CREATE</span> <span style="color: #0000ff">FUNCTION</span> fn_FirstDateOfMonth(@<span style="color: #0000ff">date</span> DATETIME)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum13" style="color: #606060"> 13:</span> <span style="color: #0000ff">RETURNS</span> <span style="color: #0000ff">DATE</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum14" style="color: #606060"> 14:</span> <span style="color: #0000ff">AS</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum15" style="color: #606060"> 15:</span> <span style="color: #0000ff">BEGIN</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum16" style="color: #606060"> 16:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum17" style="color: #606060"> 17:</span> <span style="color: #0000ff">DECLARE</span> @first_of_month <span style="color: #0000ff">DATE</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum18" style="color: #606060"> 18:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum19" style="color: #606060"> 19:</span> <span style="color: #0000ff">SELECT</span> @first_of_month = <span style="color: #0000ff">CONVERT</span>(<span style="color: #0000ff">DATE</span>,DATEADD(dd,-(<span style="color: #0000ff">DAY</span>(@<span style="color: #0000ff">date</span>)-1),@<span style="color: #0000ff">date</span>))</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum20" style="color: #606060"> 20:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum21" style="color: #606060"> 21:</span> <span style="color: #0000ff">RETURN</span> @first_of_month</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum22" style="color: #606060"> 22:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum23" style="color: #606060"> 23:</span> <span style="color: #0000ff">END</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum24" style="color: #606060"> 24:</span> <span style="color: #0000ff">GO</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum25" style="color: #606060"> 25:</span> </pre><!--CRLF--></div></div><br /><p>2. The first day of the next month</p><br /><div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"><br /><div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum1" style="color: #606060"> 1:</span> <span style="color: #0000ff">SET</span> ANSI_NULLS <span style="color: #0000ff">ON</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060"> 2:</span> <span style="color: #0000ff">GO</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum3" style="color: #606060"> 3:</span> <span style="color: #0000ff">SET</span> QUOTED_IDENTIFIER <span style="color: #0000ff">ON</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060"> 4:</span> <span style="color: #0000ff">GO</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum5" style="color: #606060"> 5:</span> <span style="color: #008000">-- =============================================</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060"> 6:</span> <span style="color: #008000">-- Author: William Brown</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum7" style="color: #606060"> 7:</span> <span style="color: #008000">-- Create date: 2013-04-29</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060"> 8:</span> <span style="color: #008000">-- Description: Return the first day of the next month</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum9" style="color: #606060"> 9:</span> <span style="color: #008000">-- For more information check out</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum10" style="color: #606060"> 10:</span> <span style="color: #008000">-- http://yetanothercomputingblog.blogspot.com.au/</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum11" style="color: #606060"> 11:</span> <span style="color: #008000">-- =============================================</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum12" style="color: #606060"> 12:</span> <span style="color: #0000ff">CREATE</span> <span style="color: #0000ff">FUNCTION</span> fn_FirstDateOfNextMonth(@<span style="color: #0000ff">date</span> DATETIME)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum13" style="color: #606060"> 13:</span> <span style="color: #0000ff">RETURNS</span> <span style="color: #0000ff">DATE</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum14" style="color: #606060"> 14:</span> <span style="color: #0000ff">AS</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum15" style="color: #606060"> 15:</span> <span style="color: #0000ff">BEGIN</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum16" style="color: #606060"> 16:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum17" style="color: #606060"> 17:</span> <span style="color: #0000ff">DECLARE</span> @first_of_month <span style="color: #0000ff">DATE</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum18" style="color: #606060"> 18:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum19" style="color: #606060"> 19:</span> <span style="color: #0000ff">SELECT</span> @first_of_month = <span style="color: #0000ff">CONVERT</span>(<span style="color: #0000ff">DATE</span>,DATEADD(dd,-(<span style="color: #0000ff">DAY</span>(DATEADD(mm,1,@<span style="color: #0000ff">date</span>))-1),DATEADD(mm,1,@<span style="color: #0000ff">date</span>)))</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum20" style="color: #606060"> 20:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum21" style="color: #606060"> 21:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum22" style="color: #606060"> 22:</span> <span style="color: #0000ff">RETURN</span> @first_of_month</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum23" style="color: #606060"> 23:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum24" style="color: #606060"> 24:</span> <span style="color: #0000ff">END</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum25" style="color: #606060"> 25:</span> <span style="color: #0000ff">GO</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum26" style="color: #606060"> 26:</span> </pre><!--CRLF--></div></div><br /><p>3. The first day of the year</p><br /><div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"><br /><div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum1" style="color: #606060"> 1:</span> <span style="color: #0000ff">SET</span> ANSI_NULLS <span style="color: #0000ff">ON</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060"> 2:</span> <span style="color: #0000ff">GO</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum3" style="color: #606060"> 3:</span> <span style="color: #0000ff">SET</span> QUOTED_IDENTIFIER <span style="color: #0000ff">ON</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060"> 4:</span> <span style="color: #0000ff">GO</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum5" style="color: #606060"> 5:</span> <span style="color: #008000">-- =============================================</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060"> 6:</span> <span style="color: #008000">-- Author: William Brown</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum7" style="color: #606060"> 7:</span> <span style="color: #008000">-- Create date: 2013-04-29</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060"> 8:</span> <span style="color: #008000">-- Description: Return the first day of the year</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum9" style="color: #606060"> 9:</span> <span style="color: #008000">-- For more information check out</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum10" style="color: #606060"> 10:</span> <span style="color: #008000">-- http://yetanothercomputingblog.blogspot.com.au/</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum11" style="color: #606060"> 11:</span> <span style="color: #008000">-- =============================================</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum12" style="color: #606060"> 12:</span> <span style="color: #0000ff">CREATE</span> <span style="color: #0000ff">FUNCTION</span> fn_FirstDateOfYear(@<span style="color: #0000ff">date</span> DATETIME)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum13" style="color: #606060"> 13:</span> <span style="color: #0000ff">RETURNS</span> <span style="color: #0000ff">DATE</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum14" style="color: #606060"> 14:</span> <span style="color: #0000ff">AS</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum15" style="color: #606060"> 15:</span> <span style="color: #0000ff">BEGIN</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum16" style="color: #606060"> 16:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum17" style="color: #606060"> 17:</span> <span style="color: #0000ff">DECLARE</span> @first_day_of_year <span style="color: #0000ff">DATE</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum18" style="color: #606060"> 18:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum19" style="color: #606060"> 19:</span> <span style="color: #0000ff">SELECT</span> @first_day_of_year = DATEADD(<span style="color: #0000ff">YEAR</span>, DATEDIFF(<span style="color: #0000ff">YEAR</span>, 0, @<span style="color: #0000ff">date</span>), 0)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum20" style="color: #606060"> 20:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum21" style="color: #606060"> 21:</span> <span style="color: #0000ff">RETURN</span> @first_day_of_year</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum22" style="color: #606060"> 22:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum23" style="color: #606060"> 23:</span> <span style="color: #0000ff">END</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum24" style="color: #606060"> 24:</span> <span style="color: #0000ff">GO</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum25" style="color: #606060"> 25:</span> </pre><!--CRLF--></div></div><br /><p>4. The first day of the next year</p><br /><div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"><br /><div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum1" style="color: #606060"> 1:</span> <span style="color: #0000ff">SET</span> ANSI_NULLS <span style="color: #0000ff">ON</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060"> 2:</span> <span style="color: #0000ff">GO</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum3" style="color: #606060"> 3:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060"> 4:</span> <span style="color: #0000ff">SET</span> QUOTED_IDENTIFIER <span style="color: #0000ff">ON</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum5" style="color: #606060"> 5:</span> <span style="color: #0000ff">GO</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060"> 6:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum7" style="color: #606060"> 7:</span> <span style="color: #008000">-- =============================================</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060"> 8:</span> <span style="color: #008000">-- Author: William Brown</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum9" style="color: #606060"> 9:</span> <span style="color: #008000">-- Create date: 2013-04-29</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum10" style="color: #606060"> 10:</span> <span style="color: #008000">-- Description: Return the first day of the next year</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum11" style="color: #606060"> 11:</span> <span style="color: #008000">-- For more information check out</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum12" style="color: #606060"> 12:</span> <span style="color: #008000">-- http://yetanothercomputingblog.blogspot.com.au/</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum13" style="color: #606060"> 13:</span> <span style="color: #008000">-- =============================================</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum14" style="color: #606060"> 14:</span> <span style="color: #0000ff">CREATE</span> <span style="color: #0000ff">FUNCTION</span> [dbo].[fn_FirstDateOfNextYear](@<span style="color: #0000ff">date</span> DATETIME)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum15" style="color: #606060"> 15:</span> <span style="color: #0000ff">RETURNS</span> <span style="color: #0000ff">DATE</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum16" style="color: #606060"> 16:</span> <span style="color: #0000ff">AS</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum17" style="color: #606060"> 17:</span> <span style="color: #0000ff">BEGIN</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum18" style="color: #606060"> 18:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum19" style="color: #606060"> 19:</span> <span style="color: #0000ff">DECLARE</span> @first_day_of_next_year <span style="color: #0000ff">DATE</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum20" style="color: #606060"> 20:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum21" style="color: #606060"> 21:</span> <span style="color: #0000ff">SELECT</span> @first_day_of_next_year = DATEADD(<span style="color: #0000ff">YEAR</span>, DATEDIFF(<span style="color: #0000ff">YEAR</span>, 0,DATEADD(<span style="color: #0000ff">YEAR</span>,1,@<span style="color: #0000ff">date</span>)), 0)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum22" style="color: #606060"> 22:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum23" style="color: #606060"> 23:</span> <span style="color: #0000ff">RETURN</span> @first_day_of_next_year</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum24" style="color: #606060"> 24:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum25" style="color: #606060"> 25:</span> <span style="color: #0000ff">END</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum26" style="color: #606060"> 26:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum27" style="color: #606060"> 27:</span> GO</pre><!--CRLF--></div></div><br /><p>5. The first day of the Australian financial year (1 Jul XXXX)</p><br /><div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"><br /><div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum1" style="color: #606060"> 1:</span> <span style="color: #0000ff">SET</span> ANSI_NULLS <span style="color: #0000ff">ON</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060"> 2:</span> <span style="color: #0000ff">GO</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum3" style="color: #606060"> 3:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060"> 4:</span> <span style="color: #0000ff">SET</span> QUOTED_IDENTIFIER <span style="color: #0000ff">ON</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum5" style="color: #606060"> 5:</span> <span style="color: #0000ff">GO</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060"> 6:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum7" style="color: #606060"> 7:</span> <span style="color: #008000">-- =============================================</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060"> 8:</span> <span style="color: #008000">-- Author: William Brown</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum9" style="color: #606060"> 9:</span> <span style="color: #008000">-- Create date: 2013-04-29</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum10" style="color: #606060"> 10:</span> <span style="color: #008000">-- Description: Return the first day of the next year</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum11" style="color: #606060"> 11:</span> <span style="color: #008000">-- For more information check out</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum12" style="color: #606060"> 12:</span> <span style="color: #008000">-- http://yetanothercomputingblog.blogspot.com.au/</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum13" style="color: #606060"> 13:</span> <span style="color: #008000">-- =============================================</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum14" style="color: #606060"> 14:</span> <span style="color: #0000ff">CREATE</span> <span style="color: #0000ff">FUNCTION</span> [dbo].[fn_FirstDateOfFinancialYear](@<span style="color: #0000ff">date</span> DATETIME)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum15" style="color: #606060"> 15:</span> <span style="color: #0000ff">RETURNS</span> <span style="color: #0000ff">DATE</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum16" style="color: #606060"> 16:</span> <span style="color: #0000ff">AS</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum17" style="color: #606060"> 17:</span> <span style="color: #0000ff">BEGIN</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum18" style="color: #606060"> 18:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum19" style="color: #606060"> 19:</span> <span style="color: #0000ff">DECLARE</span> @first_day_of_financial_year <span style="color: #0000ff">DATE</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum20" style="color: #606060"> 20:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum21" style="color: #606060"> 21:</span> <span style="color: #0000ff">SELECT</span> @first_day_of_financial_year = DATEADD(MM,6,DATEADD(<span style="color: #0000ff">YEAR</span>, DATEDIFF(<span style="color: #0000ff">YEAR</span>, 0, @<span style="color: #0000ff">date</span>), 0))</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum22" style="color: #606060"> 22:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum23" style="color: #606060"> 23:</span> <span style="color: #0000ff">RETURN</span> @first_day_of_financial_year</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum24" style="color: #606060"> 24:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum25" style="color: #606060"> 25:</span> <span style="color: #0000ff">END</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum26" style="color: #606060"> 26:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum27" style="color: #606060"> 27:</span> GO</pre><!--CRLF--></div></div><br /><p>6. The first day of the next Australian financial year (1 Jul XXXX)</p><br /><div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"><br /><div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum1" style="color: #606060"> 1:</span> <span style="color: #0000ff">SET</span> ANSI_NULLS <span style="color: #0000ff">ON</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060"> 2:</span> <span style="color: #0000ff">GO</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum3" style="color: #606060"> 3:</span> <span style="color: #0000ff">SET</span> QUOTED_IDENTIFIER <span style="color: #0000ff">ON</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060"> 4:</span> <span style="color: #0000ff">GO</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum5" style="color: #606060"> 5:</span> <span style="color: #008000">-- =============================================</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060"> 6:</span> <span style="color: #008000">-- Author: William Brown</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum7" style="color: #606060"> 7:</span> <span style="color: #008000">-- Create date: 2013-04-29</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060"> 8:</span> <span style="color: #008000">-- Description: Return the first day of the next year</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum9" style="color: #606060"> 9:</span> <span style="color: #008000">-- For more information check out</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum10" style="color: #606060"> 10:</span> <span style="color: #008000">-- http://yetanothercomputingblog.blogspot.com.au/</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum11" style="color: #606060"> 11:</span> <span style="color: #008000">-- =============================================</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum12" style="color: #606060"> 12:</span> <span style="color: #0000ff">CREATE</span> <span style="color: #0000ff">FUNCTION</span> fn_FirstDateOfNextFinancialYear(@<span style="color: #0000ff">date</span> DATETIME)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum13" style="color: #606060"> 13:</span> <span style="color: #0000ff">RETURNS</span> <span style="color: #0000ff">DATE</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum14" style="color: #606060"> 14:</span> <span style="color: #0000ff">AS</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum15" style="color: #606060"> 15:</span> <span style="color: #0000ff">BEGIN</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum16" style="color: #606060"> 16:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum17" style="color: #606060"> 17:</span> <span style="color: #0000ff">DECLARE</span> @first_day_of_next_financial_year <span style="color: #0000ff">DATE</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum18" style="color: #606060"> 18:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum19" style="color: #606060"> 19:</span> <span style="color: #0000ff">SELECT</span> @first_day_of_next_financial_year = DATEADD(MM,6,DATEADD(<span style="color: #0000ff">YEAR</span>, DATEDIFF(<span style="color: #0000ff">YEAR</span>, -1, @<span style="color: #0000ff">date</span>), 0))</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum20" style="color: #606060"> 20:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum21" style="color: #606060"> 21:</span> <span style="color: #0000ff">RETURN</span> @first_day_of_next_financial_year</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum22" style="color: #606060"> 22:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum23" style="color: #606060"> 23:</span> <span style="color: #0000ff">END</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum24" style="color: #606060"> 24:</span> <span style="color: #0000ff">GO</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum25" style="color: #606060"> 25:</span> </pre><!--CRLF--></div></div><br /><p>Running the following code:</p><br /><div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"><br /><div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum1" style="color: #606060"> 1:</span> <span style="color: #0000ff">set</span> nocount <span style="color: #0000ff">on</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060"> 2:</span> <span style="color: #0000ff">select</span> dbo.fn_FirstDateOfMonth(getdate()) <span style="color: #0000ff">AS</span> FirstDateOfMonth</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum3" style="color: #606060"> 3:</span> <span style="color: #0000ff">select</span> dbo.fn_FirstDateOfNextMonth(getdate()) <span style="color: #0000ff">AS</span> FirstDateOfNextMonth</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060"> 4:</span> <span style="color: #0000ff">select</span> dbo.fn_FirstDateOfYear(getdate()) <span style="color: #0000ff">AS</span> FirstDateOfYear</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum5" style="color: #606060"> 5:</span> <span style="color: #0000ff">select</span> dbo.fn_FirstDateOfNextYear(getdate()) <span style="color: #0000ff">AS</span> FirstDateOfNextYear</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060"> 6:</span> <span style="color: #0000ff">select</span> dbo.fn_FirstDateOfFinancialYear(getdate()) <span style="color: #0000ff">AS</span> FirstDateOfFinancialYear</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum7" style="color: #606060"> 7:</span> <span style="color: #0000ff">select</span> dbo.fn_FirstDateOfNextFinancialYear(getdate()) <span style="color: #0000ff">AS</span> FirstDateOfNextFinancialYear</pre><!--CRLF--></div></div><br /><p>Gives the following results:</p><br /><div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"><br /><div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum1" style="color: #606060"> 1:</span> FirstDateOfMonth</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060"> 2:</span> ----------------</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum3" style="color: #606060"> 3:</span> 2013-04-01</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060"> 4:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum5" style="color: #606060"> 5:</span> FirstDateOfNextMonth</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060"> 6:</span> --------------------</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum7" style="color: #606060"> 7:</span> 2013-05-01</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060"> 8:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum9" style="color: #606060"> 9:</span> FirstDateOfYear</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum10" style="color: #606060"> 10:</span> ---------------</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum11" style="color: #606060"> 11:</span> 2013-01-01</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum12" style="color: #606060"> 12:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum13" style="color: #606060"> 13:</span> FirstDateOfNextYear</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum14" style="color: #606060"> 14:</span> -------------------</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum15" style="color: #606060"> 15:</span> 2014-01-01</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum16" style="color: #606060"> 16:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum17" style="color: #606060"> 17:</span> FirstDateOfFinancialYear</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum18" style="color: #606060"> 18:</span> ------------------------</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum19" style="color: #606060"> 19:</span> 2013-07-01</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum20" style="color: #606060"> 20:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum21" style="color: #606060"> 21:</span> FirstDateOfNextFinancialYear</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum22" style="color: #606060"> 22:</span> ----------------------------</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"><span id="lnum23" style="color: #606060"> 23:</span> 2014-07-01</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum24" style="color: #606060"> 24:</span> </pre><!--CRLF--></div></div> Willhttp://www.blogger.com/profile/01725430562728194875noreply@blogger.com0tag:blogger.com,1999:blog-1058098923431120944.post-36331739697288540782013-04-06T21:03:00.001+10:002013-04-06T21:03:18.645+10:00Enumerate All Default Constraints In A Database<br />
The following script will enumerate all default constraints in the database the script is run against.<br />
<br />
<br />
<div align="left">
<span style="color: blue; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">select</span></span> <span style="color: #010101; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">c</span></span> <span style="color: grey; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">.</span></span><span style="color: #010101; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">name</span></span> <span style="color: blue; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">from</span></span></div>
<div align="left">
<span style="color: green; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">sys</span></span><span style="color: grey; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">.</span></span><span style="color: green; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">all_columns</span></span> <span style="color: #010101; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">a</span></span></div>
<div align="left">
<span style="color: grey; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">inner</span></span> <span style="color: green; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">join sys</span></span><span style="color: grey; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">.</span></span><span style="color: green; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">tables</span></span> <span style="color: #010101; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">b<span style="font-size: xx-small;"> </span>on<span style="color: blue;"><span style="font-size: xx-small;"> </span></span>a</span></span><span style="color: grey; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">.</span></span><span style="color: magenta; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">object_id</span></span> <span style="color: grey; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">=</span></span> <span style="color: #010101; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">b</span></span> <span style="color: grey; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">.</span></span><span style="color: magenta; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">object_id</span></span></div>
<div align="left">
<span style="color: grey; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">inner</span></span> <span style="color: green; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">join sys</span></span><span style="color: grey; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">.</span></span><span style="color: green; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">default_constraints</span></span> <span style="color: blue; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">c<span style="font-size: xx-small;"> </span>on</span></span> <span style="color: #010101; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">a</span></span><span style="color: grey; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">.</span></span> <span style="color: #010101; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">default_object_id</span></span> <span style="color: grey; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">=</span></span> <span style="color: #010101; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">c</span></span> <span style="color: grey; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">.</span></span><span style="color: magenta; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">object_id</span></span></div>
<br />
<br />Willhttp://www.blogger.com/profile/01725430562728194875noreply@blogger.com0tag:blogger.com,1999:blog-1058098923431120944.post-59448804186710177962013-04-06T17:21:00.001+10:002013-04-06T17:21:33.510+10:00Enumerate All SQL Jobs with AlertsThe following SQL code will enumerate all jobs on a SQL Server that have alerts associated with the job. It will also list the operator to be notified and the email address used in the notification.<br />
<br />
<div align="left">
<span style="color: blue; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">use</span></span> <span style="color: #010101; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">msdb</span></span></div>
<div align="left">
<span style="color: #010101; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;"><br /></span></span></div>
<div align="left">
<span style="color: blue; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">select</span></span> <span style="color: #010101; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">j</span></span><span style="color: grey; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">.</span></span> <span style="color: #010101; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">name</span></span><span style="color: grey; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">,</span></span> <span style="color: #010101; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">o</span></span> <span style="color: grey; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">.</span></span><span style="color: #010101; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">name</span></span><span style="color: grey; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">,</span></span> <span style="color: #010101; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">o</span></span><span style="color: grey; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">.</span></span><span style="color: #010101; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">email_address</span></span></div>
<div align="left">
<span style="color: blue; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">from</span></span> <span style="color: #010101; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">sysjobs j</span></span></div>
<div align="left">
<span style="color: grey; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">join</span></span> <span style="color: #010101; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">sysoperators o</span></span> <span style="color: blue; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">on</span></span> <span style="color: #010101; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">j</span></span><span style="color: grey; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">.</span></span><span style="color: #010101; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">notify_email_operator_id</span></span> <span style="color: grey; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">=</span></span> <span style="color: #010101; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">o</span></span><span style="color: grey; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">.</span></span> <span style="color: #010101; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">id</span></span></div>
<div align="left">
<span style="color: blue; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">order</span></span> <span style="color: blue; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">by</span></span> <span style="color: #010101; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">j</span></span><span style="color: grey; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">.</span></span><span style="color: #010101; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">name</span></span> <span style="color: blue; font-family: Courier New; font-size: xx-small;"><span style="font-size: 8pt;">asc</span></span></div>
<br />
<br />Willhttp://www.blogger.com/profile/01725430562728194875noreply@blogger.com0tag:blogger.com,1999:blog-1058098923431120944.post-30088158117792322412013-03-23T15:07:00.001+10:002013-03-23T15:07:02.712+10:00Install HyperV And Your Networking Dies!!!It sounds dramatic - when you install the Hyper-V role on Windows you may find that you cannot reach your HyperV host remotely any more. It worked before the Hyper-V role was added and now the server is unreachable. Fortunately it's a rather simple problem to fix.<br />
<br />
The cause of the problem is that when you install Hyper-V it completely reconfigures your networking. Firstly, it will create a "Network Bridge" which is used for to provide virtual networking to your virtual machines. The "Network Bridge" completely takes over your network card. In it's place a virtual network card is installed on your Hyper-V host for host communications.<br />
<br />
So the first step is to confirm your network settings on the virtual network card which is typically labelled vEthernet (Followed by the physical network card details).<br />
<br />
In my case these settings were all fine. My problem resided in my virtual network card settings. First right click on the virtual network card and go into it's properties.<br />
<br />
Next click on the configure button just below the network card.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAfrq2lNuJf6ZyW44LBv-vgSu_uja2faq4LZ50ISyRIyQEmnFmdiY5MQKOabWqpMLJhrZs_T45nbnMb8wvDr3xDa-Vn4rqfKg4lLUzmAdzMHp-9NAm-mPXQtBGN1xE1YxNsc6CE70LmPc/s1600/Screen+Shot+2013-03-23+at+3.06.06+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="198" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAfrq2lNuJf6ZyW44LBv-vgSu_uja2faq4LZ50ISyRIyQEmnFmdiY5MQKOabWqpMLJhrZs_T45nbnMb8wvDr3xDa-Vn4rqfKg4lLUzmAdzMHp-9NAm-mPXQtBGN1xE1YxNsc6CE70LmPc/s320/Screen+Shot+2013-03-23+at+3.06.06+PM.png" width="320" /></a></div>
<br />
In the advanced tab select the IPv4 Large Send Offload settings and set it as disabled.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheOXP87_qpT6LWwLd6pxvxA-RK43W2HtGL-bdr6TQZbrHdKAOxYa4g0Bpvs6kCWdsmObROSoMMproSHy87qCwXykfqWRT0a-xl606tHXRR1pzTyzo5ZcfC4WIq1GsyEyZuBI2mx4tlAN4/s1600/Screen+Shot+2013-03-23+at+3.03.59+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheOXP87_qpT6LWwLd6pxvxA-RK43W2HtGL-bdr6TQZbrHdKAOxYa4g0Bpvs6kCWdsmObROSoMMproSHy87qCwXykfqWRT0a-xl606tHXRR1pzTyzo5ZcfC4WIq1GsyEyZuBI2mx4tlAN4/s320/Screen+Shot+2013-03-23+at+3.03.59+PM.png" width="286" /></a></div>
<br />
<br />Willhttp://www.blogger.com/profile/01725430562728194875noreply@blogger.com0tag:blogger.com,1999:blog-1058098923431120944.post-5310968382814033812013-01-26T14:30:00.001+10:002013-01-26T14:30:36.421+10:00Mounting A Local Linux FolderOK so I've probably got myself into a unique situation here. I thought I would be smart and try setting up transmission to download torrents directly to my wdtvlivehub. It was a good idea at the time but it's really not working out too well. Firstly, I mounted the wdtvlivehub to a mount point on my Raspberry Pi. Works perfect.<br />
<br />
The problem comes us with the way bit torrent works. It's doing massive amounts of really small network IOs writing and reading blocks from the disk. In my case this happens across a 100 Mbps network. I don't think the Pi is handling it that well. The other side affect appears to be on the wdtvlivehub side of things. It looks like it's detecting the file changes and is always trying to recompile the media library. Side affect - the wdtvlivehub is not usable (but I'm sure fixable :) )<br />
<br />
I've already added a powered USB disk to the Pi and the performance is much, much better. The next step is to relocate the existing torrents without upsetting transmission. To do this I'm going to setup a folder on the new external disk, move across my partially downloaded torrents, then mount this folder back to the original mount point.<br />
<br />
To start with I'll create the new folders to match my existing structure<br />
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">mkdir /media/usbdrive2/wdtvlivehub</span><span style="font-family: Courier New, Courier, monospace;">mkdir /media/usbdrive2/wdtvlivehub/temp</span></blockquote>
<br />
Next I'll copy the partially completed torrents across<br />
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">mv /media/wdtvlivehub/temp/*.part /media/usbdrive2/wdtvlivehub/temp</span></blockquote>
Next I'll add the following lines to my /etc/fstab:<br />
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">/media/usbdrive2/wdtvlivehub /media/wdtvlivehub auto bind,gid=46,defaults 0 0</span></blockquote>
To finish up I re-mount all the mount points specified by fstab<br />
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">sudo mount -a </span></blockquote>
Willhttp://www.blogger.com/profile/01725430562728194875noreply@blogger.com0tag:blogger.com,1999:blog-1058098923431120944.post-26073450957113873712013-01-23T13:37:00.000+10:002013-01-23T13:37:12.306+10:00SQL Server Encryption Notes
<div>
<span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;"><b style="color: black; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><u>ENCRYPTION AT REST (ON DISK) - Transparent Data Encryption or TDE</u></b></span></span><div style="color: black; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;"><br /></span></span></div>
<div style="color: black; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;"><b>Pros</b></span></span></div>
<ul style="color: black; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<li><span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;">Data and Log files encrypted
</span></span><ul>
<li><span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;">But memory paged out of the operating system wont be</span></span></li>
</ul>
</li>
<li><span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;">No changes for developers (ie. code remains unchanged)</span></span></li>
<li><span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;">Provides security if SQL Access Controls are bypassed. Eg. Shut down SQL Server and take database files off the server. Stolen backup files</span></span></li>
<li><span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;">Can encrypt single fields or entire database (entire database probably safest)</span></span></li>
<li><span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;">Performance hit estimated at 3-5% CPU - needs to be tested but should be acceptable</span></span></li>
<li><span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;">The database backup are automatically encrypted when database encryption is turned on </span></span></li>
</ul>
<div style="color: black; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;"><br /></span></span></div>
<div style="color: black; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;"><b>Cons</b></span></span><ul>
<li><span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;">Data not encrypted in memory</span></span></li>
<li><span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;">No added protection for access via SQL (ie. TSQL or stored proc. Access Control Lists lock down this access)</span></span></li>
<li><span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;">Need a maintenance strategy for passwords, keys, certificates
</span></span><ul>
<li><span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;">Lose one of these and the database may not be recoverable</span></span></li>
</ul>
</li>
<li><span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;">More complex database refresh procedure</span></span></li>
<li><span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;">TDE does not increase the size of the data (but negates compression - on average we will need 3x the current disk space, compression ratio typically around 35% of original size)</span></span></li>
<li><span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;">Automatically encrypts the tempdb database
</span></span><ul>
<li><span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;">I.e. Performance hit for all databases as all tempDB operations are now encrypted</span></span></li>
</ul>
</li>
<li><span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;">Having enough memory is important for performance as data in memory is not encrypted. Retrieving data from disk will have the encryption overhead</span></span></li>
<li><span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;">Other features such as full text search and filestream are not encrypted - we dont use these at the moment.</span></span></li>
</ul>
<span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;"><b>Other Details</b> </span></span></div>
<ul style="color: black; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<li><span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;">Authenticators option - can force the same user that encrypts the data to be the only person that can decrypt the data</span></span></li>
<li><span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;">Encryption Algorithms - <span style="color: black; display: inline ! important; float: none; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">DES, Triple DES, TRIPLE_DES_3KEY, RC2, RC4,<span> </span><strike>128-bit</strike><span> </span><strike>RC4</strike>, DESX, 128-bit AES, 192-bit AES, and 256-bit AES.</span></span></span></li>
<li style="text-align: left;"><span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;"><span>Asymmetric encryption offers stronger encryption than symmetric - but also very slow </span></span></span><ul>
<li style="text-align: left;"><span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;"><span>Symmetric is recommended for data</span></span></span></li>
<li style="text-align: left;"><span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;"><span>Asymmetric is used to protect symmetric keys</span></span></span></li>
</ul>
</li>
<li style="text-align: left;"><span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;"><span>Can use existing UAT infrastructure for testing as encryption is turned on per database</span></span></span></li>
</ul>
<div style="color: black; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;"><span><b>Questions</b></span></span></span></div>
<ul style="color: black; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<li><span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;">Which type of encryption?</span></span></li>
<li><span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;"><a href="http://blogs.msdn.com/b/ace_team/archive/2007/09/07/aes-vs-3des-block-ciphers.aspx">http://blogs.msdn.com/b/ace_team/archive/2007/09/07/aes-vs-3des-block-ciphers.aspx</a></span></span></li>
<li><span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;">256-bit AES looks to be the winner over DES. Faster performance, especially in software</span></span></li>
</ul>
<div style="color: black; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;"><span><b><u>ENCRYPTION IN COMMUNICATIONS</u></b></span></span></span></div>
<div style="color: black; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;"><span><br /></span></span></span></div>
<div style="color: black; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;"><span><br /></span></span></span></div>
<ul style="color: black; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<li><span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;">SSL 128bit</span></span></li>
<li><span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;">Server setting - can force encryption or make it mandatory</span></span></li>
<li style="display: inline; list-style: none outside none;"><ul>
<li><span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;">Recommend forcing encryption</span></span></li>
</ul>
</li>
<li><span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;">Change in connection string
</span></span><ul>
<li><span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;">Eg. <span style="color: #333333; line-height: 18px; white-space: pre;">Driver=SQLServer;Server=ServerNameHere;UID=UserIdHere;PWD=PasswordHere;Network=DBNETLIB.DLL;<b>Encrypt=YES</b></span></span></span></li>
<li><div style="background-color: white; color: #333333; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: 18px; margin: 0px; orphans: 2; padding: 10px 10px 20px; position: relative; text-align: left; text-indent: 0px; text-transform: none; widows: 2; width: auto; word-spacing: 0px;">
<span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;"><span style="color: #333333; line-height: 18px; white-space: pre;"><span style="font-weight: normal;">Eg. Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=dbNameHere;Data Source=ServerNameHere;</span><b>Use Encryption for Data=True</b></span></span></span></div>
</li>
</ul>
</li>
</ul>
<div style="color: black; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;"><span><br /></span></span></span></div>
<div style="color: black; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;"><span><br /></span></span></span></div>
<div style="color: black; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;"><span>Also look at:</span></span></span></div>
<div style="color: black; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;"><span><a href="http://msdn.microsoft.com/en-us/library/cc278098(v=sql.100).aspx">http://msdn.microsoft.com/en-us/library/cc278098(v=sql.100).aspx</a></span></span></span></div>
<span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;"><br /></span></span></div>
<span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;">
</span></span>Willhttp://www.blogger.com/profile/01725430562728194875noreply@blogger.com0tag:blogger.com,1999:blog-1058098923431120944.post-25520378752309188082013-01-23T13:23:00.002+10:002013-01-23T13:23:56.697+10:00Securely Wiping An Old Hard DiskThrowing your hard disks away is a major, major security risk. There's a lot of sensitive data stored on your hard drive that builds up over the years. Even deleting the contents or formatting the old drive isn't enough - people can (and do) recover 'deleted' information all the time. Just search for "recover windows files" in google to find the millions of matches on how to do this (yep, there's legitimate reasons for doing this - like when you've deleted a file and need to get it back!)<br />
<br />
The best way to make sure your private information stays safe is to wipe the hard disk before throwing it in the trash. There's a number of free tools out there to do this. If you're running Windows then a great utility is <a href="http://www.diskwipe.org/" target="_blank">Disk Wipe</a>.<br />
<br />
It's a free download and very, very easy to use. After installing you just run the program and select the drive you want to wipe. <span style="color: red;">Be very, very careful and make sure you select the right drive, there's no way to get this data back once it's wiped. Also make sure you've backed up everything you need before doing this - there ain't no turning back! </span><br />
<br />
The next option to select is the level of wipe you want to do. The option at the top is both the fastest wipe and least secure, the option at the bottom is the slowest wipe and most secure. Typically I select one of the options in the middle - it's a good tradeoff between speed and security. If you're paranoid, select the bottom option and come back in a day - it takes a while!<br />
<br />
<br />
<br />Willhttp://www.blogger.com/profile/01725430562728194875noreply@blogger.com0tag:blogger.com,1999:blog-1058098923431120944.post-24625656670237129222013-01-19T15:14:00.005+10:002013-01-19T15:47:45.072+10:00Problems Mounting Drives Formatted With ExFAT In UbuntuPlugging in one of my external hard drives into a fresh Ubuntu 12.10 install today and it's failed with the following error message: <br />
<br />
<div style="text-align: left;">
<blockquote class="tr_bq">
<span style="font-size: small;"><span style="font-family: "Courier New",Courier,monospace;">mount: unknown filesystem type 'exfat'</span></span></blockquote>
</div>
Luckily following the instructions on this <a href="http://softwaroid.com/2011/12/20/how-to-solve-the-unknown-filesystem-type-exfat-problem/" target="_blank">blog</a> resolved the problem quickly. In short it takes 3 short commands to add exFAT support to your Ubuntu desktop:<br />
<br />
<blockquote class="tr_bq">
<div style="text-align: left;">
<span style="font-size: small;"><span style="font-family: "Courier New",Courier,monospace;">sudo apt-add-repository ppa:relan/exfat </span></span></div>
<div style="text-align: left;">
<span style="font-size: small;"><span style="font-family: "Courier New",Courier,monospace;">sudo apt-get update </span></span></div>
<div style="text-align: left;">
<span style="font-size: small;"><span style="font-family: "Courier New",Courier,monospace;">sudo apt-get install fuse-exfat</span></span></div>
</blockquote>
<br />Willhttp://www.blogger.com/profile/01725430562728194875noreply@blogger.com0tag:blogger.com,1999:blog-1058098923431120944.post-67886610041612734302013-01-17T10:52:00.002+10:002013-01-23T13:28:29.553+10:00Automated vSphere Daily Health Checks Using Python<br />
The on-call staff member in our team is tasked with performing morning health checks of key infrastructure. Basic stuff like checking that we have enough free space in the data stores and that we don’t have any forgotten snapshots running in the background.<br />
<br />
Doing these checks manually is a time consuming process so any kind of automation is a good thing™. Rather than logging onto each VMWare Server and manually inspecting the health of the VMWare host I’d rather have something automated. In this case I’ve opted for a script that does these checks for me. As a result it sends me an email in the morning using a traffic light system. Items that are “bad” or “need attention” are highlighted red. Items that are “good” are highlighted in green.<br />
<br />
The first version of this script performs basic health checks of the VMWare host. Specifically it checks which VMWare guests are running and which aren’t. It lists all of the snapshots on the system and which virtual machine they belong to. It also checks the data stores and highlights any data stores with less than 20% free space.<br />
<br />
In future versions I want the script to go through the logs and highlight any problems found on the VMWare host.<br />
<br />
The script is written in Python. Personally I run it from our Linux based monitoring server. I haven’t tested it on Windows however it should work just fine (in theory!). It uses a module called PySphere which needs to be installed on your system. This can be done by running the following command:<br />
<br />
sudo easy_install PySphere<br />
<br />
Next upload the script to a location where you place your scripts. The script isn’t path dependant so the location does not matter.<br />
<br />
Before running the script you will need to update it to match your environment. There’s a parameter section at the top of the script. You will need to update it such that it points to your vSphere server using the correct login credentials. You will also need to edit the SMTP information to use your email server with the relevant to and from email addresses.<br />
<br />
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizjHgEHoDvxGQuCAqHIVPA_LNRyD6IopRZINR3GyZA9aLMyyMoU-8AUZuuzXjAdkqo6RDGf7pYkkvmIW3VWcrCy3-6HgbR2KMrlY2-4tTJvg21eWMOBTkb6-V4cWvQvW-ulDKgSbF67ReE/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> # Connect to ESX Server and perform checks
__author__ = "William Brown"
__copyright__ = "Copyright 2013"
__credits__ = ["William Brown"]
__version__ = "1.0.0"
__maintainer__ = "William Brown"
__email__ = "william.brownw@gmail.com"
__status__ = "Production"
from pysphere import *
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
import datetime
# Change these parameters to match your environment
hostname = "hostname"
hostip = "ip address"
user = "username"
password = "password"
emailfrom = "fromaddress"
emailto = "emailtoaddress"
smtpsvr = "serveraddress"
vmserver = VIServer()
vmserver.connect(hostip, user, password)
def print_header():
html = "<html><head></head><body>"
html += "<h1>VMWare ESX Status Report - " + hostname + "</h1>"
html += "<table border=1><tr><td><b>Server Type:</b></td><td>" + vmserver.get_server_type() + "</td></tr>"
html += "<tr><td><b>VMWare Version:</b></td><td>" + vmserver.get_api_version() + "</td></tr>"
html += "<tr><td><b>IP Address:</b></td><td>" + hostip + "</td></tr>"
html += "<tr><td>Runtime</td><td>" + str(datetime.datetime.now()) + "</td></tr>"
html += "</table>"
return html
def print_vm_status():
html = "<h1>VMWare Guest Status Report</h1>"
html += "<table border=1><tr><th>VM Guest Name</th><th>Guest Status</th></tr>"
vmlist = vmserver.get_registered_vms()
for vm in vmlist:
vm_svr = vmserver.get_vm_by_path(vm)
if vm_svr.get_status() == "POWERED OFF":
html += "<tr bgcolor=#F78181><td>" + vm + "</td><td>" + vm_svr.get_status() + "</td></tr>"
else:
html += "<tr bgcolor=#81F781><td>" + vm + "</td><td>" + vm_svr.get_status() + "</td></tr>"
html += "</table>"
return html
def print_snapshot_status():
html = "<h1>Snapshot Status</h1>"
html += "<p>All snapshots are listed below. If there's no entries in this table, there's no snapshots!</p>"
html += "<table border=1><tr><th>Virtual Machine</th><th>Snapshot Name</th><th>Date Created</th><th>State</th></tr>"
vmlist = vmserver.get_registered_vms()
for vm in vmlist:
vm_svr = vmserver.get_vm_by_path(vm)
vm_snaps = vm_svr.get_snapshots()
for vm_snap in vm_snaps:
html += "<tr bgcolor=#F78181><td>" + vm + "</td>"
html += "<td>" + vm_snap.get_name() + "</td>"
html += "<td>" + vm_snap.get_create_time() + "</td>"
html += "<td>" + vm_snap.get_state() + "</td>"
html += "</table>"
return html
def print_datastore_status():
html = "<h1>Datastore Status</h1>"
html += "<p>Note: Datastores with less than 20% free space are highlighted in red</p>"
html += "<table border=1><tr><th>Datastore</th><th>Type</th><th>Capacity (GB)</th><th>Freespace (GB)</th><th>Uncommitted Space (GB)</th></tr>"
for ds_mor, name in vmserver.get_datastores().items():
props = VIProperty(vmserver, ds_mor)
percentfree = float(props.summary.freeSpace)/float(props.summary.capacity)
if percentfree < 0.2:
bgcolor="#F78181"
else:
bgcolor="#81F781"
if hasattr(props.summary, "uncommitted"):
html += "<tr bgcolor=" + bgcolor + "><td>"+str(name)+"</td><td>"+str(props.summary.type)+"</td><td>"+str(props.summary.capacity/1024/1024/1024)+"</td><td>"+str(props.summary.freeSpace/1024/1024/1024)+"</td><td>"+str(props.summary.uncommitted/1024/1024/1024)+"</td></tr>"
else:
html+="<tr bgcolor=" + bgcolor + "><td>"+str(name)+"</td><td>"+str(props.summary.type)+"</td><td>"+str(props.summary.capacity/1024/1024/1024)+"</td><td>"+str(props.summary.freeSpace/1024/1024/1024)+"</td><td>N/A</td></tr>"
html += "</table>"
return html
#print_header()
#print print_vm_status()
#print_datastore_status()
body = print_header()
body += print_vm_status()
body += print_snapshot_status()
body += print_datastore_status()
body += "</body></HTML>"
msg = MIMEMultipart('alternative')
#part1 = MIMEText('text', 'plain')
part2 = MIMEText(body,'html')
#msg.attach(part1)
msg.attach(part2)
msg['Subject'] = "VMWare Health Check - " + hostname + " - " + str(datetime.datetime.now())
msg['From'] = emailfrom
msg['To'] = emailto
s = smtplib.SMTP(smtpsvr)
s.sendmail( emailfrom, emailto, msg.as_string())
s.quit
</code></pre>
<br />
Finally you will need to setup a cron job (or windows scheduled task) to run this script as required. Personally I run this job first thing in the morning so that it’s in my inbox when I’m ready to do my morning checks.<br />
<br />
<br />
<br />
<br />
<br />Willhttp://www.blogger.com/profile/01725430562728194875noreply@blogger.com2tag:blogger.com,1999:blog-1058098923431120944.post-57907973491783609062013-01-11T07:26:00.002+10:002013-01-11T07:26:45.391+10:00Enable Remote Connections to MySQLBy default MySQL is configured in such a way that it won't accept remote connections. I'm guessing the is by design and a security feature. This makes sense because a lot of programs use a local MySQL database which should be secured from remote connections. Fortunately if you need to open up your MySQL database server it's an easy thing to do!<br />
<br />
<a name='more'></a>MySQL listens to incoming connections on port 3306 and by default, only listens on the localhost interface (127.0.0.1). To accept remote incoming connections we simply need to bind the service to the IP address the server will be accepting incoming connections on.<br />
<br />
First we need to edit the MySQL configuration file which can be found at /etc/mysql/my.cnf<br />
<br />
<blockquote class="tr_bq">
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">sudo nano /etc/mysql/my.cnf</span></blockquote>
</blockquote>
<br />
Next we're looking for a configuration line called bind-address. By default this is set to 127.0.0.1. Change it to the IP address your MySQL server instance will be accepting connections on. When done, save the file and restart the MySQL service.<br />
<br />
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">sudo service mysql restart</span></blockquote>
<br />
Now your MySQL server should be accepting remote connections. You can easily test this by trying to telnet to MySQL port from a remote machine using the following command:<br />
<br />
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">telnet <ipaddress> 3306</span></blockquote>
<br />
You should receive a jumble of characters in response which indicates a successful connection. If you receive a connection timeout then you have another issue. Check your settings and check there are no other services running which block connectivity (such as firewalls).<br />
<br />Willhttp://www.blogger.com/profile/01725430562728194875noreply@blogger.com0tag:blogger.com,1999:blog-1058098923431120944.post-29668261151315514252013-01-10T19:59:00.001+10:002013-01-23T10:21:06.560+10:00Monitoring Raspberry Pi Performance Using CactiThe Raspberry Pi is an incredible piece of hardware however, given it's limited resources it's important to squeeze every last drop of performance. This guide looks at using Cacti to monitor the performance of the Pi. By graphing the load on the system we can see how changes we make affect the performance of the Pi.<br />
<div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNUD_tAwV4WrSJJxS0WgbvVTvaR89eMZnZ2kxYBH-8JSuiLL3q3AB4_XRpPWxHM7Prb9DIUbgDtFV5jRRLnAoHugUQWE-Ha50D3wkIpZ67G_5iueSCv29tYATElWYqb24azvE_sitPD1A/s1600/RPi+-+Load+Averages+-+Daily.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNUD_tAwV4WrSJJxS0WgbvVTvaR89eMZnZ2kxYBH-8JSuiLL3q3AB4_XRpPWxHM7Prb9DIUbgDtFV5jRRLnAoHugUQWE-Ha50D3wkIpZ67G_5iueSCv29tYATElWYqb24azvE_sitPD1A/s400/RPi+-+Load+Averages+-+Daily.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
<a name='more'></a>Cacti (http://www.cacti.net/) is a pretty simple tool - it polls a list of devices every 5 minutes and takes measurements of several key performance indicators. The results are stored in data files which are then graphed and presented using a web interface. </div>
<div>
<br /></div>
<div>
Although Cacti is generally speaking a low resource monitoring tool it does use it's fair share of resources on the Raspberry Pi. For starters Cacti runs on top of both MySQL and Apache.</div>
<div>
<br /></div>
<div>
Installation is simple, just run the following command:</div>
<div>
<br /></div>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">sudo apt-get install cacti</span></blockquote>
<div>
<br /></div>
<div>
This installs all the dependencies including MySQL, PHP, and Apache.You'll be prompted to enter a password for the administrator, just pick whatever your password of choice is. The install takes a long time on the Pi so have some light entertainment on hand to keep you entertained whilst the install does it's thing. </div>
<div>
<br /></div>
<div>
Once it's done you can access cacti using the URL http://ipaddress/cacti. The default username password combination is admin:admin and you have to change it on first login. Leave the Cacti install for a good 10 to 15 minutes and then check the graphs tab. By default the local linux server is monitored but you need around 15 minutes of data (3 x 5 minute polls) to have some data to graph.</div>
<div>
<br /></div>
<div>
The main graph to watch is the one depicting the load values. There's a number of ways to interpret the load values but the most straight forward way to look at it is as a percentage on single CPU systems. So a load average of 1.0 is equivalent to the CPU being used all the time (100 percent). A load average of 2 means the CPU is running at 200%. Since the CPU can only run at 100% it means that there's enough workload outstanding for an additional CPU to be running at 100%. The goal, generally speaking, is to keep the load averages at 1 or below. On my poor little Raspberry Pi the 1 minute load average is constantly above 2 and the 15 minute load average is often over 8. </div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
</div>
Willhttp://www.blogger.com/profile/01725430562728194875noreply@blogger.com0