tag:blogger.com,1999:blog-81955220148664873942024-03-20T08:12:10.915-07:00SQL and more with KRUTIKrutihttp://www.blogger.com/profile/13385897521211871375noreply@blogger.comBlogger28125tag:blogger.com,1999:blog-8195522014866487394.post-71240570095069989572020-04-13T23:34:00.001-07:002020-04-13T23:35:31.860-07:00Importance of Basics <div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div class="MsoNormal">
<b>Riding a bicycle </b></div>
<div class="MsoNormal">
<b><br /></b></div>
<div class="MsoNormal">
<span style="color: black; font-size: 13.5pt; line-height: 107%;">Imagine
riding a bicycle and having zero knowledge how the handlebars are used for
direction, how the brakes are applied for friction, how the pedals are used for
motion. I could have given the example of a car but since I don't know how to
drive one you will have to bear with my experience of a bicycle <span style="font-family: "segoe ui emoji" , sans-serif;">đ</span>. And
now imagine if you were asked to ride a bicycle when you just managed to get the look and feel of what it is. Lets just say you entered the bicycle shop and sat on it and now your asked to go ahead take it for a ride. If your strong, confident and intelligent enough, sure you will gain
a sense on how to go forward but what will you do when you crash and brake of the
essentials parts of the bicycle. Then your stranded. <o:p></o:p></span><br />
<span style="color: black; font-size: 13.5pt; line-height: 107%;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGWn1LQzgUPDJZOXJ8XRS68svyq5rrY6CZKaoXTa2zniZuiebAfN7aw_HexXtdAxOXzUxT0BYB6LWdc0JFFU9QxRE1SkU3CLTNf56MqLbXEMjwZ2fB0JXAXEaNaJ69pTMpgSnmMcIMPwA/s1600/bicycle.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="181" data-original-width="213" height="271" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGWn1LQzgUPDJZOXJ8XRS68svyq5rrY6CZKaoXTa2zniZuiebAfN7aw_HexXtdAxOXzUxT0BYB6LWdc0JFFU9QxRE1SkU3CLTNf56MqLbXEMjwZ2fB0JXAXEaNaJ69pTMpgSnmMcIMPwA/s320/bicycle.jpeg" width="320" /></a></div>
<b style="font-size: 13.5pt;">How
do you learn then ?</b></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="color: black; font-size: 13.5pt; line-height: 107%;">Unless
off course, you keep having such mishaps and gradually learn the various parts
and functionalities, chances are you may never truly know what you rode. And how long would you want to hurt yourself and your bicycle. Funny way to learn isn't it, but most of us in the IT industry unfortunately and
precisely are doing this. </span></div>
<div class="MsoNormal">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHI6ymg39QpqlWvjUHSAXqYj8lgfDIk-KDvgIwO5M6f2ij6rOj5Zix17UcM0YDICkS4LoW5TYaW3bp0gmS5yelbJLRy7MIS5NyxRck8QLIoGd4-y5MmFqrBoYWgLnMVa9Ppg-rheZyzQ4/s1600/machinebike.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="900" data-original-width="742" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHI6ymg39QpqlWvjUHSAXqYj8lgfDIk-KDvgIwO5M6f2ij6rOj5Zix17UcM0YDICkS4LoW5TYaW3bp0gmS5yelbJLRy7MIS5NyxRck8QLIoGd4-y5MmFqrBoYWgLnMVa9Ppg-rheZyzQ4/s320/machinebike.jpg" width="263" /></a></div>
<span style="color: black; font-size: 13.5pt; line-height: 107%;">Not
only with their computers and technologies, but also self destructing the logical side of their brains, which is responsible for the âWHYâ questioning. When you follow the
orders blindly to reboot a system or performing a defined set of action to fix a problem, you are programming yourself not to be a good employee but rather a machine. </span><br />
<span style="font-size: 13.5pt;">Your
creativity, your innovations, your logical thinking & rational reasoning capability is what makes you a good employee. Hence it got me questing WHY did we loose it ? WHY explain technology when the basics are unclear ? WHY wait for accidents, endangering your
product, your people, your company in the process? </span></div>
<div class="MsoNormal">
<br />
<span style="font-size: 13.5pt;">Now Iâm a
firm believer of âDesperate times Desperate measuresâ but donât get me wrong
here,I am also a firm believer of âYou cant build a Great Building on a Weak
foundationâ</span><br />
<br /></div>
<div class="MsoNormal">
<span style="color: black; font-size: 13.5pt; line-height: 107%;"><b>Going
ahead</b></span><br />
<div class="separator" style="clear: both; text-align: center;">
<span style="color: black; font-size: 13.5pt; line-height: 107%;"><b><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6hIfEmbXJCpiY50_rpCqzwTcO9DV9UkU5RRBB85EksKzBAe-aQeB73lY0jY-UI552Tw4g0QdF-gPRH6YM0hyphenhyphen8J_xUFmmn13jqmse5mpxzXaNWwARu_wsXI-72Q1Es0R8ljQEZ6_-oF4E/s1600/GoodFoundations.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="180" data-original-width="240" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6hIfEmbXJCpiY50_rpCqzwTcO9DV9UkU5RRBB85EksKzBAe-aQeB73lY0jY-UI552Tw4g0QdF-gPRH6YM0hyphenhyphen8J_xUFmmn13jqmse5mpxzXaNWwARu_wsXI-72Q1Es0R8ljQEZ6_-oF4E/s200/GoodFoundations.jpg" width="200" /></a></b></span></div>
<span style="color: black; font-size: 13.5pt; line-height: 107%;"><o:p></o:p></span></div>
<div class="MsoNormal">
<ul style="text-align: left;">
<li><span style="color: black; font-size: 13.5pt; line-height: 107%;">So
hereâs a thought do what your doing, but make sure you have a justification for
yourself why your doing what your doing </span><span style="color: black; font-family: "segoe ui emoji" , sans-serif; font-size: 13.5pt; line-height: 107%;">đ</span><span style="color: black; font-size: 13.5pt; line-height: 107%;"> . </span></li>
<li><span style="color: black; font-size: 13.5pt; line-height: 107%;">This applies to who are reading this article and trust
me, it works across all domains. </span></li>
</ul>
<br />
<span style="color: black; font-size: 13.5pt; line-height: 107%;">A very humble friend used to keep telling me. âKruti
padhai karo padhai </span><span style="color: black; font-family: "segoe ui emoji" , sans-serif; font-size: 13.5pt; line-height: 107%;">đ</span><span style="color: black; font-size: 13.5pt; line-height: 107%;">â Translated in english "Kruti please
study". This was every time I approached him for an immediate fix to a technical problem. And my reaction was pretty much similar to yours, when your reading this. "Dude Iâm done with college and school days, give me the answer already, how to
solve this, times ticking" </span><br />
<span style="color: black; font-size: 13.5pt; line-height: 107%;"><br /></span>
<span style="color: black; font-size: 13.5pt; line-height: 107%;">And I never got my answers till I did my homework and asked him better
questions. Yes I did feel stranded in the moment, but it was not so bad. I researched, I learnt. The right way not being spoon fed and performing programmed actions</span><br />
<span style="color: black; font-size: 13.5pt; line-height: 107%;"><br /></span>
<span style="color: black; font-size: 13.5pt; line-height: 107%;">That was not a bad answer mind you, it was just a bad question. I did get my answers, when I asked him the right questions. Right questioning came after understanding why things work the way they work. Over the years I have understood the importance of WHYâs and till date I do thank
my friend to where it led me. Hell, we still work together very proudly ...</span></div>
<div class="MsoNormal">
<span style="color: black; font-size: 13.5pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="color: black; font-size: 13.5pt; line-height: 107%;"><b>Food
for the brains</b></span><br />
<div class="separator" style="clear: both; text-align: center;">
<span style="color: black; font-size: 13.5pt; line-height: 107%;"><b><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVZm1kAIPHoH85pd5Fosyib7_K4iEovq0HOJeKal2d7Rl3435DNrEm5nje6uBI1u8fXGfRYzw0mb2VwzXZHA11j44ClTVbPK-RO5jdPdp1ZURz3ovY8UsJBZpGCWLlck6O_darcrN8Db4/s1600/Bad+foundation.jpeg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="667" data-original-width="1000" height="133" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVZm1kAIPHoH85pd5Fosyib7_K4iEovq0HOJeKal2d7Rl3435DNrEm5nje6uBI1u8fXGfRYzw0mb2VwzXZHA11j44ClTVbPK-RO5jdPdp1ZURz3ovY8UsJBZpGCWLlck6O_darcrN8Db4/s200/Bad+foundation.jpeg" width="200" /></a></b></span></div>
<span style="color: black; font-size: 13.5pt; line-height: 107%;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="color: black; font-size: 13.5pt; line-height: 107%;">In
busy and ever so advancing times like these, very few will care to correct
you like my friend did and thatâs when you need to be your own teacher. Agreed
very less time but trust me very less knowledge of the basics & foundations, are way more disastrous in the course of time. So if you have not
got the answers to your WHYâs, when asked your peers or seniors go back and
invest in answering it yourself. Technology is abundant and so are various channels to learn. Chances are the ones you questioned, may also be reading
this article and researching with you. Far fetched thought but
yes âWHY NOT ? â <o:p></o:p></span><span style="font-family: "segoe ui emoji" , sans-serif; font-size: 18px;">đ</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="color: black; font-size: 13.5pt; line-height: 107%;">With
the invention of cloud there are millions of new terms/services/technologies you
will come across but underlying rules are common .Anything and everything to do
with a computer will have to do with the following components CPU/Memory/Hardware/Network
. Go recall back your computer fundamentals and basics and trust me that hasnât
changed much with the invention of cloud .</span><br />
<span style="color: black; font-size: 13.5pt; line-height: 107%;"><br /></span>
<span style="color: black; font-size: 13.5pt; line-height: 107%;"><b>In each of us lies that genius who can
explain the most complicated architecture or technology in these simple basics.
</b>Happy learning happy questioning </span><o:p></o:p></div>
<br /></div>
Krutihttp://www.blogger.com/profile/13385897521211871375noreply@blogger.com1tag:blogger.com,1999:blog-8195522014866487394.post-65638835341827993572019-11-23T10:23:00.002-08:002019-11-23T10:34:13.169-08:00SQL , Lift up your heads for the cloud - Azure SQL <div dir="ltr" style="text-align: left;" trbidi="on">
In my journey with Azure SQL Server I am often asked.<br />
<br />
1) Why should I move to cloud ?<br />
2) Which model should I go for ?<br />
3) What do I need to do if my SQL server is on cloud ?<br />
<br />
While all the answers are out there in many cloud forums and websites people often tend to forget the basics. They are <b>What,When,Where, How</b> and obviously the big <b>Y</b>.So lets address them one by one.<br />
<br />
<h2 style="margin: 0in;">
<span style="font-family: "georgia" , "times new roman" , serif;"><i><u>Why Should I move to Cloud?</u></i></span></h2>
<div>
Was any <b>Y</b> ever answered in a one liner ?<br />
Weren't they always in the answer in brief section ? đ<br />
<br />
<b><i><u>What :</u></i></b> Cloud in literal terms is a layer, a carrier of your services.<br />
It can provide you Hardware to access if you like <b>(Infrastructure as a service/ IAAS)</b>,<br />
It can provide you a mix of both Hardware and Software to some extent <b>(Platform as a service/PAAS)</b><br />
or It can provide only the Software for you to work with <b>(Software as a Service/SAAS)</b><br />
<br />
<b><i><u>When :</u></i></b> You can choose to move to cloud after having discussed with your stakeholders and decision makers keeping in mind your end customers. It always helps to do your homework before the <b>TESTS </b>and not during the <b>TESTS (Yes your DEV, UAT, SIT,Pre-Prod and Prod servers/apps) . </b>And by that I mean familiarizing yourself with the pros and cons of the technology you will choose or propose to your clients.<br />
<b><br /></b>
<u><i><b>Where :</b></i></u> As a consumer of Azure services myself I would say Microsoft Azure. But you all must be aware, that cloud is everywhere. So you can choose from lot of vendors once you decide the model. Your vendor SLA's and prices essentially governs your choice.<br />
<br />
<u><i><b>How :</b></i></u> There are a variety of tools you can choose from, references to which are at the end of this section. I want to ensure I help you in your homework.<br />
<br />
<b><u><i>Why :</i></u></b> The key lies in the amount of control you would like to retain for the hardware, software, applications and most importantly the peace of mind.Not just for your clients but your bosses,co-workers, employees and you. Here are a few points which highlight the <b>why's </b><br />
<ul style="text-align: left;">
<li><b>One should move to cloud if one can see the cloud</b> and you are visionary (That's my personal thought I know some may think and see differently đ No awards or perks for anyone who wishes to debate) </li>
<li>One should choose cloud if their hardware and software needs monitoring and control 24*7. </li>
<li>One should move to cloud as you never know, when calamity strikes. </li>
<li>And if and when it does you cannot be expected to think of your office and clients instead of your own safety and your loved ones well-being.</li>
<li>One should move to cloud if you intend to be happy, along with making your clients happy and your workers happy.</li>
</ul>
<div>
I'm hoping after this you will be advancing to cloud. Let me help you in understanding the next steps</div>
<div>
<br /></div>
<h2 style="margin: 0in;">
<span style="font-family: "georgia" , "times new roman" , serif;"><i><u>Which model should I go for?</u></i></span></h2>
<div>
<b>The extent of management and administration will vary</b> based on the model you choose <b>(IAAS/PAAS/SAAS). </b>This will also matter in the amount of labor hours and cost an organization saves in genera. <b>The saved resources</b> can be utilized to <b>focus on upgrading and up scaling to something bigger, better and faster efficiently.</b></div>
<br />
You may have come across the below diagram many a times<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZVVSxVE-GPevXaPBPdQPueyYf7DNy8GEY3621zA7qL3sQ2mMQS2nCllaa-d8WFK072AnTYblnmgk0Rh32Qmqbiol512m2HOlrGmsvRCUUQ2i6cuoTgUF5SRGUH8KDolTV6_2kZhM1dV8/s1600/Model.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="745" data-original-width="1001" height="297" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZVVSxVE-GPevXaPBPdQPueyYf7DNy8GEY3621zA7qL3sQ2mMQS2nCllaa-d8WFK072AnTYblnmgk0Rh32Qmqbiol512m2HOlrGmsvRCUUQ2i6cuoTgUF5SRGUH8KDolTV6_2kZhM1dV8/s400/Model.JPG" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
To make simpler than it already is here is how you choose<br />
<br />
<b style="background-color: cyan; font-family: georgia, "times new roman", serif;"><i>IAAS -> Infrastructure as a Service</i></b><br />
1) Do you want to be in complete control of your entire machine (CPU, Memory, RAM, Disks, I/O)<br />
2)Do you want to be in complete charge of what goes in and out of the machine (CPU, Memory, RAM, Disks, I/O) ?<br />
3) Are you not OK sharing any Software or controllable Hardware?<br />
If the answer is yes. <b>Your model is IAAS. </b><br />
<ul style="text-align: left;">
<li>Clearly since only you can go in and out of the machine only you can install or uninstall products thus managing the applications deployed on the machine. </li>
<li><b style="background-color: cyan;">The provider is responsible to ensure at all times, you have the Machine up and running.</b></li>
<li><b style="background-color: cyan;">You will not loose your Configuration of the Machine</b></li>
</ul>
<br />
<b style="background-color: cyan; font-family: georgia, "times new roman", serif;"><i>PAAS -> Platform as a Service</i></b><br />
1)<b> </b>Do you want to be in control of the platform but not pay for the whole machine (CPU,Memory,RAM,Disks,I/O) ?<br />
2) Do you want someone to ensure your platform is up and running all the time. Irrespective of your machine,where precisely and how they get deployed?<br />
<div>
3) Are you OK with sharing the machines as long as your applications, its design and data are accessible to only to you ?</div>
If the answer is yes. <b>Your model is PAAS. </b><br />
<ul style="text-align: left;">
<li>Clearly you are on a shared hardware you may not be be able to set the CPU,Memory,RAM,I/O directly. </li>
<li>But through a careful choice of options you can control the amount of the hardware you can select from. </li>
<li><b style="background-color: cyan;">The provider is responsible to ensure your Platform is up and running. Even if the underlying Machine breaks down. </b></li>
<li><b style="background-color: cyan;">You will not loose your Design and Data for the applications</b></li>
</ul>
<br />
<b style="background-color: cyan; font-family: georgia, "times new roman", serif;"><i>SAAS -> Software as a Service</i></b><br />
1) Do you want to be in control of the service but not pay for the whole machine or the products installed on it (CPU,Memory,RAM,I/O + Applications)<br />
2) Are you OK sharing but you want to ensure the services are up all the time ?<br />
If the answer is yes. <b>Your model is SAAS. </b><br />
<ul style="text-align: left;">
<li>Clearly you are on a shared hardware you may not be be able to set the CPU,Memory,RAM,I/O directly. </li>
<li>Neither can you choose the way the platform is designed or the way data is stored.</li>
<li><b style="background-color: cyan;">The provider is responsible to ensure your Services are running at all times. Even if the underlying Machine breaks down or the Platform changes.</b></li>
<li><b style="background-color: cyan;">You will not loose your access to the Service. </b></li>
</ul>
<br />
<h2 style="margin: 0in;">
<span style="font-family: "georgia" , "times new roman" , serif;"><i><u>What do I need to do if my SQL server is on cloud?</u></i></span></h2>
</div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"></span><br />
<div style="font-family: "Times New Roman";">
<span style="font-family: "georgia" , "times new roman" , serif;">You need to do precisely what you are not paying for </span></div>
<span style="font-family: "georgia" , "times new roman" , serif;">
<div style="font-family: "Times New Roman";">
And be in control of what your cloud provider does for you.</div>
<div style="font-family: "Times New Roman";">
<br /></div>
<div style="font-family: "Times New Roman";">
<b>IAAS: </b>If you paying only for the Machine, you manage the platform & applications on it</div>
<div style="font-family: "Times New Roman";">
(Provider will also have access to ensure continuity of your access to the machine)</div>
<div style="font-family: "Times New Roman";">
<b>PAAS: </b>If you are paying for the Platform, you manage the design of your application, data and who access it. </div>
<div style="font-family: "Times New Roman";">
(Provider will also have access to ensure continuity of your access to the platform)</div>
<div style="font-family: "Times New Roman";">
<b>SAAS: </b>If you are paying for the Services, you manage on the end users who access/avail it</div>
<div style="font-family: "Times New Roman";">
(Provider will also have access to ensure continuity of your access to the services)</div>
<div style="font-family: "Times New Roman";">
<br /></div>
<div style="font-family: "Times New Roman";">
Enough talking lets get doing :)So here are the links for how to and a further reads</div>
<div style="font-family: "Times New Roman";">
<br /></div>
<div style="font-family: "Times New Roman";">
When referencing the below links ensure you are checking for the latest update dates. You cannot expect things not to change in the Azure world. Ensure you check when the <span style="color: red;"><u>page was last modified </u></span>before you implement the steps and procedures. Never forget to <u><span style="color: #38761d;">thank the ones you find helpful</span>. </u></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh63-IzDfWaYtnuw9JqqVk2qPqQNzLIQZ8nwIRLnsn3ywFk27sLZlWcM6Vdc9SKnrKRs2CSU7JiQQF_ztjIPNukQ0M7mSoXfK96DCZQ7Y8IeLI7yWh0q5Pn0ezzRdftm-CJ5yMLhupV8Bk/s1600/references.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="81" data-original-width="825" height="38" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh63-IzDfWaYtnuw9JqqVk2qPqQNzLIQZ8nwIRLnsn3ywFk27sLZlWcM6Vdc9SKnrKRs2CSU7JiQQF_ztjIPNukQ0M7mSoXfK96DCZQ7Y8IeLI7yWh0q5Pn0ezzRdftm-CJ5yMLhupV8Bk/s400/references.jpg" width="400" /></a></div>
<div style="font-family: "Times New Roman";">
<br /></div>
<div style="font-family: "Times New Roman";">
What goes around comes around. Lets spread a little appreciation shall we? Feel free to provide feedback's, there are people listening.</div>
<div style="font-family: "Times New Roman";">
<br /></div>
<div style="font-family: "Times New Roman";">
<b><u style="background-color: lime;">IAAS / PAAS SQL Server</u></b></div>
<div style="font-family: "Times New Roman";">
<b><u style="background-color: lime;"><br /></u></b></div>
<div style="font-family: "Times New Roman";">
<b>Documents</b></div>
<div style="font-family: "Times New Roman";">
<a href="https://docs.microsoft.com/en-us/azure/sql-database/sql-database-paas-vs-sql-server-iaas">https://docs.microsoft.com/en-us/azure/sql-database/sql-database-paas-vs-sql-server-iaas</a></div>
<div style="font-family: "Times New Roman";">
<a href="https://docs.microsoft.com/en-in/azure/sql-database/sql-database-features">https://docs.microsoft.com/en-in/azure/sql-database/sql-database-features</a></div>
<div style="font-family: "Times New Roman";">
<a href="https://docs.microsoft.com/en-in/azure/sql-database/sql-database-transact-sql-information">https://docs.microsoft.com/en-in/azure/sql-database/sql-database-transact-sql-information</a></div>
<div style="font-family: "Times New Roman";">
<b>Videos</b></div>
<div style="font-family: "Times New Roman";">
<a href="https://channel9.msdn.com/Series/SAIIK-SQL-Server-on-Azure-IaaS-Implementation-Kit/SAIIK-PaaS-vs-IaaS">https://channel9.msdn.com/Series/SAIIK-SQL-Server-on-Azure-IaaS-Implementation-Kit/SAIIK-PaaS-vs-IaaS</a></div>
<div style="font-family: "Times New Roman";">
<br /></div>
<div style="font-family: "Times New Roman";">
<b><u style="background-color: lime;">IAAS SQL Server</u></b></div>
<div style="font-family: "Times New Roman";">
<br /></div>
<div style="font-family: "Times New Roman";">
<b>Documents</b></div>
<div style="font-family: "Times New Roman";">
<a href="https://docs.microsoft.com/en-us/azure/virtual-machines/windows/sql/virtual-machines-windows-sql-server-iaas-overview">https://docs.microsoft.com/en-us/azure/virtual-machines/windows/sql/virtual-machines-windows-sql-server-iaas-overview</a></div>
<div style="font-family: "Times New Roman";">
<a href="https://docs.microsoft.com/en-us/azure/virtual-machines/windows/sql/virtual-machines-windows-migrate-sql">https://docs.microsoft.com/en-us/azure/virtual-machines/windows/sql/virtual-machines-windows-migrate-sql</a></div>
<div style="font-family: "Times New Roman";">
<b>Videos</b></div>
<a href="https://channel9.msdn.com/Series/SQL-Server-in-Windows-Azure-Virtual-Machines">https://channel9.msdn.com/Series/SQL-Server-in-Windows-Azure-Virtual-Machines</a><br />
<br />
<br />
<div style="font-family: "Times New Roman";">
<u><b style="background-color: lime;">PAAS SQL Server</b></u></div>
<div style="font-family: georgia, "times new roman", serif;">
<div style="font-family: "Times New Roman";">
<br /></div>
<div style="font-family: "Times New Roman";">
<b>Documents</b></div>
<div style="font-family: "Times New Roman";">
<a href="https://docs.microsoft.com/en-us/azure/sql-database/">https://docs.microsoft.com/en-us/azure/sql-database/</a></div>
<div style="font-family: "Times New Roman";">
<a href="https://docs.microsoft.com/en-us/azure/sql-database/sql-database-single-database-quickstart-guide">https://docs.microsoft.com/en-us/azure/sql-database/sql-database-single-database-quickstart-guide</a></div>
<div style="font-family: "Times New Roman";">
<a href="https://docs.microsoft.com/en-us/azure/sql-database/sql-database-managed-instance-quickstart-guide">https://docs.microsoft.com/en-us/azure/sql-database/sql-database-managed-instance-quickstart-guide</a></div>
<div style="font-family: "Times New Roman";">
<b>Videos</b></div>
<div style="font-family: "Times New Roman";">
<a href="https://channel9.msdn.com/Series/Windows-Azure-SQL-Database">https://channel9.msdn.com/Series/Windows-Azure-SQL-Database</a></div>
<div style="font-family: "Times New Roman";">
<br /></div>
<div style="font-family: "Times New Roman";">
<u><b style="background-color: lime;">Azure Database Migration Services</b></u></div>
<div style="font-family: "Times New Roman";">
<u><b style="background-color: lime;"><br /></b></u></div>
<div style="font-family: "Times New Roman";">
<b>Documents</b></div>
<div style="font-family: "Times New Roman";">
<a href="https://docs.microsoft.com/en-us/azure/dms/">https://docs.microsoft.com/en-us/azure/dms/</a></div>
<div style="font-family: "Times New Roman";">
<b>Videos</b></div>
<div style="font-family: "Times New Roman";">
On the same page you will find the repository for videos</div>
<div style="font-family: "Times New Roman";">
<br /></div>
</div>
</span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"></span><br />
<div style="font-family: "Times New Roman";">
</div>
<span style="font-family: "georgia" , "times new roman" , serif;">
</span></div>
</div>
Krutihttp://www.blogger.com/profile/13385897521211871375noreply@blogger.com1tag:blogger.com,1999:blog-8195522014866487394.post-78484637996762340742019-11-23T05:48:00.003-08:002019-11-23T10:39:16.411-08:00Back for More with SQL, Azure, Machine Learning, Big Data!!!!<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal">
<span style="font-family: "georgia" , serif;"><span style="font-size: 12pt; line-height: 18.4px;">Let me start with an apology for being missing so long :) Guess was trying to find where technology takes me as I started my journey with the pool of products that Microsoft had to offer me!!! Every now and then however I would refer to my own blogs because the RAM of a human brain has limited capacity, it can only store this much....</span></span><br />
<span style="font-family: "georgia" , serif;"><span style="font-size: 12pt; line-height: 18.4px;"><br /></span></span>
<span style="font-family: "georgia" , serif;"><span style="font-size: 12pt; line-height: 18.4px;">I bet you all would agree ,with the technology ever so evolving I need to bring my feet back to the ground where it all began.</span></span><br />
<span style="font-family: "georgia" , serif;"><span style="font-size: 12pt; line-height: 18.4px;">Learning, sharing, </span></span><span style="font-family: "georgia" , serif; font-size: 16px;">teaching, </span><span style="font-family: "georgia" , serif; font-size: 12pt;">updating and repeating. </span><br />
<span style="font-family: "georgia" , serif; font-size: 12pt;">Thanks Surabhi for being my pillar and ensuring I never stop. </span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhd7ZdH8Na1B5CxBbaeEchpJAn1acYal91ZJhkd9QD_cyslpx-EvJQXSlDdO6CImWA3r314wc2nLowIVD0FFVcxhvpWTJ-jISN27q3p9HYd2Q9iCCOXO3RLXIH8UtExlbtPvBoPfME91v0/s1600/C_31762194_1757367434323023_6260959653434228736_o.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="1540" data-original-width="1362" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhd7ZdH8Na1B5CxBbaeEchpJAn1acYal91ZJhkd9QD_cyslpx-EvJQXSlDdO6CImWA3r314wc2nLowIVD0FFVcxhvpWTJ-jISN27q3p9HYd2Q9iCCOXO3RLXIH8UtExlbtPvBoPfME91v0/s320/C_31762194_1757367434323023_6260959653434228736_o.jpg" width="283" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<span style="font-family: "georgia" , serif; font-size: 12pt;">With every year you kept me going and still keep me going..</span><br />
<span style="font-family: "georgia" , serif;">So what's the update I bring you for this blog ? SQL and more with Kruti </span><span style="font-family: "georgia" , serif;">will have upcoming series based on the following </span><br />
<span style="font-family: "georgia" , serif;">1) More about SQL , lift up your heads for cloud</span><br />
<span style="font-family: "georgia" , serif;">2) Bringing out magic from data in cloud.</span><br />
<span style="font-family: "georgia" , serif;">3) The science of making machines learn ?</span><br />
<br />
<span style="font-family: "georgia" , serif;">I'm super excited as I start again. Hope you are too !!!!</span></div>
</div>
Krutihttp://www.blogger.com/profile/13385897521211871375noreply@blogger.com0tag:blogger.com,1999:blog-8195522014866487394.post-11118664905383244382016-04-10T21:41:00.003-07:002016-04-10T21:41:41.528-07:00Unix Basic Commands<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Georgia, Times New Roman, serif;">In similar context to my previous blog I'm providing a list of UNIX basic commands which you may find handy if your new to the UNIX world.</span><br /><br /><span style="font-family: "georgia" , "times new roman" , serif;"><b><i style="background-color: cyan;">UNIX Help Command</i></b></span><br />
<ul style="text-align: left;">
<li><span style="font-family: "georgia" , "times new roman" , serif;">man <command></span></li>
<li><span style="font-family: "georgia" , "times new roman" , serif;">man man âgives details of the man command</span></li>
</ul>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i style="background-color: cyan;">UNIX File Operations Commands</i></b><br /><i><br /><u><b>Piping operators for I/O redirection</b></u></i><ul style="text-align: left;">
<li>>file -Make file the standard output</li>
<li><file -Make file the standard input</li>
<li>>>file -Make file standard output & append its contents</li>
<li><<word -Take shell input upto the first line containing the word or EOF</li>
<li>Cmd1 | cmd2 âTake the output of cmd1 & supply it as input for cmd2.</li>
</ul>
<u><b><i>Viewing a file </i></b></u><ul style="text-align: left;">
<li>Find /dir1 /dir2 âname A* -print â Finds all the files beginning with A in the directories dir1 & dir2 & prints them</li>
<li>Cat <file></li>
<li>Touch <filename> -Create an empty file</li>
<li>Cat file1 file2> file3 - File 3 if existing will get overwritten with contents of file 1 & then file 2.File 3 if non-existent will be created with the above contents.</li>
<li>>>file3- Contents of file3 will be appended instead of overwritten.</li>
</ul>
<u><b><i>Copying a file</i></b></u><br /><ul style="text-align: left;">
<li>Cp source_file1 destination_file2 - Copies the source file1 to destination file2</li>
<li>Cp file1 file2 file 3 /etc/bin/dump - Copies the list of files (1,2,3) in current directory to the folder /etc/bin/dump</li>
<li>Cp /etc/tmp/file1 /etc/dump/file1</li>
</ul>
<u><b><i>Removing a file (In windows context-deleting a file)</i></b></u><ul style="text-align: left;">
<li>Rm file1 </li>
<li>Rm âI file1 - You are asked confirmation to delete the file.</li>
<li>Rm âr dir1 - Recursive directory content deletion</li>
</ul>
<u><b><i>Moving a file (In windows context-renaming a file)</i></b></u></span><div>
<ul style="text-align: left;">
<li><span style="font-family: georgia, 'times new roman', serif;">Mv file_old file_new â Renames file_old with the new name file_new</span></li>
<li><span style="font-family: georgia, 'times new roman', serif;">Mv dir_oldname dir_newname âRenames directory in similar fashion</span></li>
</ul>
<span style="font-family: "georgia" , "times new roman" , serif;"><u><i><b>Listing files</b></i></u><br /><ul style="text-align: left;">
<li>Ls â Lists files in the alphabetical order</li>
<li>Ls âl - Long listing of files</li>
<li>Ls âA âShow hidden files as well</li>
</ul>
<u><i><b>Permissions Weight </b></i></u><br /><br /><table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: none; margin-left: 16.65pt; mso-border-alt: solid windowtext .5pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext; mso-padding-alt: 0in 5.4pt 0in 5.4pt;">
<tbody>
<tr style="height: 47.15pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="border: solid windowtext 1.0pt; height: 47.15pt; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 115.3pt;" valign="top" width="154">
<div class="MsoNormal">
<span lang="EN-GB">Permissions Weight <o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB">Read (r) 4<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB">Write (w) 2<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB">Execute(x) 1<o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<br /><b><i><u>Assigning permissions to a file</u></i></b><br /><ul style="text-align: left;">
<li>Chmod 741 myfile â Grants owner (4+2+1) all permissions on my file. Grants group of the owner (4) read permission on the file.Grants rest of the users (1) execute permission on the file </li>
<li>Chmod go+rw u=r file1- Add the read & write priveledge to owner & group users. Grants only read permission to the rest of the users to file1 </li>
<li>syntax(chmod [o,g,u] [+/-/=] [permissions] file</li>
</ul>
</span><span style="font-family: Georgia, Times New Roman, serif;">-Read permission required for a directory to view the files it contains.<br />-Execute permission required for a target directory to change the current directory to the target directory.</span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="font-family: Georgia, Times New Roman, serif;"><br /></span><b style="font-family: georgia, 'times new roman', serif;"><i>Commands for directories</i></b><ul style="font-family: georgia, 'times new roman', serif; text-align: left;">
<li>Mkdir dir_name â Creates the directory in the current working directory</li>
<li>Pwd - Returns the current working directory</li>
<li>Rmdir dir_name- Removes the directory provided its empty</li>
</ul>
</span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><span style="font-family: Georgia, Times New Roman, serif;"><br /></span></i></b></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><span style="background-color: cyan; font-family: Georgia, Times New Roman, serif;">UNIX File Manipulation Commands</span></i></b><br /><br /><u style="font-family: georgia, 'times new roman', serif;"><i><b>Metacharacters used for manipulation operations</b></i></u><ul style="font-family: georgia, 'times new roman', serif; text-align: left;">
<li> ?- symbol signifies a single character</li>
<li>*- Inpresence or absence of any number of character which exists at the place of *.</li>
<li>[abcd]*- matches records starting with the range (in this case a,b,c,d)</li>
<li>![abcd]*-matches records not starting with the above range.</li>
</ul>
<span style="font-family: georgia, 'times new roman', serif;"><i><b><u>Commands for viewing contents of the files</u></b></i></span><br /><ul style="font-family: georgia, 'times new roman', serif; text-align: left;">
<li>Wc -lwc file1 -Counts the number of lines, words & characters in file1</li>
<li>nl file1 -Add line numbers to the file1</li>
<li>Cat file1 -Concatenates & displays files </li>
<li>Head -15 file1 -Displays the first 15 lines of file1</li>
<li>Tail -15 file1 -Displays the last 15 lines of file1</li>
<li>Uniq file1 -Reports repeated lines of file1</li>
</ul>
<u style="font-family: georgia, 'times new roman', serif;"><i><b>Viewing modified contents</b></i></u><br /><ul style="font-family: georgia, 'times new roman', serif; text-align: left;">
<li>Sort file1 file2 file3 -Sorts contents in all the 3 files alphabetically and displays output in terminal.</li>
<li>Sort âm âoresults file1 file2 -Merges output for already sorted files (file1,file2) and sends output to file results.</li>
<li>Sort âr +1 -3 file3 - Reverse sort starting at the 2nd field (+1), ending at 3rd field(-3) for File3.</li>
<li>Cut âf 2,3 âd â:â file1 -Cut picks the 2nd & 3rd field for the file1 delimited by the : (colon) symbol & displays output at the terminal.</li>
<li>GREP (globally search an expression & print it)</li>
<li>Grep âsearch this patternâ âi-n file1 file2. Searches for the pattern in quotes for file1 & file2. -n will include the entire line to be displayed. âi makes it case sensitive.</li>
<li>Who |tee logfile| sort - Tee is used in place where the output is to be redirected to a file as well as supplied as an input to the next command. Here tee command will send the output of âwhoâ command to logfile as well as supply the same output to the âsortâcommand & display the sorted results in terminal.</li>
</ul>
<b><i style="background-color: cyan;"><span style="font-family: Georgia, Times New Roman, serif;"><div>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i style="background-color: cyan;"><br /></i></b></span></div>
UNIX Terminal Users commands</span></i></b><br /><ul style="font-family: georgia, 'times new roman', serif; text-align: left;">
<li>Logname âPrints the logname of the user</li>
<li>Uname âPrints the name of the unix system</li>
<li>Uname âm - Prints the machine model ( eg: i686)</li>
<li>Uname-r -Prints the kernel version</li>
<li>Hostname -Returns hostname of the machine</li>
<li>Hostname <machinename> -Returns the ip of the machine.</li>
<li>/sbin /inconfig â as good as ipconfig for windows</li>
<li>Rsh <host> <command> -Execute command on host.</li>
<li>Ssh <host> -Start terminal session on host</li>
<li>telnet <host> -start terminal session on host</li>
<li>Sync -Forces the buffer cache & the page cache to write all the dirty pages to the disk.</li>
<li>Shutdown/shu <mode> <delay>- Does a graceful shutdown of the system, modes -r for reboot,-h for halting, delay accepts number in seconds to wait till shutdown.Else mention ânowâ to send a warning message to all users about shutdown.</li>
<li>Dmesg -View boot messages</li>
<li>Cat /etc/passwd -Lists information for all the users on the system</li>
<li>Printenv /enc- prints all the environment variables</li>
</ul>
</span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i style="background-color: cyan;"><br /></i></b></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i style="background-color: cyan;"><span style="font-family: Georgia, Times New Roman, serif;">UNIX process related commands</span></i></b><br /><ul style="font-family: georgia, 'times new roman', serif; text-align: left;">
<li>Ps -a -Lists all the processes; from all the users (-a option) that are running at the current instance. </li>
<li>Ps âf ât tty3 â Shows a full listing of all the processes that are running from terminal (tty3).</li>
<li>Ps âu user1 âShows all the processes that are running under the user (user1).</li>
<li>Daemon processes are constantly running in the background.</li>
<li>Sort file1 > file2& - this command will be forced to run in the background due to the â&â symbol at the end & will return the PID number when you hit enter.</li>
</ul>
<span style="font-family: georgia, times new roman, serif;">¡ Note: use the PID to track the completion of the process. The output should always be redirected to a file.</span><br /><ul style="font-family: georgia, 'times new roman', serif; text-align: left;">
<li>Nohub sort file1> file2 âthe command is executed in the background & guaranteed execution completion even if we logout.NOHUB stands for no hang ups</li>
<li>At <option> time â Runs the job specified by <option> at the time. Once you hit enter after the âatâ command you may enter the job definition. Once you hit Ctrl+d after giving the job details you will receive the job id number. Options âl is used for listing of the jobs & -r for removing of the jobs</li>
<li>At now+1 day <cmdfile - now the âatâ command will execute the commands in the cmdfile after a day.</li>
<li>/users/lib/cron/at.allow file contains the list of users who are permitted to execute âatâcommand. Similarly at.deny file contains list of users who are not permitted to execute the âatâ command</li>
<li>Batch <option> time âRuns the command when the load average drops below 8,optionally after the set Time.</li>
<li>Crontab cmdfile âexecutes the job script in cmdfile at the schedule mentioned in the cmdfile. Options âl is used for listing of the jobs & -r for removing of the jobs</li>
</ul>
<span style="font-family: georgia, times new roman, serif;">Time format : Minute |Hour| DayofMonth|Month of the year|Day of the Week|Command</span><br /><span style="font-family: georgia, times new roman, serif;">Eg : cat >cmdfile</span></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="font-family: georgia, times new roman, serif;">30 9 1 * * echo âwork hardâ</span><br /><span style="font-family: georgia, times new roman, serif;">Ctrl +d</span><br /><span style="font-family: georgia, times new roman, serif;">Crontab will echo the message at 9.30AM (30 9 1 * *) on first of every month (30 9 1 * *)</span><br /><span style="font-family: georgia, times new roman, serif;">â*â denotes all possible values. Sunday is represented as â0â in the âDay of weekâ</span><ul style="font-family: georgia, 'times new roman', serif; text-align: left;">
<li>/users/spool/cron/crontabs stores the lists of crons scheduled </li>
<li>/users/lib/cron/cron.allow file contains the list of users who are permitted to execute âcrontabâcommand. Similarly cron.deny file contains list of users who are not permitted to execute the âcrontabâ command</li>
</ul>
<b><i><div style="font-family: georgia, 'times new roman', serif;">
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><br /></i></b></span></div>
<span style="background-color: cyan;"><span style="font-family: Georgia, Times New Roman, serif;">UNIX important directories</span></span></i></b><ul style="font-family: georgia, 'times new roman', serif; text-align: left;">
<li>/etc/shadow âContains the encrypted passwords for the user. Only viewable by the root user.</li>
<li>/var/long - Location for most of the system log files</li>
<li>/etc/inittab â Location of system configuration files</li>
<li>/etc/brc -Executed at startup by init</li>
<li>/etc/hosts âList of hosts that the system is aware about.</li>
<li>/usr/lib/cron/log âLog of cron processing</li>
<li>/usr/spool/cron/crontabs âEvent list for cron</li>
<li>/etc/mnttab -List of mounted file systems</li>
<li>/etc/rc -Startup shell script executed by init</li>
<li>/etc/profile âCustom shell script executed by init</li>
<li>/etc/sysctl.conf âCompiled in kernel parameters</li>
</ul>
</span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><i><b><br /></b></i></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><i><b style="background-color: cyan;"><span style="font-family: Georgia, Times New Roman, serif;">UNIX file system related commands</span></b></i><ul style="font-family: georgia, 'times new roman', serif; text-align: left;">
<li>mount <option> <dev> <mount_point> -Mounts a file system on device <dev> at <mount_point> with the <options> specified.</li>
<li>unmount <dev>/<mount_point> -Unmounts the file system or device.</li>
</ul>
<b><i><span style="font-family: Georgia, Times New Roman, serif;"><div>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><br /></i></b></span></div>
<span style="background-color: cyan;">UNIX system monitoring commands</span></span></i></b><ul style="font-family: georgia, 'times new roman', serif; text-align: left;">
<li>lsmod -Show currently loaded modules</li>
<li>insmod -Load a module</li>
<li>rmmod âUnload a module</li>
<li>ipcs <option> - Option âm shows the current usage of shared memory, -s usage of semaphores</li>
<li>du -Reports directory-wise disk usage</li>
<li>df -Reports directory-wise disk free space</li>
<li>dfspace -Reports free disk-space in terms of MB.</li>
<li>sar <option> <interval> <count> - Reports the system activity, option âq shows the CPU </li>
<li>queue, -u shows the CPU utilization, -d shows the device activity.</li>
<li>vmstats <interval> <count> -Shows the virtual memory stats</li>
<li>iostats <option><interval><count> -shows the i/o statistics, option âd for device activity. -c </li>
<li>for CPU activity, -x for extended disk activity.</li>
</ul>
</span></div>
</div>
Krutihttp://www.blogger.com/profile/13385897521211871375noreply@blogger.com1tag:blogger.com,1999:blog-8195522014866487394.post-87541415474272392952016-04-08T23:27:00.000-07:002016-04-10T21:46:22.378-07:00VI Editor Basic Commands<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "georgia" , "times new roman" , serif;">A few months back I came across an instance of using VI Editor. Trust me being a SQL DBA it was quite a task to remember the editing commands. So I made myself a list of commands that came in handy. Off course you may find amples of site providing the same info. Am sharing across my list hoping it may be helpful.</span><br />
<div>
<br />
<b><i><span style="font-family: "georgia" , "times new roman" , serif;"> Basics </span></i></b></div>
<div>
<ul style="text-align: left;">
<li><span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;">VI stands for visual editor. </span></span></li>
<li><span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;">Can handle text files. </span></span></li>
<li><span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;">Its case-sensitive. Needs to be dealt with care as no error messages appear like while executing SQL queries or UNIX commands. </span></span></li>
</ul>
<br />
<div class="MsoNormal">
<b><i><u><span lang="EN-GB" style="background-color: cyan; font-size: 16pt; line-height: 115%;">VI editor modes of operation</span></u></i></b></div>
<div class="MsoNormal">
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><span style="font-size: 21.3333px; line-height: 24.5333px;">-></span> Command Mode</i></b></span></div>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br />In this mode all the keys pressed by the user are considered as executable commands. Once the Vi editor is invoked it enters into the command mode. To return to command mode from any of the below mode press âESCâ key.</span></span><br />
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><br />-> Insert Mode</i></b></span><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br />This mode permits insertion of new text, editing of the existing text & replacing of the existing text for the file.<br />To enter in the insert mode by selecting any of the below keys.</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">I, i, A, a, O, o, R, r, C, c</span><br />
<br />
<b><i><span style="font-family: "georgia" , "times new roman" , serif;">-> Ex Command Mode</span></i></b><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">This mode permits the user to give commands at the command line (the bottom line of the vi editor screen). <br />The command line is used to display messages & commands.<br />All block commands are executed in this mode<br />Any commands proceeded with the : (colon) symbol are given in this mode.</span><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="background-color: cyan;"><b><i><span style="font-family: "georgia" , "times new roman" , serif; font-size: large;"><u>Invoking vi editor</u></span></i></b></span><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;">$vi file1</span><br /><br /><span style="color: #444444;">The vi editor shows the full screen view of the file. If the file isnât long enough to fill the screen; vi editor shows tildes(~) on the blank lines beyond the EOF.</span></span><br />
<br />
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u>Moving the cursor </u></i></b></span><br />
<ul style="text-align: left;">
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">h-moves the cursor one character left</span></li>
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">2h-moves the cursor 2 characters left</span></li>
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">l-moves the cursor one character right</span></li>
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">3l-moves the cursor 3 characters right</span></li>
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">j-moves the cursor one character below</span></li>
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">4j- moves the cursor 4 characters below</span></li>
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">k-moves the cursor one character above</span></li>
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">5k-moves the cursor 5 characters above</span></li>
</ul>
<ul style="text-align: left;">
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">w- moves cursor one word forward</span></li>
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">b- moves the cursor one word backward</span></li>
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">e- end of the current word</span></li>
</ul>
<ul style="text-align: left;">
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">0- moves cursor at the beginning of the current line</span></li>
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">$-moves cursor at the end of the current line</span></li>
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">+-moves cursor below the beginning of the next line.</span></li>
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">--moves the cursor above the beginning of the previous lines</span></li>
</ul>
<div style="text-align: left;">
<ul style="text-align: left;">
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">H- go to the first line on the screen</span></li>
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">M-go to the middle line on the screen</span></li>
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">L- go to the last line on the screen</span></li>
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">G-go to the last line of the file</span></li>
</ul>
<b><i><span style="font-family: "georgia" , "times new roman" , serif;"><u>Scrolling the screen </u></span></i></b><br />
<ul style="text-align: left;">
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">Ctrl+f â Scroll forward one window</span></li>
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">Ctrl+b â Scroll backward one window</span></li>
</ul>
<i style="font-family: georgia, 'times new roman', serif; font-weight: bold;"><u>Inserting text w.r.t cursor position</u></i><br />
<ul style="text-align: left;"><span style="font-family: "georgia" , "times new roman" , serif;">
<li><span style="color: #444444;"> i- Inserts text before the current position</span></li>
<li><span style="color: #444444;"> I-Inserts text at the beginning of the file</span></li>
<li><span style="color: #444444;"> a- Inserts text after the current position</span></li>
<li><span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;">A- Inserts text at the end of the file </span></span></li>
<li><span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;">o -Inserts a blank line below the current position </span></span></li>
<li><span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;">O-Inserts a blank line above the current position </span></span></li>
<li><span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;">c âChange current object </span></span></li>
<li><span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;">C-Change from current position till end of line. </span></span></li>
<li><span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;">r âReplace character at current position </span></span></li>
<li><span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;">R- Replace all characters until <ESC> is pressed. </span></span></li>
</span></ul>
<b style="font-family: georgia, 'times new roman', serif;"><i><u>Deleting text w.r.t cursor position </u></i></b></div>
<div style="text-align: left;">
<span style="font-family: "georgia" , "times new roman" , serif;"></span><br />
<ul style="text-align: left;"><span style="font-family: "georgia" , "times new roman" , serif;">
<li><span style="color: #444444;">dw âDelete current word </span></li>
<li><span style="color: #444444;">dd âDelete current line </span></li>
<li><span style="color: #444444;">d0- Delete from current position to the beginning of the line </span></li>
<li><span style="color: #444444;">d$ -Delete from current position to the end of line </span></li>
<li><span style="color: #444444;">x- Deletes the character directly under the current position </span></li>
<li><span style="color: #444444;"><n>x- Deletes n characters </span></li>
<li><span style="color: #444444;"><n>dw âDeletes n words </span></li>
<li><span style="color: #444444;"><n>dd- Deletes n lines </span></li>
<li><span style="color: #444444;">J â Join the EOL character. Join the current & next line. </span></li>
<li><span style="color: #444444;"><n>J âJoin the next n lines </span></li>
</span></ul>
<span style="font-family: "georgia" , "times new roman" , serif;">
</span><b><i><u><span style="font-family: "georgia" , "times new roman" , serif;">Undo change w.r.t cursor position</span></u></i></b><br />
<ul style="text-align: left;">
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">u âUndo the effect of the last command </span></li>
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">U âUndo all changes to the current line since the cursor was moved to this line. </span></li>
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">~ - Changes the character in the current position from upper to lower & vice-versa </span></li>
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">:sh âTemporarily returns to the shell to perform some shell commands. Type âexitâ to return to the vi editor. </span></li>
</ul>
<b><i><u><span style="font-family: "georgia" , "times new roman" , serif;">Searching patters w.r.t cursor position </span></u></i></b><br />
<ul style="text-align: left;">
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">/<string> -Search forward to the next occurrence of the string </span></li>
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">?<string> -Search backward to the next occurrence of the string </span></li>
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">^<string>- Search for all the lines which begin with the string </span></li>
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><string>$-Search for all the lines which end with the string </span></li>
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">\<<string>-Search for all the words which begin with the string </span></li>
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><string>\>-Search for all the words which end with the string</span></li>
</ul>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">You may use metacharacters to represent the <string></span></div>
<div style="text-align: left;">
<ul style="text-align: left;">
</ul>
<br />
<b><i><span style="font-family: "georgia" , "times new roman" , serif; font-size: large;"><u style="background-color: cyan;">Quitting Vi editor</u></span></i></b></div>
<div style="text-align: left;">
<ul style="text-align: left;">
<li><span style="font-family: "georgia" , "times new roman" , serif;"> :q! âWill terminate the file whether or not the changes made in the buffer were written</span></li>
<li><span style="font-family: "georgia" , "times new roman" , serif;"> :wq âWrite all changes & quit editor.</span></li>
<li><span style="font-family: "georgia" , "times new roman" , serif;"> :w file1 âWrite all changes to file1 & quit editor</span></li>
<li><span style="font-family: "georgia" , "times new roman" , serif;"> :q âQuits editor if the changes made were written to a file</span></li>
</ul>
<b><i><span style="font-family: "georgia" , "times new roman" , serif; font-size: large;"><u style="background-color: cyan;"><br /></u></span></i></b>
<b><i><span style="font-family: "georgia" , "times new roman" , serif; font-size: large;"><u style="background-color: cyan;">Block commands in vi editor</u></span></i></b><br />
<br />
<span style="font-family: "georgia" , "times new roman" , serif;">First press the âEscâ key to enter the command mode. <br />Then the â:â key to begin with block commands.<br /><br />To display line numbers enter the command âset numberâ after following the above commands.<br />To turn off the numbering type command âset nonumberâ after following the above commands.</span><br />
<ul style="text-align: left;">
<li><span style="font-family: "georgia" , "times new roman" , serif;">:4,12d -Lines 4 to 12 should be deleted from the current.</span></li>
<li><span style="font-family: "georgia" , "times new roman" , serif;">:5 mo 6 -Moves line 5 after line 6</span></li>
<li><span style="font-family: "georgia" , "times new roman" , serif;">:5,7 mo 9 -Moves lines 5 to 7 after line 9</span></li>
<li><span style="font-family: "georgia" , "times new roman" , serif;">:10 co 11 -Copies line 10 after line 11</span></li>
<li><span style="font-family: "georgia" , "times new roman" , serif;">:10-15 co 16 âCopies line 10 to 15 after line 16</span></li>
<li><span style="font-family: "georgia" , "times new roman" , serif;">:21,31 w file1- Writes lines 21 to 31 to file1</span></li>
<li><span style="font-family: "georgia" , "times new roman" , serif;">:21,31 w>>file1 âAppends file1 with lines 21 to 31</span></li>
</ul>
</div>
</div>
</div>
Krutihttp://www.blogger.com/profile/13385897521211871375noreply@blogger.com0tag:blogger.com,1999:blog-8195522014866487394.post-42224015400731171772016-04-07T23:51:00.001-07:002016-04-07T23:56:44.740-07:00Implementing Full-Text Indexes<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "georgia" , "times new roman" , serif;">In my previous blog we saw the Full-Text Index architecture. </span><br />
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><a href="http://sqlandmorewithkruti.blogspot.in/2016/04/all-about-searching-full-text-indexes_7.html">http://sqlandmorewithkruti.blogspot.in/2016/04/all-about-searching-full-text-indexes_7.html</a></span><br />
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span>
<span style="font-family: "georgia" , "times new roman" , serif;">In this blog we shall see its implementation. Before you proceed you need to ensure that this feature is added to your instance and the full-text services are running.</span><br />
<div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPAktCYqTqMZXzaD7iscZb6TMQkUMcOJjGQJPUufIzOAy9g-7GS6erIGK0qhwgnPzdkwFhQ2FsCzaNRsqq6vlg1bzY0WxESHWH_0yw63HwQ9jh35bIZh2ldH0BfKMvsigVr9lhoKJJGZg/s1600/Full-Text+Services.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPAktCYqTqMZXzaD7iscZb6TMQkUMcOJjGQJPUufIzOAy9g-7GS6erIGK0qhwgnPzdkwFhQ2FsCzaNRsqq6vlg1bzY0WxESHWH_0yw63HwQ9jh35bIZh2ldH0BfKMvsigVr9lhoKJJGZg/s1600/Full-Text+Services.JPG" /></a></div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">We shall start by creating a full text catalog.<span style="font-size: 13.5pt; line-height: 20.7px;"> </span>If multiple filegroups are available we may specify the one on which it has to be created by the FileGroup clause If multiple filegroups are available we may specify the one on which it has to be created by the FileGroup clause</span><br />
<div>
<br /></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">Through T-SQL</span><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span>
<br />
<div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas"; font-size: 9.5pt;">USE</span><span style="font-family: "consolas"; font-size: 9.5pt;"> [FULLTEXT]<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas"; font-size: 9.5pt;">GO</span><span style="font-family: "consolas"; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas"; font-size: 9.5pt;">CREATE</span><span style="font-family: "consolas"; font-size: 9.5pt;"> <span style="color: blue;">FULLTEXT</span> <span style="color: blue;">CATALOG</span> [FullTextCatalog]<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas"; font-size: 9.5pt;">ON</span><span style="font-family: "consolas"; font-size: 9.5pt;"> <span style="color: blue;">FILEGROUP</span> [PRIMARY]<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas"; font-size: 9.5pt;">WITH</span><span style="font-family: "consolas"; font-size: 9.5pt;"> <span style="color: blue;">ACCENT_SENSITIVITY</span> <span style="color: grey;">=</span> <span style="color: blue;">ON</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas"; font-size: 9.5pt;">AS</span><span style="font-family: "consolas"; font-size: 9.5pt;"> <span style="color: blue;">DEFAULT</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas"; font-size: 9.5pt;">AUTHORIZATION</span><span style="font-family: "consolas"; font-size: 9.5pt;"> [dbo]<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas"; font-size: 9.5pt;">GO</span><span style="font-family: "consolas"; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas"; font-size: 9.5pt;"><br /></span></div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">Through Wizard</span></div>
<div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBr3PGDO6h1ylgGmx5jTt_GMcO6hLX5ie7HrlINyHCOyeHKlbMm1Erf1XxoNkaw1X3l3iQx3QGC2IO49rE9Q8pBnUL90_rlRyHu3kdjwE-bEIhLfEQnpCcux0bWcn9mbxelqps99yNN0Y/s1600/FullTextCatalog.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBr3PGDO6h1ylgGmx5jTt_GMcO6hLX5ie7HrlINyHCOyeHKlbMm1Erf1XxoNkaw1X3l3iQx3QGC2IO49rE9Q8pBnUL90_rlRyHu3kdjwE-bEIhLfEQnpCcux0bWcn9mbxelqps99yNN0Y/s1600/FullTextCatalog.JPG" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBr3PGDO6h1ylgGmx5jTt_GMcO6hLX5ie7HrlINyHCOyeHKlbMm1Erf1XxoNkaw1X3l3iQx3QGC2IO49rE9Q8pBnUL90_rlRyHu3kdjwE-bEIhLfEQnpCcux0bWcn9mbxelqps99yNN0Y/s1600/FullTextCatalog.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBr3PGDO6h1ylgGmx5jTt_GMcO6hLX5ie7HrlINyHCOyeHKlbMm1Erf1XxoNkaw1X3l3iQx3QGC2IO49rE9Q8pBnUL90_rlRyHu3kdjwE-bEIhLfEQnpCcux0bWcn9mbxelqps99yNN0Y/s1600/FullTextCatalog.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas";"><span style="font-size: 12.6667px;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas";"><span style="font-size: 12.6667px;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas";"><span style="font-size: 12.6667px;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas";"><span style="font-size: 12.6667px;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas";"><span style="font-size: 12.6667px;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas";"><span style="font-size: 12.6667px;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas";"><span style="font-size: 12.6667px;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas";"><span style="font-size: 12.6667px;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas";"><span style="font-size: 12.6667px;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas";"><span style="font-size: 12.6667px;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas";"><span style="font-size: 12.6667px;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas";"><span style="font-size: 12.6667px;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas";"><span style="font-size: 12.6667px;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas";"><span style="font-size: 12.6667px;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas";"><span style="font-size: 12.6667px;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas";"><span style="font-size: 12.6667px;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas";"><span style="font-size: 12.6667px;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas";"><span style="font-size: 12.6667px;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">Next we shall create the Full Text Index on our books table</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "georgia" , "times new roman" , serif;"><a href="https://msdn.microsoft.com/en-us/library/ms187317.aspx">https://msdn.microsoft.com/en-us/library/ms187317.aspx</a></span><br />
<span style="color: blue; font-family: "consolas"; font-size: 9.5pt;"><span style="font-size: 9.5pt;"><br /></span></span>
<span style="color: blue; font-family: "consolas"; font-size: 9.5pt;"><span style="font-size: 9.5pt;">USE</span></span><span style="font-family: "consolas"; font-size: 9.5pt;"> [FULLTEXT]</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas"; font-size: 9.5pt;">GO</span><span style="font-family: "consolas"; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas"; font-size: 9.5pt;">CREATE</span><span style="font-family: "consolas"; font-size: 9.5pt;"> <span style="color: blue;">FULLTEXT</span> <span style="color: blue;">INDEX</span> <span style="color: blue;">ON</span> [dbo]<span style="color: grey;">.</span>[Books]<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "consolas"; font-size: 9.5pt;">(</span><span style="font-family: "consolas"; font-size: 9.5pt;"> [Author] <span style="color: blue;">LANGUAGE</span> English<span style="color: grey;">,</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "consolas"; font-size: 9.5pt;"> [Title] <span style="color: blue;">LANGUAGE</span> English<span style="color: grey;">,</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "consolas"; font-size: 9.5pt;"> [Synopsis] <span style="color: blue;">LANGUAGE</span> English<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "consolas"; font-size: 9.5pt;"> <span style="color: grey;">)</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas"; font-size: 9.5pt;">KEY</span><span style="font-family: "consolas"; font-size: 9.5pt;"> <span style="color: blue;">INDEX</span> [pk_id] <span style="color: blue;">ON </span><span style="color: grey;">(</span>[FullTextCatalog]<span style="color: grey;">)</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas"; font-size: 9.5pt;">WITH </span><span style="font-family: "consolas"; font-size: 9.5pt;">(</span><span style="color: blue; font-family: "consolas"; font-size: 9.5pt;">CHANGE_TRACKING</span><span style="font-family: "consolas"; font-size: 9.5pt;"> <span style="color: blue;">AUTO</span><span style="color: grey;">,</span> <span style="color: blue;">STOPLIST</span><span style="color: grey;">=</span>NewStopList<span style="color: grey;">)</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas"; font-size: 9.5pt;">GO</span><span style="font-family: "consolas"; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif; line-height: 18.4px;">Steps for creating the Index via the Wizard are as follows</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "calibri" , "sans-serif"; font-size: 11pt; line-height: 16.8667px;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9sLWcTUA98oNa6i9bZ-uh4likKJZfanVynnQn8VO4wyS6PDnfeAb7JQD5Cn4JAHQaqB1cyTHx7uAhzgndlHdn3TJN9ijy_b2XrA5vd45cuMbsOEjxwJqhMLZdlwGhk9tLphZW2h7jGW8/s1600/FullTextIndex1.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="201" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9sLWcTUA98oNa6i9bZ-uh4likKJZfanVynnQn8VO4wyS6PDnfeAb7JQD5Cn4JAHQaqB1cyTHx7uAhzgndlHdn3TJN9ijy_b2XrA5vd45cuMbsOEjxwJqhMLZdlwGhk9tLphZW2h7jGW8/s400/FullTextIndex1.jpg" width="400" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "calibri" , "sans-serif"; font-size: 11pt; line-height: 16.8667px;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "calibri" , "sans-serif"; font-size: 11pt; line-height: 16.8667px;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "calibri" , "sans-serif"; font-size: 11pt; line-height: 16.8667px;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "calibri" , "sans-serif"; font-size: 11pt; line-height: 16.8667px;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "calibri" , "sans-serif"; font-size: 11pt; line-height: 16.8667px;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "calibri" , "sans-serif"; font-size: 11pt; line-height: 16.8667px;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "calibri" , "sans-serif"; font-size: 11pt; line-height: 16.8667px;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "calibri" , "sans-serif"; font-size: 11pt; line-height: 16.8667px;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgit-pE4oHHV_X9CEUgxjKMxorvvZGieEr67nIYlTqmjTlBncqZJOarUBR3wGcMXHtJrgC1rieN_N9JjMmRYyUWJJqxqUP_dApQnAugHD8QthzAgD8HhgN8QZ5SAvT86cyY6aIOuI1Hg6Q/s1600/FullTextIndex2.jpg" imageanchor="1" style="clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" height="345" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgit-pE4oHHV_X9CEUgxjKMxorvvZGieEr67nIYlTqmjTlBncqZJOarUBR3wGcMXHtJrgC1rieN_N9JjMmRYyUWJJqxqUP_dApQnAugHD8QthzAgD8HhgN8QZ5SAvT86cyY6aIOuI1Hg6Q/s400/FullTextIndex2.jpg" width="400" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">Unlike Standard indexes we arenât giving it any name. As SQL server allows only one Full-Text index per table the naming is taken care by SQL server. The Key Index clause specifies the unique non-null column which is mandatory when create full-text indexes.</span><br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "calibri" , "sans-serif"; font-size: 11pt; line-height: 16.8667px;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPlhT78qf1AkQv_QerfTKbQF_T19umHkzPR8wKU1h93vnIDBiAiT2RrBS-pG-0r62kTuirJVym5eTiybIp7MscVOOlL_SR3jRvMTI0fbRBL_-suTFmMvESfzRdJWDnISH8fqgxww7Z9xQ/s1600/FullTextIndex3.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="351" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPlhT78qf1AkQv_QerfTKbQF_T19umHkzPR8wKU1h93vnIDBiAiT2RrBS-pG-0r62kTuirJVym5eTiybIp7MscVOOlL_SR3jRvMTI0fbRBL_-suTFmMvESfzRdJWDnISH8fqgxww7Z9xQ/s400/FullTextIndex3.jpg" width="400" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "calibri" , "sans-serif"; font-size: 11pt; line-height: 16.8667px;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "calibri" , "sans-serif"; font-size: 11pt; line-height: 16.8667px;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "calibri" , "sans-serif"; font-size: 11pt; line-height: 16.8667px;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "calibri" , "sans-serif"; font-size: 11pt; line-height: 16.8667px;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "calibri" , "sans-serif"; font-size: 11pt; line-height: 16.8667px;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "calibri" , "sans-serif"; font-size: 11pt; line-height: 16.8667px;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "calibri" , "sans-serif"; font-size: 11pt; line-height: 16.8667px;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "calibri" , "sans-serif"; font-size: 11pt; line-height: 16.8667px;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFgiKFRDDWJOo3WntuCggtbjdFY9wjrxGRfrgEhE3OeWydYgqMzph2ByuKhwbQYP-8h2gBlB5xm1JeMInx1rYlYpnRE-7JA6S0pKx5Aeafcfv62QJ_RQ1ziSL_JjoXwil5PnzT6IfyrBA/s1600/FullTextIndex4.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="352" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFgiKFRDDWJOo3WntuCggtbjdFY9wjrxGRfrgEhE3OeWydYgqMzph2ByuKhwbQYP-8h2gBlB5xm1JeMInx1rYlYpnRE-7JA6S0pKx5Aeafcfv62QJ_RQ1ziSL_JjoXwil5PnzT6IfyrBA/s400/FullTextIndex4.jpg" width="400" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "calibri" , "sans-serif"; font-size: 11pt; line-height: 16.8667px;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "calibri" , "sans-serif"; font-size: 11pt; line-height: 16.8667px;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "calibri" , "sans-serif"; font-size: 11pt; line-height: 16.8667px;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxJrmWVz57rkouMmd_zh7Zq7AYp_Us8eTtlD_Ip6W8WCkcnZbwCOfmYANIl8sELOOUJop_4_XrHB0iTwoNAD9hyzJvTHXuP61Ho3t-dM0tc_rL25-BuRuB1zysyNKupFiDmo5KTMb1d88/s1600/FullTextIndex5.jpg" imageanchor="1" style="clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" height="345" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxJrmWVz57rkouMmd_zh7Zq7AYp_Us8eTtlD_Ip6W8WCkcnZbwCOfmYANIl8sELOOUJop_4_XrHB0iTwoNAD9hyzJvTHXuP61Ho3t-dM0tc_rL25-BuRuB1zysyNKupFiDmo5KTMb1d88/s400/FullTextIndex5.jpg" width="400" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "calibri" , "sans-serif"; font-size: 11pt; line-height: 16.8667px;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">In the previous blog Iâve mentioned how population of the index depends on the type of Change_Tracking option selected.</span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">When Auto is selected the changes are automatically tracked and updated by SQL server for the full-text indexed columns. </span><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">When Manual is select the changes are tracked but the indexes arenât updated unless the</span> <span style="color: blue; font-family: "consolas"; font-size: 9.5pt;">ALTER</span><span style="font-family: "consolas"; font-size: 9.5pt;"> <span style="color: blue;">FULLTEXT</span> <span style="color: blue;">INDEX</span> <span style="color: red;">âŚ</span> START <span style="color: magenta;">UPDATE</span> <span style="color: blue;">POPULATION </span></span><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">is fired. This may be called through a SQL agent job as well. There is one more option which is not commonly used. </span><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">Itâs the Change_Tracking Off option when the changes are not tracked at all by SQL server. Itâs available when creating full-text indexes in static tables.</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQyluUsDtK9b0YsDNXvZ0sX_k_jdu8Sm-SQY7T-Ag7j8kWdI1E4ujyC2gCuNWMQ4Dx7Ah_lHCJ0D8N0wryVhK0TcOMTQh6Y448yvPqRVT4pO5iDoxUJl8E1y2K82uJCi_qUy_Rv8EDQSU/s1600/FullTextIndex6.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="353" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQyluUsDtK9b0YsDNXvZ0sX_k_jdu8Sm-SQY7T-Ag7j8kWdI1E4ujyC2gCuNWMQ4Dx7Ah_lHCJ0D8N0wryVhK0TcOMTQh6Y448yvPqRVT4pO5iDoxUJl8E1y2K82uJCi_qUy_Rv8EDQSU/s400/FullTextIndex6.jpg" width="400" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiVY8Cy-t3bNc7dsQgK-W_PSsg0H4fZFyPF1A5PfiwKtQnf2u8-GAWKq5lZrxomUWLxD9hn6YNzbF2fk88Smy8Zwy3OyxXANXmxxh1O0IARv_IjLqiGdQFg2m4e9YWQDDt5h8NhyxvhMU/s1600/FullTextIndex7.jpg" imageanchor="1" style="clear: left; display: inline !important; float: left; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" height="350" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiVY8Cy-t3bNc7dsQgK-W_PSsg0H4fZFyPF1A5PfiwKtQnf2u8-GAWKq5lZrxomUWLxD9hn6YNzbF2fk88Smy8Zwy3OyxXANXmxxh1O0IARv_IjLqiGdQFg2m4e9YWQDDt5h8NhyxvhMU/s400/FullTextIndex7.jpg" width="400" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi7bWIpbV_OlLEAKfGd6vbzIApnmNuXerRuNxWkjWbHwGr6_Jh_bN42HH1G4hhIl-AV1jEDitUNUBH3i68u8Ib9iJ0dWqS3Vwb_324U-RM8ezIkSV_4BmZ2d6Djpk_85hJCwjuxDsUThA/s1600/FullTextIndex8.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="347" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi7bWIpbV_OlLEAKfGd6vbzIApnmNuXerRuNxWkjWbHwGr6_Jh_bN42HH1G4hhIl-AV1jEDitUNUBH3i68u8Ib9iJ0dWqS3Vwb_324U-RM8ezIkSV_4BmZ2d6Djpk_85hJCwjuxDsUThA/s400/FullTextIndex8.jpg" width="400" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9JzyUllXDRtcjgdqrZXz9A4BWXtYObaUn6ULaIXyb6Y5sUkIYrwQPMRpOvA499B3KxyvQhjWMZb3kxIfGxhUlS2j-uKrwVnr03qGAijorKEQKGGw-u4y_kqAcRdJGNykQI7gz7mbJeOM/s1600/FullTextIndex9.jpg" imageanchor="1" style="clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" height="350" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9JzyUllXDRtcjgdqrZXz9A4BWXtYObaUn6ULaIXyb6Y5sUkIYrwQPMRpOvA499B3KxyvQhjWMZb3kxIfGxhUlS2j-uKrwVnr03qGAijorKEQKGGw-u4y_kqAcRdJGNykQI7gz7mbJeOM/s400/FullTextIndex9.jpg" width="400" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">Here im creating my own StopList. This option is available under Database-> Storage -> Full Text StopList. I shall be building it from the system stop list and adding the word âdescribesâ to StopList.</span><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQ-2e8NJ26180KEyJx3Td3M_UgR5L8IuaMD_3smBqb9WEwhTA-P4BR-CgnGlwBamF7Q1X3tY99j-X4nkiJ_AnI15Js4D106nCnXbxoWzgXZK7oKyn9rtNtOHdHoL1vodQfDCflUmC6Jb0/s1600/StopList.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="362" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQ-2e8NJ26180KEyJx3Td3M_UgR5L8IuaMD_3smBqb9WEwhTA-P4BR-CgnGlwBamF7Q1X3tY99j-X4nkiJ_AnI15Js4D106nCnXbxoWzgXZK7oKyn9rtNtOHdHoL1vodQfDCflUmC6Jb0/s400/StopList.JPG" width="400" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGBs1RfV8-C3JNH87nJ9M543YBP71SAGbP42XV0GTnIkTLeZP-apRImdLpEzW48l9rQ0JjhDni3K7mhpVnrCkfpxIAilzVew_HXTtk6qIezIL_E9AZ2-XOb-1b3eRd-6OU6SKGNW9yZmU/s1600/StopListProperties.jpg" imageanchor="1" style="clear: left; display: inline !important; float: left; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGBs1RfV8-C3JNH87nJ9M543YBP71SAGbP42XV0GTnIkTLeZP-apRImdLpEzW48l9rQ0JjhDni3K7mhpVnrCkfpxIAilzVew_HXTtk6qIezIL_E9AZ2-XOb-1b3eRd-6OU6SKGNW9yZmU/s320/StopListProperties.jpg" width="301" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipqiMn5Qk17QTkU6PMouWhL1FoT7labrYNsGjERb1LS_bFFg_EY6ArM4NgQwP9s1Hj729qtT-K0GCHW6gmB4BF-LiQdxLoP_4etdnzPhtVJHvcaYKKeZi83-JhZaJCuglz8OP-0rPF04E/s1600/StopListProperties2.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="356" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipqiMn5Qk17QTkU6PMouWhL1FoT7labrYNsGjERb1LS_bFFg_EY6ArM4NgQwP9s1Hj729qtT-K0GCHW6gmB4BF-LiQdxLoP_4etdnzPhtVJHvcaYKKeZi83-JhZaJCuglz8OP-0rPF04E/s400/StopListProperties2.jpg" width="400" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br /></div>
<span style="color: #444444;"><br /><span style="font-family: "georgia" , "times new roman" , serif;">Now we are ready with the index letâs start the querying</span></span><br />
<br />
<a href="https://msdn.microsoft.com/en-us/library/hh245284.aspx">https://msdn.microsoft.com/en-us/library/hh245284.aspx</a><br />
<a href="https://msdn.microsoft.com/en-us/library/cc879306.aspx">https://msdn.microsoft.com/en-us/library/cc879306.aspx</a><br />
<br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">So coming back to the same example that we discussed in the previous blog I can now search for all the books that contain the character âJeremyâ in the synopsis as follows</span><br />
<br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas"; font-size: 9.5pt;">SELECT</span><span style="font-family: "consolas"; font-size: 9.5pt;"> <span style="color: grey;">*</span> <span style="color: blue;">FROM</span> [FULLTEXT]<span style="color: grey;">.</span>[dbo]<span style="color: grey;">.</span>[Books] <span style="color: blue;">where</span> <span style="color: magenta;">contains</span><span style="color: grey;">(</span>Synopsis<span style="color: grey;">,</span><span style="color: red;">N'Jeremy'</span><span style="color: grey;">)<o:p></o:p></span></span></div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br />The Contains Predicate will search for the exact words or phrases that I pass. It also searches for proximity words & inflecting forms of the word. If you want more matches in terms of meaning of the words and not just the exact words we use the FreeText Predicate. It also allows for pattern matching with wildcards.</span><br />
<br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas"; font-size: 9.5pt;">SELECT</span><span style="font-family: "consolas"; font-size: 9.5pt;"> <span style="color: grey;">*</span> <span style="color: blue;">FROM</span> [FULLTEXT]<span style="color: grey;">.</span>[dbo]<span style="color: grey;">.</span>[Books] <span style="color: blue;">where</span> <span style="color: blue;">freetext</span><span style="color: grey;">(*,</span><span style="color: red;">'"new York*"'</span><span style="color: grey;">)<o:p></o:p></span></span></div>
<span style="color: #444444;"><br /><span style="font-family: "georgia" , "times new roman" , serif;">This will result for all those records will also contain the records like new Yorker, new york in any of the columns</span></span></div>
<div>
<br /></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">I could go on for providing further examples but these are very well described in the below links. </span></div>
<div>
<div>
<a href="https://msdn.microsoft.com/en-us/library/ms187787.aspx">https://msdn.microsoft.com/en-us/library/ms187787.aspx</a></div>
<div>
<a href="https://msdn.microsoft.com/en-us/library/ms176078.aspx">https://msdn.microsoft.com/en-us/library/ms176078.aspx</a></div>
<a href="http://sqlmag.com/sql-server/sample-full-text-search-engine">http://sqlmag.com/sql-server/sample-full-text-search-engine</a></div>
</div>
</div>
<div>
<span style="color: #444444;"><br /></span></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">Highly recommend that you go through these examples prior to implementing it in queries.</span></div>
<div>
<br /></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><u>Books </u></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><u><br /></u></span></div>
<a href="https://books.google.co.in/books?id=PgqEEPWRBzAC&pg=PA173&lpg=PA173&dq=full+text+indexing+sql+server+books&source=bl&ots=shtKT9rsl1&sig=C9yRRb4jbLFzcOLqIaAPWWK11gE&hl=en&sa=X&ved=0ahUKEwi2trLHr_7LAhVDto4KHUC1CKwQ6AEIUDAI#v=onepage&q=full%20text%20indexing%20sql%20server%20books&f=false">https://books.google.co.in/books?id=PgqEEPWRBzAC&pg=PA173&lpg=PA173&dq=full+text+indexing+sql+server+books&source=bl&ots=shtKT9rsl1&sig=C9yRRb4jbLFzcOLqIaAPWWK11gE&hl=en&sa=X&ved=0ahUKEwi2trLHr_7LAhVDto4KHUC1CKwQ6AEIUDAI#v=onepage&q=full%20text%20indexing%20sql%20server%20books&f=false</a><br />
<div>
<br />
<a href="https://books.google.co.in/books?id=4PY-dxY3AEAC&pg=PR19&lpg=PR19&dq=pro+full-text+search+in+sql+server+2008+books&source=bl&ots=czD8FT_5-F&sig=t26njP2Vc6m_dHwQYnYBu7rUjGk&hl=en&sa=X&ved=0ahUKEwj7rozjr_7LAhXWkI4KHUPfDSwQ6AEIOTAF#v=onepage&q=pro%20full-text%20search%20in%20sql%20server%202008%20books&f=false">https://books.google.co.in/books?id=4PY-dxY3AEAC&pg=PR19&lpg=PR19&dq=pro+full-text+search+in+sql+server+2008+books&source=bl&ots=czD8FT_5-F&sig=t26njP2Vc6m_dHwQYnYBu7rUjGk&hl=en&sa=X&ved=0ahUKEwj7rozjr_7LAhXWkI4KHUPfDSwQ6AEIOTAF#v=onepage&q=pro%20full-text%20search%20in%20sql%20server%202008%20books&f=false</a></div>
</div>
Krutihttp://www.blogger.com/profile/13385897521211871375noreply@blogger.com0tag:blogger.com,1999:blog-8195522014866487394.post-84097027858983609782016-04-07T23:48:00.000-07:002016-04-08T00:01:13.234-07:00All about Searching - Full-Text Indexes<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "georgia" , "times new roman" , serif;">SQL server has the capability to store text-based data in the form of char, varchar, nchar, nvarchar, text, ntext, image, xml, or varbinary(max). When querying the data stored in such columns the âLIKEâ clause would be highly used for pattern matching.</span><br />
<div>
<span style="font-family: "georgia" , "times new roman" , serif;">Consider the below table</span><br />
<div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas"; font-size: 9.5pt;">CREATE</span><span style="font-family: "consolas"; font-size: 9.5pt;"> <span style="color: blue;">TABLE</span> [dbo]<span style="color: grey;">.</span>[Books]<span style="color: grey;">(</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "consolas"; font-size: 9.5pt;"> [id] [int] <span style="color: blue;">IDENTITY</span><span style="color: grey;">(</span>1<span style="color: grey;">,</span>1<span style="color: grey;">)</span> <span style="color: grey;">NOT</span> <span style="color: grey;">NULL,</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "consolas"; font-size: 9.5pt;"> [Author] [varchar]<span style="color: grey;">(</span>20<span style="color: grey;">)</span> <span style="color: grey;">NULL,</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "consolas"; font-size: 9.5pt;"> [Title] [varchar]<span style="color: grey;">(</span>100<span style="color: grey;">)</span> <span style="color: grey;">NULL,</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "consolas"; font-size: 9.5pt;"> [Published_yr] [date] <span style="color: grey;">NOT</span> <span style="color: grey;">NULL,</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "consolas"; font-size: 9.5pt;"> [Synopsis] [nvarchar]<span style="color: grey;">(</span><span style="color: magenta;">max</span><span style="color: grey;">)</span> <span style="color: grey;">NULL,</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "consolas"; font-size: 9.5pt;"> <span style="color: blue;">CONSTRAINT</span> [pk_id] <span style="color: blue;">PRIMARY</span> <span style="color: blue;">KEY</span> <span style="color: blue;">CLUSTERED</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "consolas"; font-size: 9.5pt;">(</span><span style="font-family: "consolas"; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "consolas"; font-size: 9.5pt;"> [id] <span style="color: blue;">ASC</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "consolas"; font-size: 9.5pt;">)</span><span style="color: blue; font-family: "consolas"; font-size: 9.5pt;">WITH </span><span style="font-family: "consolas"; font-size: 9.5pt;">(</span><span style="color: blue; font-family: "consolas"; font-size: 9.5pt;">PAD_INDEX</span><span style="font-family: "consolas"; font-size: 9.5pt;"> <span style="color: grey;">=</span> <span style="color: blue;">OFF</span><span style="color: grey;">,</span> <span style="color: blue;">STATISTICS_NORECOMPUTE</span> <span style="color: grey;">=</span> <span style="color: blue;">OFF</span><span style="color: grey;">,</span> <span style="color: blue;">IGNORE_DUP_KEY</span> <span style="color: grey;">=</span> <span style="color: blue;">OFF</span><span style="color: grey;">,</span> <span style="color: blue;">ALLOW_ROW_LOCKS</span> <span style="color: grey;">=</span> <span style="color: blue;">ON</span><span style="color: grey;">,</span> <span style="color: blue;">ALLOW_PAGE_LOCKS</span> <span style="color: grey;">=</span> <span style="color: blue;">ON</span><span style="color: grey;">)</span> <span style="color: blue;">ON</span> [PRIMARY]<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "consolas"; font-size: 9.5pt;">)</span><span style="font-family: "consolas"; font-size: 9.5pt;"> <span style="color: blue;">ON</span> [PRIMARY] <span style="color: blue;">TEXTIMAGE_ON</span> [PRIMARY]<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas"; font-size: 9.5pt;">GO</span><span style="font-family: "consolas"; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas"; font-size: 9.5pt;">SET</span><span style="font-family: "consolas"; font-size: 9.5pt;"> <span style="color: blue;">ANSI_PADDING</span> <span style="color: blue;">OFF</span><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="color: blue; font-family: "consolas"; font-size: 9.5pt;">GO</span> </div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxHyKMJ_msCpLlmg09V1TxHM3Xv5Prt1cvMo5TGp2H055VRxJxXCqfS1m18oSGvV4dufCBcqSGbOXft-75yUfY7g3fVxHuBEu0tAiE3sKKSrjH1lQG8w67kMoAK7LAYwbybOaiyjFZVQQ/s1600/TableStructure.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="192" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxHyKMJ_msCpLlmg09V1TxHM3Xv5Prt1cvMo5TGp2H055VRxJxXCqfS1m18oSGvV4dufCBcqSGbOXft-75yUfY7g3fVxHuBEu0tAiE3sKKSrjH1lQG8w67kMoAK7LAYwbybOaiyjFZVQQ/s640/TableStructure.jpg" width="640" /></a></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">SQL script for the table</span><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><a href="https://drive.google.com/file/d/0B4Cwe4q5QK-DUWEwLXhpZ00tU2c/view?usp=sharing">dbo.Books.sql</a></span><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">It would be easier if we were filtering the rows based on authors something like this</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas"; font-size: 9.5pt;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas"; font-size: 9.5pt;">SELECT</span><span style="font-family: "consolas"; font-size: 9.5pt;"> <span style="color: grey;">*</span> <span style="color: blue;">FROM</span> BOOKS <span style="color: blue;">WHERE</span> Author <span style="color: grey;">LIKE</span> <span style="color: red;">'Nicholas%'<o:p></o:p></span></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<span style="color: #444444;"><span style="font-family: "georgia" , "times new roman" , serif;">However consider the scenario where I wish to check if Jeremy is one of the characters in the books based on the synopsis given. My query would look something like this</span></span><br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas"; font-size: 9.5pt;">SELECT</span><span style="font-family: "consolas"; font-size: 9.5pt;"> <span style="color: grey;">*</span> <span style="color: blue;">FROM</span> BOOKS <span style="color: blue;">WHERE</span> Synopsis <span style="color: grey;">LIKE</span> <span style="color: red;">'%Jeremy%'<o:p></o:p></span></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">It will work fine doing a table scans for the pattern match. However consider if this was a library management system consisting of millions of records. In such a scenario performing a table scan over a table is not a wise option. For such situations SQL server provides a functionality called full-text search. SQL Server's full-text search engine gives you fast queries and advanced pattern matching in an enterprise environment. It works against text data in full-text indexes by operating on words and phrases based on rules of a particular language such as English. </span><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;">To understand its architecture and how it works we need to familiar ourselves with its terminologies.</span><br /><a href="https://technet.microsoft.com/en-us/library/ms142581(v=sql.105).aspx">https://technet.microsoft.com/en-us/library/ms142581(v=sql.105).aspx</a></span><br />
<br />
<h3 style="text-align: left;">
<span style="font-family: "georgia" , "times new roman" , serif;">Full-Text Terminologies</span></h3>
<div>
<br /></div>
<b style="font-family: Georgia, 'Times New Roman', serif;"><i style="background-color: cyan;"><span style="font-family: "georgia" , "times new roman" , serif;"><span style="background-color: cyan;"> 1) Full-Text Indexes</span></span></i></b></div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br />A special token-based index built and maintained by the Full Text Engine for SQL server. It is used to track occurrences of words or word-forms in columns containing unstructured text. Full-Text index structures are different from normal B-tree index structures. Itâs an inverted, stacked, compressed index structure based on individual tokens from the text being indexed. Only one Full-Text index can be created per table. It does require a unique key to be set for each row for the given table. It helps to keep this key as small as possible. This could be a primary key. This structure is elaborated in the following link</span><br />
<a href="https://technet.microsoft.com/en-us/library/ms142505(v=sql.105).aspx">https://technet.microsoft.com/en-us/library/ms142505(v=sql.105).aspx</a></div>
<div>
<br />
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i style="background-color: cyan;">2) Full-Text Catalogs</i></b></span></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><b><i><br /></i></b>Itâs a logical container for Full-Text indexes. A database can have one or more full-text catalogs. The indexes are aggregated as a collection in terms of catalog purely for administration and maintenance purpose. It is used to set common property values for all the indexes it stores.</span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i style="background-color: cyan;">3) Word Stemmers</i></b></span></div>
<div>
<span style="color: #444444;"><br /></span></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">For any language like English we have certain words which are considered as base or root words. From these new-words or its conjugates can be formed. Consider the word âEatâ from this we can derive words like âeating, will eat, shall eat, ate, etcâ these are its derived forms. Such words are called stemmers. Identifying the word stemmers comes in handy for pattern searching while using full-text indexes.</span><br />
<br />
<b><i><span style="background-color: cyan; font-family: "georgia" , "times new roman" , serif;">4) Word Breakers</span></i></b></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">Any characters which delimit sentences or phrases for the language are called word breakers (Spaces Excluded). They are particular for each supported language in SQL server. Once identified further action can be taken in building the FTS index or processing the query.</span><br />
<br />
<b><i style="background-color: cyan;"><span style="font-family: "georgia" , "times new roman" , serif;">5) StopWords and StopList</span></i></b></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">Every language has certain words like conjunctions, pro-nouns which provide no meaningful benefit when used in search criteriaâs. For example words like âthe, are, and, to,etcâ are commonly discarded for full-text indexes. These words are called stopwords. By excluding these words the Full-Text indexes become more efficient. The indexes however do take into account the position of such words when encountered. As the name suggests StopList is a list of Stop words. SQL server lets you create & customize your own StopLists.</span></div>
<a href="https://technet.microsoft.com/en-us/library/ms142551(v=sql.105).aspx">https://technet.microsoft.com/en-us/library/ms142551(v=sql.105).aspx</a></div>
<div>
<br />
<div>
<b><i><span style="background-color: cyan; font-family: "georgia" , "times new roman" , serif;">6) Population / Crawl Process</span></i></b></div>
<div>
<b><i><span style="background-color: cyan; font-family: "georgia" , "times new roman" , serif;"><br /></span></i></b></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">Unlike standard SQL Server indexes that are automatically maintained during data modifications full-text indexes arenât repopulated. Creating and maintaining a full-text index involves populating the index by using a process called a population (also known as a crawl). There are 3 modes of population </span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u><br /></u></i></b></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u> A) Full Population -</u></i></b><span style="color: #444444;"> As the name suggests builds full-text indexes for all the rows of the table. Similar to that of a standard index rebuild operation. The default behavior of SQL server is to populate a new full-text index fully as soon as it is created.</span></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u><br /></u></i></b></span></div>
<div>
<u style="font-family: Georgia, 'Times New Roman', serif; font-style: italic; font-weight: bold;">B) Change Tracking-Based Population </u><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">/</span><b style="font-family: Georgia, 'Times New Roman', serif;"><i><u>Update Population </u></i></b><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">This uses change tracking functionality of SQL server. SQL server maintains a table which tracks modifications made to the index after its initial full population. Based on CHANGE_TRACKING property of the index whether set to AUTO or MANUAL the indexes are popul</span><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">ated.<span style="line-height: 18px;">Default behavior is Automatic Change_Tracking.</span></span><br />
<b><i><u><br /></u></i></b><span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u>C) Incremental Timestamp-Based Population -</u></i></b><span style="color: #444444;"> This requires that the indexed table has a column of timestamp data type. If such a column does not exists SQL server will treat it as a full population operation. If the column exists SQL Server will update the modified rows based on the value of the time-stamped column.</span></span></div>
<a href="https://technet.microsoft.com/en-us/library/ms142575(v=sql.105).aspx">https://technet.microsoft.com/en-us/library/ms142575(v=sql.105).aspx</a><br />
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span><b><i style="background-color: cyan;"><span style="font-family: "georgia" , "times new roman" , serif;">7) Thesaurus</span></i></b> </div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br />Thesaurus comprises of synonyms or word expansions for any given word. Each language has its own set of defined synonyms. This is an XML file stored in file system. This broadens our search criteria to find similar words at querying time. </span></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">Thesaurus matching occurs only for CONTAINS and CONTAINSTABLE queries that specify the FORMSOF THESAURUS clause and for FREETEXT and FREETEXTABLE queries. The default location for the thesaurus files is as follows</span><br />
<br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><SQL_Server_data_files_path>\<VersionSpecificInstance>\MSSQL\FTDATA\<br /><br />C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\FTData</span><br />
<br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">Beginning in SQL Server 2008, full-text search supports more than 50 diverse languages, such as English, Spanish, Chinese, Japanese, Arabic, Bengali, and Hindi. Once can check the list of supported full-text languages using the following query</span></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span>
<br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "consolas"; font-size: 9.5pt;">SELECT</span><span style="font-family: "consolas"; font-size: 9.5pt;"> <span style="color: grey;">*</span> <span style="color: blue;">FROM</span> <span style="color: green;">sys</span><span style="color: grey;">.</span><span style="color: green;">fulltext_languages<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "consolas"; font-size: 9.5pt;"><span style="color: green;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">There are a list of system tables corresponding to fulltext which you can view for each of the above described components</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcsioe8PLpqgB0KO5rUE3LZZ4YK04M0qkxF-CrVHZ50emEmO_PRwX804DOWi1GECeC5TqdIHx_OTN1PYp7Et28xekg9l7cL-dpaxy4XjwJ05f8JDPY7Kl7aD8nOtSEVDTRAqBGyiZ2ido/s1600/FulTextCatalogs.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcsioe8PLpqgB0KO5rUE3LZZ4YK04M0qkxF-CrVHZ50emEmO_PRwX804DOWi1GECeC5TqdIHx_OTN1PYp7Et28xekg9l7cL-dpaxy4XjwJ05f8JDPY7Kl7aD8nOtSEVDTRAqBGyiZ2ido/s1600/FulTextCatalogs.jpg" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="color: #2a2a2a; font-family: "segoe ui" , "sans-serif"; font-size: 10pt; line-height: 15.3333px;"><br /></span></div>
<div class="MsoNormal">
<br />
<br /></div>
<div class="MsoNormal">
<span style="color: #2a2a2a; font-family: "segoe ui" , "sans-serif"; font-size: 10pt; line-height: 15.3333px;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #2a2a2a; font-family: "segoe ui" , "sans-serif"; font-size: 10pt; line-height: 15.3333px;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #2a2a2a; font-family: "segoe ui" , "sans-serif"; font-size: 10pt; line-height: 15.3333px;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #2a2a2a; font-family: "segoe ui" , "sans-serif"; font-size: 10pt; line-height: 15.3333px;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #2a2a2a; font-family: "segoe ui" , "sans-serif"; font-size: 10pt; line-height: 15.3333px;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #2a2a2a; font-family: "segoe ui" , "sans-serif"; font-size: 10pt; line-height: 15.3333px;"><br /></span></div>
<div class="MsoNormal">
<br />
<br /></div>
<div class="MsoNormal">
<span style="color: #2a2a2a; font-family: "segoe ui" , "sans-serif"; font-size: 10pt; line-height: 15.3333px;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "georgia" , "times new roman" , serif; line-height: 15.3333px;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "georgia" , "times new roman" , serif; line-height: 15.3333px;"><br /></span></div>
<h3 style="text-align: left;">
<span style="font-family: "georgia" , "times new roman" , serif; font-size: small;"><br />Full-Text Index Architecture</span></h3>
<div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinACaAw2JvsmDlxhOdXf8-RNXb8D1zOV1D53ljvqGAvYs-lgKFUC2YvJB5-EqBE5SQtYuB2_Mv0ttWkvrHu_pPCAXvSfpfyDrpjSfJlAUQixlJP15fnJApPfQopmhBeVs7CBd0zqQh_U0/s1600/FullText+Architecture.jpg" imageanchor="1" style="clear: left; display: inline !important; float: left; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" height="372" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinACaAw2JvsmDlxhOdXf8-RNXb8D1zOV1D53ljvqGAvYs-lgKFUC2YvJB5-EqBE5SQtYuB2_Mv0ttWkvrHu_pPCAXvSfpfyDrpjSfJlAUQixlJP15fnJApPfQopmhBeVs7CBd0zqQh_U0/s640/FullText+Architecture.jpg" width="640" /></a></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="line-height: 15.3333px;"><br /></span></span></div>
<div class="MsoNormal">
<span style="color: #2a2a2a; font-family: "segoe ui" , "sans-serif"; font-size: 10pt; line-height: 15.3333px;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #2a2a2a; font-family: "segoe ui" , "sans-serif"; font-size: 10pt; line-height: 15.3333px;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #2a2a2a; font-family: "segoe ui" , "sans-serif"; font-size: 10pt; line-height: 15.3333px;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #2a2a2a; font-family: "segoe ui" , "sans-serif"; font-size: 10pt; line-height: 15.3333px;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #2a2a2a; font-family: "segoe ui" , "sans-serif"; font-size: 10pt; line-height: 15.3333px;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #2a2a2a; font-family: "segoe ui" , "sans-serif"; font-size: 10pt; line-height: 15.3333px;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #2a2a2a; font-family: "segoe ui" , "sans-serif"; font-size: 10pt; line-height: 15.3333px;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #2a2a2a; font-family: "segoe ui" , "sans-serif"; font-size: 10pt; line-height: 15.3333px;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #2a2a2a; font-family: "segoe ui" , "sans-serif"; font-size: 10pt; line-height: 15.3333px;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #2a2a2a; font-family: "segoe ui" , "sans-serif"; font-size: 10pt; line-height: 15.3333px;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #2a2a2a; font-family: "segoe ui" , "sans-serif"; font-size: 10pt; line-height: 15.3333px;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #2a2a2a; font-family: "segoe ui" , "sans-serif"; font-size: 10pt; line-height: 15.3333px;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #2a2a2a; font-family: "segoe ui" , "sans-serif"; font-size: 10pt; line-height: 15.3333px;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">1) <u>Client application</u> submits a query containing Full-Text search contents</span></div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br />2) <u>Query is passed</u> to the SQL server engine comprising of SQL Server Query Processor and Full-Text Engine along with various other components<br /><br />3) <u>The Full-Text searches are sent</u> to Full-Text Engine during both the stage Compilation and Execution. SQL Server Query Processor is responsible for parsing, binding, optimization and execution.The Full-Text Engine receives the Full-Text part of the queries from the query processor. It works in conjunction with the SQL server query processor.<br /><br />4) In order to full the requests a <u>Full-Text engine calls for the Indexer</u>. The indexer is responsible for <u>evaluating the StopList and populating Full-Text Indexes</u> which form a part of the database from SQL server 2008 onwards. Prior to this they were stored separately on file systems. StopList will also contain stopwords which are ignored during query evaluation.<br /><br />5) <u>Thesaurus is used</u> during Full-Text query compilation and execution. Its external to the SQL server database. This file is also used by the Filer Daemon Launcher Service which is again external to the SQLservr.Exe<br /><br />6) <u>Filter Daemon Manager</u> is responsible for monitoring the <u>Filer Daemon Launcher Service or Host Service</u>.Its external to the SQL Server Engine.Inside SQL server engine the user tables are evaluated during full-text index population or crawl process by the indexer. This data is also used by the Filter Daemon Manager process which passes this information to the Host Service.<br /><br />7) The Filter Daemon Host is responsible for <u>accessing, filtering, and word breaking data</u> from tables, as well as for word breaking and stemming the query input: It comprises of</span></div>
</div>
<div>
<br /></div>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;">a) </span><b>The protocol handler </b><span style="color: #444444;">which is responsible for pulling SQL server data from memory and passing the database data to the filter.</span></span><br />
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">b) </span><span style="font-family: "georgia" , "times new roman" , serif;"><b>The filter</b></span><span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"> extracts chunks of data from the input provided by protocol handler. This is dependent on the document type. The embedded formatting is removed by the filter retaining only the textual contents and their position information. This result-set is then passed to the work-breakers. </span><br /><span style="color: #444444;">c)</span><b>The word-breakers</b><span style="color: #444444;"> delimit the result-set. These word-breakers are also passed to the indexer by the Filter Daemon Launcher Service. Just like the stoplist the word-breaker are ignored </span></span></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif; font-size: x-small;"><br /></span>
<br />
<div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">8) <u>During indexing process</u> the indexer uses all of the above result-set namely </span></div>
<div>
<ul style="text-align: left;">
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">Tokenized daata from full-text crawl threads </span></li>
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">Del</span><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">imited result-set from the Filter Daemon Host Service</span></li>
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">Stop-list </span><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">words that are to be excluded </span></li>
</ul>
</div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">It then creates index-able words to inverted index fragments. All these fragments are then merged to form the full-text indexes for the tables<br /><br />9) <u>During the querying process</u> the Full-Text Engine uses the full-text indexes generated by the indexer. The <u>word-breakers and thesaurus are first referenced</u> to generate all forms of query predicate. The <u>query processor then looks-up</u> for all these forms in the full-text indexes. The Full-Text Engine is also responsible for the optimization process much like a standard query optimization process <u>to retrieve the data</u>.<br /><br />10) The SQL query execution results and Full-Text query execution<u> results are combined </u>and the final result-set is <u>sent across the client</u>.</span></div>
</div>
</div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">In the next blog we shall see how to create Full-Text Catalogs,Indexes and how to use full-text index queries.</span></div>
</div>
Krutihttp://www.blogger.com/profile/13385897521211871375noreply@blogger.com2tag:blogger.com,1999:blog-8195522014866487394.post-80584211545554886272016-03-15T05:33:00.000-07:002016-03-15T05:40:03.907-07:00Memory Fundamentals for SQL Server - References<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="text-align: left;">
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span><span style="font-family: "georgia" , "times new roman" , serif;">Book References</span></h2>
<span style="color: blue; font-family: "georgia" , "times new roman" , serif;"><a href="https://books.google.co.in/books/about/Professional_SQL_Server_2012_Internals_a.html?id=-TjHHnP8ivEC">https://books.google.co.in/books/about/Professional_SQL_Server_2012_Internals_a.html?id=-TjHHnP8ivEC</a></span><br />
<span style="color: blue; font-family: "georgia" , "times new roman" , serif;"><br /><a href="https://books.google.co.in/books/about/Microsoft_SQL_Server_2008_Internals.html?id=NJUpAQAAMAAJ&redir_esc=y">https://books.google.co.in/books/about/Microsoft_SQL_Server_2008_Internals.html?id=NJUpAQAAMAAJ&redir_esc=y</a></span><br />
<br />
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: blue;"><a href="https://books.google.co.in/books/about/Microsoft_SQL_Server_2012_Internals.html?id=wK1CAwAAQBAJ&redir_esc=y">https://books.google.co.in/books/about/Microsoft_SQL_Server_2012_Internals.html?id=wK1CAwAAQBAJ&redir_esc=y</a></span></span><br />
<h2 style="text-align: left;">
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></h2>
<h2 style="text-align: left;">
<span style="font-family: "georgia" , "times new roman" , serif;">Topic Wise Blogs</span></h2>
<br />
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="background-color: cyan;"><u><i><b>
32-bit / 64-bit</b></i></u></span><br /><br /><a href="http://sqlblog.com/blogs/jonathan_kehayias/archive/2009/07/07/understanding-the-vas-reservation-aka-memtoleave-in-sql-server.aspx">http://sqlblog.com/blogs/jonathan_kehayias/archive/2009/07/07/understanding-the-vas-reservation-aka-memtoleave-in-sql-server.aspx</a><br /><br /><a href="https://msdn.microsoft.com/en-us/library/ms187499(v=sql.105).aspx">https://msdn.microsoft.com/en-us/library/ms187499(v=sql.105).aspx</a><br /><br /> <br /><b><i><u style="background-color: cyan;">/3GB Switch, /PAE Switch, AWE</u></i></b><br /><br /><a href="https://blogs.technet.microsoft.com/beatrice/2008/08/29/3gb-pae-and-awe-taking-away-some-confusion/">https://blogs.technet.microsoft.com/beatrice/2008/08/29/3gb-pae-and-awe-taking-away-some-confusion/</a><br /><br /><a href="http://blogs.technet.com/b/marcelofartura/archive/2006/09/14/3gb-pae-awe-what-basic.aspx">http://blogs.technet.com/b/marcelofartura/archive/2006/09/14/3gb-pae-awe-what-basic.aspx</a><br /><br /><a href="http://blogs.technet.com/b/perfguru/archive/2007/12/05/scenarios-using-3gb-and-pae-switch-and-appropriate-uses-of-these-switches.aspx">http://blogs.technet.com/b/perfguru/archive/2007/12/05/scenarios-using-3gb-and-pae-switch-and-appropriate-uses-of-these-switches.aspx</a><br /><br /><a href="https://blogs.msdn.microsoft.com/chadboyd/2007/03/24/pae-and-3gb-and-awe-oh-my/">https://blogs.msdn.microsoft.com/chadboyd/2007/03/24/pae-and-3gb-and-awe-oh-my/</a><br /><br /><a href="http://blogs.msdn.com/b/slavao/archive/2005/04/29/413425.aspx">http://blogs.msdn.com/b/slavao/archive/2005/04/29/413425.aspx</a><br /><br /><a href="http://blogs.msdn.com/b/slavao/archive/2005/06/03/424905.aspx">http://blogs.msdn.com/b/slavao/archive/2005/06/03/424905.aspx</a><br /><br /><a href="http://sqlblog.com/blogs/jonathan_kehayias/archive/2009/07/07/understanding-the-vas-reservation-aka-memtoleave-in-sql-server.aspx">http://sqlblog.com/blogs/jonathan_kehayias/archive/2010/10/12/tsql-tuesday-11-misconceptions-enable-awe-on-64bit-sql-servers.aspx</a><br /><br /><a href="http://sqlblog.com/blogs/jonathan_kehayias/archive/2009/08/24/troubleshooting-the-sql-server-memory-leak-or-understanding-sql-server-memory-usage.aspx">http://sqlblog.com/blogs/jonathan_kehayias/archive/2009/08/24/troubleshooting-the-sql-server-memory-leak-or-understanding-sql-server-memory-usage.aspx</a><br /><br /><a href="http://sqlblog.com/blogs/jonathan_kehayias/archive/2009/07/07/understanding-the-vas-reservation-aka-memtoleave-in-sql-server.aspx">http://sqlblog.com/blogs/jonathan_kehayias/archive/2009/07/07/understanding-the-vas-reservation-aka-memtoleave-in-sql-server.aspx</a><br /><br /><a href="https://msdn.microsoft.com/en-us/library/ms189334(v=sql.105).aspx">https://msdn.microsoft.com/en-us/library/ms189334(v=sql.105).aspx</a><br /><br /><a href="https://msdn.microsoft.com/en-us/library/ms175581(v=sql.105).aspx">https://msdn.microsoft.com/en-us/library/ms175581(v=sql.105).aspx</a><br /><br /><a href="https://blogs.msdn.microsoft.com/psssql/2009/09/11/fun-with-locked-pages-awe-task-manager-and-the-working-set/">https://blogs.msdn.microsoft.com/psssql/2009/09/11/fun-with-locked-pages-awe-task-manager-and-the-working-set/</a><br /><br /><b><i><u style="background-color: cyan;">SQLOS / Processes/ Threads/ CPU Models</u></i></b><br /><br /><a href="http://blogs.msdn.com/b/sqlmeditation/archive/2012/12/13/tasks-worker-threads-scheduler-threads-explain-it-all-and-dmvs.aspx">http://blogs.msdn.com/b/sqlmeditation/archive/2012/12/13/tasks-worker-threads-scheduler-threads-explain-it-all-and-dmvs.aspx</a><br /><br /><a href="https://technet.microsoft.com/en-us/library/ms189267(v=sql.105).aspx">https://technet.microsoft.com/en-us/library/ms189267(v=sql.105).aspx</a><br /><br /><a href="https://technet.microsoft.com/en-us/library/ms176043(v=sql.105).aspx">https://technet.microsoft.com/en-us/library/ms176043(v=sql.105).aspx</a><br /><br /><a href="https://technet.microsoft.com/en-us/library/ee210547(v=sql.105).aspx">https://technet.microsoft.com/en-us/library/ee210547(v=sql.105).aspx</a><br /><br /><a href="https://msdn.microsoft.com/en-in/library/ms178074.aspx">https://msdn.microsoft.com/en-in/library/ms178074.aspx</a><br /><br /><a href="https://mssqlwiki.com/2013/01/10/sql-server-operating-system-sos-series-1/">https://mssqlwiki.com/2013/01/10/sql-server-operating-system-sos-series-1/</a><br /><br /><a href="https://blogs.msdn.microsoft.com/sqljourney/2012/12/16/an-in-depth-look-at-sql-server-memorypart-1/">https://blogs.msdn.microsoft.com/sqljourney/2012/12/16/an-in-depth-look-at-sql-server-memorypart-1/</a><br /><br /><a href="http://www.practicalsqldba.com/2012/07/sql-server-sql-server-scheduler.html">http://www.practicalsqldba.com/2012/07/sql-server-sql-server-scheduler.html</a><br /><br /> <br /><b><i><u style="background-color: cyan;">SQL Memory Components</u></i></b><br /><br /><a href="https://www.blogger.com/goog_1191577973">http://blogs.msdn.com/b/slavao/archive/2005/03/18/398651.aspx</a><br /><br /><a href="https://www.blogger.com/goog_1191577973">http://blogs.msdn.com/b/slavao/archive/2005/08/30/458036.aspx</a><br /><span style="color: blue;"><br /><a href="http://blogs.msdn.com/b/slavao/archive/2005/02/19/376714.aspx">http://blogs.msdn.com/b/slavao/archive/2005/02/19/376714.aspx</a><br /><br /><a href="https://msdn.microsoft.com/en-us/library/cc293624.aspx">https://msdn.microsoft.com/en-us/library/cc293624.aspx</a><br /><br /><a href="https://msdn.microsoft.com/en-us/library/ms188754.aspx">https://msdn.microsoft.com/en-us/library/ms188754.aspx</a><br /><br /><a href="https://msdn.microsoft.com/en-us/library/ms176083.aspx">https://msdn.microsoft.com/en-us/library/ms176083.aspx</a></span></span><br />
<div>
<br /></div>
<div>
<b>Keep Learning, Keep Exploring, Keep Experimenting </b></div>
<h4 style="text-align: left;">
<span style="font-weight: normal;">P.S. (** Not on Production directly **)</span></h4>
</div>
Krutihttp://www.blogger.com/profile/13385897521211871375noreply@blogger.com0tag:blogger.com,1999:blog-8195522014866487394.post-76577751502902522762016-03-14T06:30:00.001-07:002016-03-14T06:30:14.212-07:00Memory Fundamentals for SQL Server - Buffer Pool, Mem To Leave<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "georgia" , "times new roman" , serif;">In the Previous blogs we saw about SQL server logical tree and the various memory caches.<br /><br /><a href="http://sqlandmorewithkruti.blogspot.in/2016/02/memory-fundamentals-for-sql-server-sql.html">http://sqlandmorewithkruti.blogspot.in/2016/02/memory-fundamentals-for-sql-server-sql.html</a></span><span style="font-family: "georgia" , "times new roman" , serif;"><br /></span>
<span style="font-family: "georgia" , "times new roman" , serif;">In this blog we shall see about Buffer Pool and Mem To Leave a little more in detail.</span><br />
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDTcIfm6kCJh5M4D_AxZJrj9bLI0WU9nkSuAFV7GOKwe_5VDhh7O4HQFEd8n99YzHP9c_75r-FSRfKRTMT6ScPGhhVRx4GJ-JyeG9jCIzAsK1ClkyYaANJ3AbfOAGWOOwD1OvMZ39QnWE/s1600/SQL+Mem.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDTcIfm6kCJh5M4D_AxZJrj9bLI0WU9nkSuAFV7GOKwe_5VDhh7O4HQFEd8n99YzHP9c_75r-FSRfKRTMT6ScPGhhVRx4GJ-JyeG9jCIzAsK1ClkyYaANJ3AbfOAGWOOwD1OvMZ39QnWE/s1600/SQL+Mem.png" /></a></div>
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span>
<br />
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<span style="font-weight: bold;"><br /></span></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<span style="font-weight: bold;"><br /></span></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<span style="font-weight: bold;"><br /></span></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<span style="font-weight: bold;"><br /></span></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<span style="font-weight: bold;"><br /></span></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<span style="font-weight: bold;"><br /></span></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<span style="font-weight: bold;"><br /></span></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<span style="font-weight: bold;"><br /></span></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<span style="font-weight: bold;"><br /></span></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<span style="font-weight: bold;"><br /></span></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<span style="font-weight: bold;"><br /></span></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<span style="font-weight: bold;"><br /></span></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<span style="font-weight: bold;"><br /></span></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<span style="font-weight: bold;"><br /></span></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<span style="font-weight: bold;"><br /></span></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<span style="font-weight: bold;"><br /></span></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<span style="font-weight: bold;"><br /></span></div>
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<span style="font-weight: bold;"><br /></span></div>
<br />
<h2 style="text-align: left;">
<i><u><span style="font-family: "georgia" , "times new roman" , serif;">The Buffer Pool</span></u></i></h2>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">Buffer Pool comprises of a major component for SQL server memory. It comprises of various chunks of memory spread across User Mode of Virtual Address Space. Apart from the sections mentioned above any temporary memory needed by SQL server to perform hash or sort operations for a given query come from buffer pool. If the existing memory is insufficient SQL server may also use tempdb for the same.</span><br />
<br />
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;">Thread Space Calculation</u></i></b></span><br />
<br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">We know that SQL server executes tasks in terms of threads. <br />Microsoft suggests the below tables for configuring maximum number of worker threads<br /><a href="https://msdn.microsoft.com/en-us/library/ms190219.aspx">https://msdn.microsoft.com/en-us/library/ms190219.aspx</a></span><br />
<br />
<div style="direction: ltr;">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-color: #A3A3A3; border-style: solid; border-width: 1pt; direction: ltr;" valign="top">
<tbody>
<tr>
<td style="border-color: #A3A3A3; border-style: solid; border-width: 1pt; padding: 4pt 4pt 4pt 4pt; vertical-align: top; width: 1.3215in;"><div style="color: #2a2a2a; font-family: "Segoe UI"; font-size: 10.0pt; margin: 0in;">
<span style="font-weight: bold;">Number of CPUs</span></div>
</td>
<td style="border-color: #A3A3A3; border-style: solid; border-width: 1pt; padding: 4pt 4pt 4pt 4pt; vertical-align: top; width: 1.3027in;"><div style="color: #2a2a2a; font-family: "Segoe UI"; font-size: 10.0pt; margin: 0in;">
<span style="font-weight: bold;">32-bit computer</span></div>
</td>
<td style="border-color: #A3A3A3; border-style: solid; border-width: 1pt; padding: 4pt 4pt 4pt 4pt; vertical-align: top; width: 1.2937in;"><div style="color: #2a2a2a; font-family: "Segoe UI"; font-size: 10.0pt; margin: 0in;">
<span style="font-weight: bold;">64-bit computer</span></div>
</td>
</tr>
<tr>
<td style="border-color: #A3A3A3; border-style: solid; border-width: 1pt; padding: 4pt 4pt 4pt 4pt; vertical-align: top; width: 1.3215in;"><div style="color: #2a2a2a; font-family: "Segoe UI"; font-size: 10.0pt; margin: 0in;">
<=
4 processors</div>
</td>
<td style="border-color: #A3A3A3; border-style: solid; border-width: 1pt; padding: 4pt 4pt 4pt 4pt; vertical-align: top; width: 1.3027in;"><div style="color: #2a2a2a; font-family: "Segoe UI"; font-size: 10.0pt; margin: 0in; text-align: right;">
256</div>
</td>
<td style="border-color: #A3A3A3; border-style: solid; border-width: 1pt; padding: 4pt 4pt 4pt 4pt; vertical-align: top; width: 1.2937in;"><div style="color: #2a2a2a; font-family: "Segoe UI"; font-size: 10.0pt; margin: 0in; text-align: right;">
512</div>
</td>
</tr>
<tr>
<td style="border-color: #A3A3A3; border-style: solid; border-width: 1pt; padding: 4pt 4pt 4pt 4pt; vertical-align: top; width: 1.3215in;"><div style="color: #2a2a2a; font-family: "Segoe UI"; font-size: 10.0pt; margin: 0in;">
8
processors</div>
</td>
<td style="border-color: #A3A3A3; border-style: solid; border-width: 1pt; padding: 4pt 4pt 4pt 4pt; vertical-align: top; width: 1.3027in;"><div style="color: #2a2a2a; font-family: "Segoe UI"; font-size: 10.0pt; margin: 0in; text-align: right;">
288</div>
</td>
<td style="border-color: #A3A3A3; border-style: solid; border-width: 1pt; padding: 4pt 4pt 4pt 4pt; vertical-align: top; width: 1.2937in;"><div style="color: #2a2a2a; font-family: "Segoe UI"; font-size: 10.0pt; margin: 0in; text-align: right;">
576</div>
</td>
</tr>
<tr>
<td style="border-color: #A3A3A3; border-style: solid; border-width: 1pt; padding: 4pt 4pt 4pt 4pt; vertical-align: top; width: 1.3215in;"><div style="color: #2a2a2a; font-family: "Segoe UI"; font-size: 10.0pt; margin: 0in;">
16
processors</div>
</td>
<td style="border-color: #A3A3A3; border-style: solid; border-width: 1pt; padding: 4pt 4pt 4pt 4pt; vertical-align: top; width: 1.3027in;"><div style="color: #2a2a2a; font-family: "Segoe UI"; font-size: 10.0pt; margin: 0in; text-align: right;">
352</div>
</td>
<td style="border-color: #A3A3A3; border-style: solid; border-width: 1pt; padding: 4pt 4pt 4pt 4pt; vertical-align: top; width: 1.2937in;"><div style="color: #2a2a2a; font-family: "Segoe UI"; font-size: 10.0pt; margin: 0in; text-align: right;">
704</div>
</td>
</tr>
<tr>
<td style="border-color: #A3A3A3; border-style: solid; border-width: 1pt; padding: 4pt 4pt 4pt 4pt; vertical-align: top; width: 1.3215in;"><div style="color: #2a2a2a; font-family: "Segoe UI"; font-size: 10.0pt; margin: 0in;">
32
processors</div>
</td>
<td style="border-color: #A3A3A3; border-style: solid; border-width: 1pt; padding: 4pt 4pt 4pt 4pt; vertical-align: top; width: 1.3027in;"><div style="color: #2a2a2a; font-family: "Segoe UI"; font-size: 10.0pt; margin: 0in; text-align: right;">
480</div>
</td>
<td style="border-color: #A3A3A3; border-style: solid; border-width: 1pt; padding: 4pt 4pt 4pt 4pt; vertical-align: top; width: 1.2937in;"><div style="color: #2a2a2a; font-family: "Segoe UI"; font-size: 10.0pt; margin: 0in; text-align: right;">
960</div>
</td>
</tr>
<tr>
<td style="border-color: #A3A3A3; border-style: solid; border-width: 1pt; padding: 4pt 4pt 4pt 4pt; vertical-align: top; width: 1.3215in;"><div style="color: #2a2a2a; font-family: "Segoe UI"; font-size: 10.0pt; margin: 0in;">
64
processors</div>
</td>
<td style="border-color: #A3A3A3; border-style: solid; border-width: 1pt; padding: 4pt 4pt 4pt 4pt; vertical-align: top; width: 1.3027in;"><div style="color: #2a2a2a; font-family: "Segoe UI"; font-size: 10.0pt; margin: 0in; text-align: right;">
736</div>
</td>
<td style="border-color: #A3A3A3; border-style: solid; border-width: 1pt; padding: 4pt 4pt 4pt 4pt; vertical-align: top; width: 1.2937in;"><div style="color: #2a2a2a; font-family: "Segoe UI"; font-size: 10.0pt; margin: 0in; text-align: right;">
1472</div>
</td>
</tr>
<tr>
<td style="border-color: #A3A3A3; border-style: solid; border-width: 1pt; padding: 4pt 4pt 4pt 4pt; vertical-align: top; width: 1.3215in;"><div style="color: #2a2a2a; font-family: "Segoe UI"; font-size: 10.0pt; margin: 0in;">
128
processors</div>
</td>
<td style="border-color: #A3A3A3; border-style: solid; border-width: 1pt; padding: 4pt 4pt 4pt 4pt; vertical-align: top; width: 1.3027in;"><div style="color: #2a2a2a; font-family: "Segoe UI"; font-size: 10.0pt; margin: 0in; text-align: right;">
4224</div>
</td>
<td style="border-color: #A3A3A3; border-style: solid; border-width: 1pt; padding: 4pt 4pt 4pt 4pt; vertical-align: top; width: 1.2937in;"><div style="color: #2a2a2a; font-family: "Segoe UI"; font-size: 10.0pt; margin: 0in; text-align: right;">
4480</div>
</td>
</tr>
<tr>
<td style="border-color: #A3A3A3; border-style: solid; border-width: 1pt; padding: 4pt 4pt 4pt 4pt; vertical-align: top; width: 1.3215in;"><div style="color: #2a2a2a; font-family: "Segoe UI"; font-size: 10.0pt; margin: 0in;">
256
processors</div>
</td>
<td style="border-color: #A3A3A3; border-style: solid; border-width: 1pt; padding: 4pt 4pt 4pt 4pt; vertical-align: top; width: 1.3027in;"><div style="color: #2a2a2a; font-family: "Segoe UI"; font-size: 10.0pt; margin: 0in; text-align: right;">
8320</div>
</td>
<td style="border-color: #A3A3A3; border-style: solid; border-width: 1pt; padding: 4pt 4pt 4pt 4pt; vertical-align: top; width: 1.2937in;"><div style="color: #2a2a2a; font-family: "Segoe UI"; font-size: 10.0pt; margin: 0in; text-align: right;">
8576</div>
</td>
</tr>
</tbody></table>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br />
</span></div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">StackSize is the space required to create each thread stack. For each thread On x86 (32-bit) its 0.5MB, on x64 (64-bit) its 2MB, and on IA64 its 4MB. </span><br />
<span style="background-color: cyan;"><br /><span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u>Determining the Maximum Potential for Non-Buffer Pool Usage based on No. of Threads </u></i></b></span></span><br />
<br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">This option is the most popular, as the aim is to calculate the worst-case scenario for memory requirements other than SQL Serverâs buffer pool. You should allow the following: <br /><br />⤠2GB for Windows <br />⤠xGB for SQL Server worker threads. You can figure out how many threads your instance will configure using Table shown earlier. Each thread will use 0.5MB on x86, 2MB on x64, <br />and 4MB on Itanium. <br />⤠1GB for multi-page allocations, linked servers, and other consumers of memory outside the buffer pool. See the âReserved Memory, or MemToLeaveâ section for more details and other consumers. <br />⤠1â3GB for other applications that might be running on the system, such as backup programs. </span><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">For example, on a server with eight CPU cores and 16GB of RAM running SQL Server 2008 x64 and a third-party backup utility, you would allow the following: <br /><br />⤠2GB for Windows <br />⤠1GB for worker threads (576 à 2MB rounded down) <br />⤠1GB for MPAs, etc. <br />⤠1GB for the backup program <br /><br />The total is 5GB, and you would configure Max Server Memory to 11GB. This is just a rough estimate how memory for the buffer pool can be calculated. </span><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">You can view the existing threads within SQL server with the below query.</span><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"></span><br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;">SELECT</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: grey;">*</span> <span style="color: blue;">FROM</span> <span style="color: green;">SYS</span><span style="color: grey;">.</span><span style="color: green;">dm_os_threads<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #595959; font-size: 9.0pt;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbHhddQ6mzGmEPnTtxgA4DAYevL76e5mqSAN_9K6nYgu0aNRKz6mWr0ApUf-BbAfLTdfYWQqVnuU4PtGmRUBnGPnTKHdLSE3fvOVzU37pgL-OkUm03ZAwD4WHC0tzbP6hs1dHHwv0rxVg/s1600/threadinfo.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="138" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbHhddQ6mzGmEPnTtxgA4DAYevL76e5mqSAN_9K6nYgu0aNRKz6mWr0ApUf-BbAfLTdfYWQqVnuU4PtGmRUBnGPnTKHdLSE3fvOVzU37pgL-OkUm03ZAwD4WHC0tzbP6hs1dHHwv0rxVg/s640/threadinfo.png" width="640" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbHhddQ6mzGmEPnTtxgA4DAYevL76e5mqSAN_9K6nYgu0aNRKz6mWr0ApUf-BbAfLTdfYWQqVnuU4PtGmRUBnGPnTKHdLSE3fvOVzU37pgL-OkUm03ZAwD4WHC0tzbP6hs1dHHwv0rxVg/s1600/threadinfo.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbHhddQ6mzGmEPnTtxgA4DAYevL76e5mqSAN_9K6nYgu0aNRKz6mWr0ApUf-BbAfLTdfYWQqVnuU4PtGmRUBnGPnTKHdLSE3fvOVzU37pgL-OkUm03ZAwD4WHC0tzbP6hs1dHHwv0rxVg/s1600/threadinfo.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbHhddQ6mzGmEPnTtxgA4DAYevL76e5mqSAN_9K6nYgu0aNRKz6mWr0ApUf-BbAfLTdfYWQqVnuU4PtGmRUBnGPnTKHdLSE3fvOVzU37pgL-OkUm03ZAwD4WHC0tzbP6hs1dHHwv0rxVg/s1600/threadinfo.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<span style="color: #444444; font-family: georgia, 'times new roman', serif;">In SQL server terms a buffer is equivalent to a page in memory of size 8KB. A buffer is a page in memory thatâs the same size as a data or index page. The main components comprising the data cache and plan cache. You can view the pages in SQL server buffer as follows</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiimZX6pFAP1knD12NSr5y1XqgxuWredH0q6GTS7RJviv2N1dEKj8XAEHJc74-ZbEbjjfL8eJjUr28QBKWGQCgBZnzzzKN4YPF8gHRtwDX5UR2ha_GqRfev3887BXDmRzYQkGxkGqKYFLc/s640/pagetypes.png" /><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /><br /><br />You can modify the query further to view the pages allocated per database.</span><br />
<div>
<div style="font-size: 11pt; margin: 0in;">
<br /></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;">SELECT</span> <span style="color: blue;">CASE</span>
database_id</div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;">WHEN</span> 32767 <span style="color: blue;">THEN</span> <span style="color: red;">'ResourceDb'</span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;">ELSE</span> <span style="color: magenta;">db_name</span><span style="color: grey;">(</span>database_id<span style="color: grey;">)</span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;">END</span> <span style="color: blue;">AS</span> <span style="color: red;">'Database'</span><span style="color: grey;">,</span>page_type<span style="color: grey;">,</span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: magenta;">count</span><span style="color: grey;">(*)</span> <span style="color: blue;">as</span> "Page Count"<span style="color: grey;">,</span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: magenta;">count</span><span style="color: grey;">(*)*</span>8 <span style="color: blue;">AS</span> <span style="color: red;">'Cached Size (KB)'</span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;">FROM</span> <span style="color: green;">sys</span><span style="color: grey;">.</span><span style="color: green;">dm_os_buffer_descriptors</span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;">GROUP</span> <span style="color: blue;">BY</span> <span style="color: magenta;">db_name</span><span style="color: grey;">(</span>database_id<span style="color: grey;">)</span> <span style="color: grey;">,</span>database_id<span style="color: grey;">,</span> page_type</div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;">ORDER</span> <span style="color: blue;">BY</span> <span style="color: red;">'Cached Size (KB)'</span> <span style="color: blue;">desc</span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzvqFoOaHC-Xua8NVihwbR2rDbJG8VLcDTYsd4yJlax8dPD7Uloa16FKpZZhXXQoRurww-mJpNBXj0M4PXaJYAfxqAyWtYBbEo9OTdInMPFP9BQ8xi2HIW_rA09KL2KemcBO-hET_d1BU/s1600/databasewiseutilization.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzvqFoOaHC-Xua8NVihwbR2rDbJG8VLcDTYsd4yJlax8dPD7Uloa16FKpZZhXXQoRurww-mJpNBXj0M4PXaJYAfxqAyWtYBbEo9OTdInMPFP9BQ8xi2HIW_rA09KL2KemcBO-hET_d1BU/s1600/databasewiseutilization.png" /></a></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;"><br /></span></div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<br />
<br /></div>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;">Hashing</u></i></b><br /><br /><span style="color: #444444;">To access these data pages faster SQL server implements a technique called hashing. A hash table is structure in memory pointing to various buffer pages . This is implemented as a linked list with hash tables spanning across multiple hash pages. Given a dbid-fileno-pageno identifier (a combination of the database ID, fi le number, and page number), the hash function converts that key to the hash bucket, any data retrieved by SQL server is from pages within memory. If the page is not available in memory SQL server will fetch the same from the data file to any of the available buffers.</span></span><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">When a read is requested, it gets a list of 64 pages in cache and the server checks </span><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">whether the free buffer list is below a certain threshold.</span></div>
<div>
<b><i><u style="background-color: cyan;"><span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></u></i></b></div>
<b><i><u style="background-color: cyan;"><span style="font-family: "georgia" , "times new roman" , serif;">BUF array </span></u></i></b><br />
<span style="color: #444444;"><br /><span style="font-family: "georgia" , "times new roman" , serif;">Bpool needs to maintain information regarding the pages allocated and their types in order to maintain the number of free buffers. It does so using 2 array structures. One stores the pointer to the start of each region in buffer pool. The other stores the count of 8KB pages that are reserved for this region. Each page in the BPool will have a corresponding BUF structure. Each page's BUF structure functions as a type of header for it. Each time a page is referenced, this reference count is incremented. SQL also maintains a free buffer list which contains the count of free pages. </span></span><br />
<span style="color: #444444;"><span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></span>
<b><i><u style="background-color: cyan;"><span style="font-family: "georgia" , "times new roman" , serif;">LRU-k Algorithm</span></u></i></b><br />
<br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">The amount of time that pages stay in cache is determined by a least recently used (LRU) policy. The header of each page (BUF structure) in cache stores details about the last two times it was accessed, and a periodic scan through the cache examines these values. A counter is maintained that is decremented if the page hasnât been accessed for a while; and when SQL Server needs to free up some cache, the pages with the lowest counter are flushed first.</span><br />
<div style="font-family: Calibri; font-size: 11.0pt; margin: 0in;">
<br /></div>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;">Commit Bitmap </u></i></b><br /><span style="color: #444444;"><br />Pages are first updated in memory only then written onto disk. These include data and log pages. SQL server maintains what is called a Commit Bitmap. As each page in the BPool is committed, its corresponding bit in the commit bitmap is set. The commit bitmap is also set when the reference count decreases as per the LRU-k algorithm. Once a page is dirty and successfully written to disk it is un-hashed and added to the free list. If a page's reference count reaches zero and the page is not dirty, it is simply freedâi.e., moved to the free list without writing anything to disk. </span></span><br />
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEji8JLOewNeUK18CJf7gkoIjoNFe2OJcXXMQPMYPR8TaS2U-3uLgwUuj39eYlEsezsanvChs6qIJ7ac5SrGx8FKnkt67rEfsdUsaac_QkHcQ77uVXRAzCidkfDaPJWXa41k_8rjjkRefyo/s1600/DirtyPageCount.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEji8JLOewNeUK18CJf7gkoIjoNFe2OJcXXMQPMYPR8TaS2U-3uLgwUuj39eYlEsezsanvChs6qIJ7ac5SrGx8FKnkt67rEfsdUsaac_QkHcQ77uVXRAzCidkfDaPJWXa41k_8rjjkRefyo/s1600/DirtyPageCount.png" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEji8JLOewNeUK18CJf7gkoIjoNFe2OJcXXMQPMYPR8TaS2U-3uLgwUuj39eYlEsezsanvChs6qIJ7ac5SrGx8FKnkt67rEfsdUsaac_QkHcQ77uVXRAzCidkfDaPJWXa41k_8rjjkRefyo/s1600/DirtyPageCount.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a></div>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span>
<br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span>
<div style="text-align: left;">
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;">Lazy-writer</u></i></b><br /><br /><span style="color: #444444;">Lazywriter is a thread that runs within SQL server. One for each NUMA node. Its task is to scan the BufferPool to ensure enough number of free pages are available in the free buffer list. It also monitors the server memory. If the OS free physical memory drops below 5MB the lazywriter releases memory to the operating system instead of adding it to the free list. If more than 5 MB of physical memory is free, the lazywriter recommits memory to the buffer pool by adding it to the free list.</span></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;">The lazywriter recommits memory to the buffer pool only when it repopulates the free list; a server at rest does not grow its buffer pool. Lazywriter also ensure that the minimum size of buffer pool is maintained before releasing memory back to operating system. SQL Server uses separate physical structures for a page and its header allows a page to be flushed to disk and to "move" from list to list without anything on the page actually changing. Once a page is written onto the disk and marked as free its contents can be over-written.</span><br /><br /><b><i><u style="background-color: cyan;">CheckPoint</u></i></b><br /><br /><span style="color: #444444;">Issuing a checkpoint performs similar functionality like lazywriter of scanning the buffer-pool for flushing out any dirty pages. Difference being it cannot move pages to the free list. Checkpoint can be fired manually to run issuing the CHECKPOINT command. Lazywriter thread wakes up on its own during memory pressure. Also all dirty data pages are written to disk by the checkpoint, not just pages corresponding to committed transactions. The job of the checkpoint is to keep the potential time needed to recover the database to a small value.</span></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;">Ideally CheckPoint is issued every minute. However this value is set based on the Recovery Interval setting for a database instance.</span></span><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">Trace flag 3502 is an undocumented trace </span><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">flag that records in the error log when a checkpoint starts and stops.</span><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRQYcIOV4hiDNOeAI5_P-AdMmDqIYzlc2-qdv-5v-e89KwW-6HpuZvdFYAWyzOF5a81PfezUbq2ET1h3MgYkItJNlyxiBRC6QMZt26CzhLB_G-y8omWUAzaUwZij63hpijgC3J5puCssc/s1600/Checkpoint+Setting.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRQYcIOV4hiDNOeAI5_P-AdMmDqIYzlc2-qdv-5v-e89KwW-6HpuZvdFYAWyzOF5a81PfezUbq2ET1h3MgYkItJNlyxiBRC6QMZt26CzhLB_G-y8omWUAzaUwZij63hpijgC3J5puCssc/s1600/Checkpoint+Setting.png" /></a></div>
<div>
<br /></div>
<a href="https://msdn.microsoft.com/en-IN/library/ms188748.aspx">https://msdn.microsoft.com/en-IN/library/ms188748.aspx</a></div>
<div>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">You can view the all of the Page Life Expentancy, Checkpoint, Lazywriter setting for a given database instance using perfmon as follows</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVlWFjLex2HvrLv2qKS40Q82Q8PGgwZ0TN3DaAsM467eNPzTDS39LgmQDxymkUdg6vnWN1qlfSYn1AIK68Lumh2C1ij4xZ5DY0cl-gF1yiKHCgOrcasWXxjjdHYdvEqynzTPv1AyctC40/s1600/perfmoncounters.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVlWFjLex2HvrLv2qKS40Q82Q8PGgwZ0TN3DaAsM467eNPzTDS39LgmQDxymkUdg6vnWN1qlfSYn1AIK68Lumh2C1ij4xZ5DY0cl-gF1yiKHCgOrcasWXxjjdHYdvEqynzTPv1AyctC40/s1600/perfmoncounters.png" /></a></div>
<br /></div>
<h2 style="text-align: left;">
<i><u><span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></u></i></h2>
<h2 style="text-align: left;">
<i><u><span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></u></i></h2>
<h2 style="text-align: left;">
<i><u><span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></u></i></h2>
<h2 style="text-align: left;">
<i><u><span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></u></i></h2>
<h2 style="text-align: left;">
<i><u><span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></u></i></h2>
<h2 style="text-align: left;">
<i><u><span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></u></i></h2>
<h2 style="text-align: left;">
<i><u><span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></u></i></h2>
<h2 style="text-align: left;">
<i><u><span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></u></i></h2>
<h2 style="text-align: left;">
<i><u><span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></u></i></h2>
<h2 style="text-align: left;">
<i><u><span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></u></i></h2>
<h2 style="text-align: left;">
<i><u><span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></u></i></h2>
<h2 style="text-align: left;">
<i><u><span style="font-family: "georgia" , "times new roman" , serif;">MeM To Leave</span></u></i></h2>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">As seen in the above diagram MemToLeave is used for Dll's,COM objects, extended stored procs, linked servers, distributed queries,SQL server code.</span><span style="color: #444444; font-family: georgia, 'times new roman', serif;">The size of the MemToLeave region can be adjusted using the -g command line parameter. This may be required when more memory is needed for linked server queries or any other objects residing in MemToLeave region. On the other hand reducing this is not advisable but provides more virtual memory space for Buffer Pool region.</span><br />
<span style="color: #444444; font-family: georgia, 'times new roman', serif;"><br /></span>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">One may view the loaded modules through the below command.</span><br />
<br />
<br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;">SELECT</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: grey;">*</span> <span style="color: blue;">FROM</span> <span style="color: green;">SYS</span><span style="color: grey;">.</span><span style="color: green;">dm_os_loaded_modules<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="color: green;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdYuAeLg2rpjFQfQUXD6cg7cTq5FdVbDEF1sIwhOJ0BUIViCmhhVaiZuGIs8iCqvLfdZ2EdlgVXFEd62DybMggqroVXHzPOh38ZtvDA26c-ajYWvv75RR6S8Po3_B2MaEHAouFrMk8X2w/s1600/loaded+modules.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="159" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdYuAeLg2rpjFQfQUXD6cg7cTq5FdVbDEF1sIwhOJ0BUIViCmhhVaiZuGIs8iCqvLfdZ2EdlgVXFEd62DybMggqroVXHzPOh38ZtvDA26c-ajYWvv75RR6S8Po3_B2MaEHAouFrMk8X2w/s640/loaded+modules.png" width="640" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdYuAeLg2rpjFQfQUXD6cg7cTq5FdVbDEF1sIwhOJ0BUIViCmhhVaiZuGIs8iCqvLfdZ2EdlgVXFEd62DybMggqroVXHzPOh38ZtvDA26c-ajYWvv75RR6S8Po3_B2MaEHAouFrMk8X2w/s1600/loaded+modules.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdYuAeLg2rpjFQfQUXD6cg7cTq5FdVbDEF1sIwhOJ0BUIViCmhhVaiZuGIs8iCqvLfdZ2EdlgVXFEd62DybMggqroVXHzPOh38ZtvDA26c-ajYWvv75RR6S8Po3_B2MaEHAouFrMk8X2w/s1600/loaded+modules.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdYuAeLg2rpjFQfQUXD6cg7cTq5FdVbDEF1sIwhOJ0BUIViCmhhVaiZuGIs8iCqvLfdZ2EdlgVXFEd62DybMggqroVXHzPOh38ZtvDA26c-ajYWvv75RR6S8Po3_B2MaEHAouFrMk8X2w/s1600/loaded+modules.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdYuAeLg2rpjFQfQUXD6cg7cTq5FdVbDEF1sIwhOJ0BUIViCmhhVaiZuGIs8iCqvLfdZ2EdlgVXFEd62DybMggqroVXHzPOh38ZtvDA26c-ajYWvv75RR6S8Po3_B2MaEHAouFrMk8X2w/s1600/loaded+modules.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdYuAeLg2rpjFQfQUXD6cg7cTq5FdVbDEF1sIwhOJ0BUIViCmhhVaiZuGIs8iCqvLfdZ2EdlgVXFEd62DybMggqroVXHzPOh38ZtvDA26c-ajYWvv75RR6S8Po3_B2MaEHAouFrMk8X2w/s1600/loaded+modules.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdYuAeLg2rpjFQfQUXD6cg7cTq5FdVbDEF1sIwhOJ0BUIViCmhhVaiZuGIs8iCqvLfdZ2EdlgVXFEd62DybMggqroVXHzPOh38ZtvDA26c-ajYWvv75RR6S8Po3_B2MaEHAouFrMk8X2w/s1600/loaded+modules.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<span style="color: #444444; font-family: Georgia, 'Times New Roman', serif;">Since MultiPage Allocations are a part of MemToLeave region, </span><br />
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Allocations needing contiguous memory blocks higher than 8KB come from this region. It could be procedure cache or data pages as well. However not necessary allocations needing lower than 8KB will always end up in buffer pool. It could also be found in MemToLeave region.</span><br />
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">As stated earlier SQL server memory is a vast topic to be covered within a few blogs. But as promised I shall provide the references that may be used to study each of these topics in detail in the next blog.</span></div>
</div>
Krutihttp://www.blogger.com/profile/13385897521211871375noreply@blogger.com1tag:blogger.com,1999:blog-8195522014866487394.post-19972768179902000292016-02-22T08:55:00.002-08:002016-03-09T04:40:57.142-08:00Memory Fundamentals for SQL Server - SQL Server Memory Components, SQL Server Memory Logical Tree<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "georgia" , "times new roman" , serif;"><br />In the Previous blogs we have seen about virtual memory related concepts.<br /><a href="http://sqlandmorewithkruti.blogspot.in/2016/01/memory-fundamentals-for-sql-server.html">http://sqlandmorewithkruti.blogspot.in/2016/01/memory-fundamentals-for-sql-server.html</a></span><br />
<div>
<br />
<span style="font-family: "georgia" , "times new roman" , serif;">We came across concepts like Address Window Extension, Physical Address Extension.</span></div>
<div>
<a href="http://sqlandmorewithkruti.blogspot.in/2016/02/memory-fundamentals-for-sql-server-awe.html" style="font-family: georgia, 'times new roman', serif;">http://sqlandmorewithkruti.blogspot.in/2016/02/memory-fundamentals-for-sql-server-awe.html</a></div>
<div>
<br /></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;">We also saw the various CPU related architectural concepts and briefly touch based SQLOS.</span></div>
<div>
<a href="http://sqlandmorewithkruti.blogspot.in/2016/02/memory-fundamentals-for-sql-server.html" style="font-family: georgia, 'times new roman', serif;">http://sqlandmorewithkruti.blogspot.in/2016/02/memory-fundamentals-for-sql-server.html</a></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;">In this blog we shall see how SQL server memory is divided.</span><br />
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2xXEOrQ2oMr0axRIA1lAwdwrtK3aglKtM2ahD7xkrguRr4i3R7YOIU76Voh6CRY7tdw7qkpxvDRZzNnRfvqBCJPADMOwQHg-e-__YPPkNp3y0hGHuK0IaRGH8xV4VPqUlL-sLn26rUDs/s1600/SQLServermemorycomponents.jpeg.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2xXEOrQ2oMr0axRIA1lAwdwrtK3aglKtM2ahD7xkrguRr4i3R7YOIU76Voh6CRY7tdw7qkpxvDRZzNnRfvqBCJPADMOwQHg-e-__YPPkNp3y0hGHuK0IaRGH8xV4VPqUlL-sLn26rUDs/s1600/SQLServermemorycomponents.jpeg.png" /></a></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">When SQL server starts memory is first reserved for the MEM To Leave area also known as Virtual Address Space Reservation area. This is not user configurable. Windows Memory Management allows user process to reserve a contiguous block of address space without actually consuming committed pages. This is called VAS reservation or MEM to Leave. Components of the Mem To Leave area are mentioned above. All allocations for a contiguous memory block larger than 8KB come from the MemToLeave region. it's possible that allocations smaller than 8KB could end up coming from the MemToLeave region.</span></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">The default size of Mem To Leave region is 256MB but can be changed using the -g parameter during SQL server startup.</span></div>
<div>
<br /></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">Next comes the BUFFER Pool</span></div>
<div>
<br />
<div style="text-align: left;">
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;">Calculation of BufferPool Region</u></i></b></span></div>
<br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">We have the maximum server memory option for any SQL server instance. This option decides the amount of memory that will be allocated for the Buffer Pool region. </span><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">Bpool consists of 32 separate memory regions organized into 8KB pages.</span><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span>
<b><i><u><span style="font-family: "georgia" , "times new roman" , serif;">In 32-Bit Systems</span></u></i></b><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br />Once the MemToLeave region is occupied the remaining Virtual Address Space is checked. The remainder of the VAS is calculated and reserved for SQL server. If this value is less than Max Server Configuration then that becomes the size of the Buffer Pool. </span><br />
<br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">The calculation of the Buffer Pool size however differs if the AWE is enabled and /PAE switch is used. Here the physcial memory on the server or the max server memory configuration setting, whichever is smaller becomes the size of the Buffer Pool.</span><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span>
<b><i><u><span style="font-family: "georgia" , "times new roman" , serif;">In 64-Bit Systems</span></u></i></b><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br />There is no need to use AWE to allocate memory above 3GB for SQL Server since the user mode VAS is 8TB there is always ample VAS to utilize all of the physical memory available on the server.</span><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br />For 64 bit servers, the maximum size of the BPool is the size of physical memory or the max server memory configuration, whichever is smaller. For example, a 64 bit server with 16GB RAM, and a default max server memory configuration, the maximum size of the Bpool would be 16GB. </span><br />
<br />
<h2 style="text-align: left;">
<i><u>SQL server memory logical level tree</u></i></h2>
<div>
<i><u><br /></u></i></div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">The SQL Server memory manager has a three-level structure. At the bottom are memory nodes which are the lowest level allocators for SQL Server memory, the second level consists of memory clerks which are used to access the memory nodes and cache stores which are used for caching. The top layer contains memory objects which provide a smaller level of granularity than the memory clerks allow directly. </span><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhbJkHwISsLbjr2-RBrX6uu3Tj4HrmbjcSfD674_HmSspTWpJqW5ogttu5JMoKNifgWirbqwswcxmw0m_NtdqwtqZfMCUg_pgPoGaOvCDHg8VEWBWob_TER2AvZjNyXKKmrTFU0AD7_J0/s1600/Memorystructure.jpeg.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhbJkHwISsLbjr2-RBrX6uu3Tj4HrmbjcSfD674_HmSspTWpJqW5ogttu5JMoKNifgWirbqwswcxmw0m_NtdqwtqZfMCUg_pgPoGaOvCDHg8VEWBWob_TER2AvZjNyXKKmrTFU0AD7_J0/s200/Memorystructure.jpeg.png" width="178" /></a></span></div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">
</span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;">Memory Nodes</u></i></b><br /><span style="color: #444444;">As described in the previous blog itâs a logical unit in which SQL server access memory.</span></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span></div>
<div>
<br />
<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyjIn3vXXA71chm3JFbnDLG50hEo9fFQPRE4OfcHVleNFe9zJkpuNBUmemZ8AEj9sIEMiN5zVQmyhNfedEo4QiiAhqiDA1-LIpkmfVBN5bUnKs0Ao9Yr2Wqx1OXfmbg5ObD7G0h3-8B3U/s1600/CPUMemNode.jpeg.png"><img border="0" height="376" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyjIn3vXXA71chm3JFbnDLG50hEo9fFQPRE4OfcHVleNFe9zJkpuNBUmemZ8AEj9sIEMiN5zVQmyhNfedEo4QiiAhqiDA1-LIpkmfVBN5bUnKs0Ao9Yr2Wqx1OXfmbg5ObD7G0h3-8B3U/s640/CPUMemNode.jpeg.png" width="640" /></a></div>
<div>
<br />
<br />
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;">Memory Clerks</u></i></b></span><br />
<br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">Memory clerks access memory nodes to allocate memory to different objects. Information on different types of memory clerks is listed using the below query. Till SQL server version 2008 you will be able to see the segregation of the single pages allocated and multiple pages allocated for particular objects.</span><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<div style="font-family: Consolas; font-size: 9.5pt; margin: 0in;">
<span style="color: blue;">select</span> <span style="color: blue;">distinct</span> <span style="color: blue;">type</span> <span style="color: blue;">from</span> <span style="color: green;">sys</span><span style="color: grey;">.</span><span style="color: green;">dm_os_memory_clerks</span> <span style="color: blue;">where</span>
<span style="color: blue;">type</span> <span style="color: grey;">like</span> <span style="color: red;">'mem%'</span> <span style="color: blue;">order</span> <span style="color: blue;">by</span> <span style="color: blue;">type</span>.</div>
<br />
<b><i><u><span style="background-color: cyan; font-family: "georgia" , "times new roman" , serif;">Memory Caches</span></u></i></b><br />
<br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">SQL Server uses three types of caching mechanism: object store, cache store, and user store.</span><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u>Object Store : </u></i></b></span><br />
<br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">Object stores are used to cache homogeneous types of stateless data. Each entry within this store can be used by only one client at a time. SQLOS does not control the lifetime of the entries in the object store type of cache. Hence it does not implement Least Recently Used (LRU) Algorithm for costing the entries and maintaining their lifetime. One example for use of an object store is the SNI, which uses the object store for pooling network buffers. No state, no cost , all buffers of the same size. </span><br />
<br />
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u>User Store: </u></i></b></span><br />
<br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">User stores are used for objects that has its own storage user's mechanism. How the objects are stored depends on the underlying development framework. SQLOS controls the lifetime of entries and maintains a cost based on LRU algorithm. One example of User Store objects is metadata cache. </span><br />
<br />
<b><i><u><span style="font-family: "georgia" , "times new roman" , serif;">Cache Store: </span></u></i></b><br />
<br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">For cache store the lifetime is fully controlled by SQLOS's caching framework. The storage mechanism is SQL OS managed. SQLOS does this with what is called the hashing technique wherein the entry for each object is stored in one or multiple tables. This supports for faster look-ups. SQLOS controls the lifetime of entries and maintains a cost based on LRU algorithm. Object Plans (CACHESTORE_OBJCP), SQL Plans (CACHESTORE_SQLCP), Bound Trees (CACHESTORE_PHDR), Extended Stored Procedures (CACHESTORE_XPROC) all fall within this cache store. </span><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">I recommend you go through the below blogs to study further.</span><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span>
<a href="https://www.blogger.com/goog_1191577973">http://blogs.msdn.com/b/slavao/archive/2005/03/18/398651.aspx</a><br />
<a href="https://www.blogger.com/goog_1191577973">http://blogs.msdn.com/b/slavao/archive/2005/08/30/458036.aspx</a><br />
<a href="http://blogs.msdn.com/b/slavao/archive/2005/02/19/376714.aspx">http://blogs.msdn.com/b/slavao/archive/2005/02/19/376714.aspx</a><br />
<a href="https://msdn.microsoft.com/en-us/library/cc293624.aspx">https://msdn.microsoft.com/en-us/library/cc293624.aspx</a><br />
<br />
<span style="font-family: "georgia" , "times new roman" , serif;">Thus SQL server memory gets divided into various stores. On the whole MemToLeave and BufferPool is what comprises the SQL server memory. In the next blog we shall see how SQL server responds to memory pressure. How the memory caches are accounted for based on LRU & hashing algorithms.<br />
</span><br />
<div style="font-size: 11pt; margin: 0in;">
<br /></div>
</div>
</div>
Krutihttp://www.blogger.com/profile/13385897521211871375noreply@blogger.com3tag:blogger.com,1999:blog-8195522014866487394.post-7047474835374601152016-02-09T04:22:00.002-08:002016-02-09T04:23:12.561-08:00Memory Fundamentals for SQL Server - Process-Thread Model, CPU execution model, CPU scheduling, CPU Architechture, SQLOS<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="margin: 0in;">
<span style="font-family: "georgia" , "times new roman" , serif;">Until now we have
seen the windows memory addressing concepts.</span></div>
<div style="margin: 0in;">
<span style="color: blue; font-family: "georgia" , "times new roman" , serif;"><a href="https://www.blogger.com/goog_2081258256"><br /></a></span></div>
<div style="margin: 0in;">
<span style="color: blue; font-family: "georgia" , "times new roman" , serif;"><a href="https://www.blogger.com/goog_2081258256">http://sqlandmorewithkruti.blogspot.in/2016/01/memory-fundamentals-for-sql-server.html</a></span></div>
<span style="color: blue; font-family: "georgia" , "times new roman" , serif;"><a href="http://sqlandmorewithkruti.blogspot.in/2016/02/memory-fundamentals-for-sql-server-awe.html">http://sqlandmorewithkruti.blogspot.in/2016/02/memory-fundamentals-for-sql-server-awe.html</a></span><br />
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span>
<span style="font-family: "georgia" , "times new roman" , serif;">So how exactly are user applications like SQL server assigned to this space. To understand this we need to see how the application is broken in terms of processes and threads.</span><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span>
<br />
<h2 style="margin: 0in; text-align: left;">
<span style="font-family: "georgia" , "times new roman" , serif;"><i><u>Process</u></i></span></h2>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><i><u><br /></u></i></span></div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">A process is an instance of a running program on Windows. A process can have one or more threads .Each process consists of 2 components process kernel object and virtual address space.The virtual address space contains all the code and data. However the executable code and data isn't loaded until required by the operating system in page-sized chunks (4K for Win32 on x86). Every executable or DLL file mapped into a process's address space is assigned a unique instance handle. SQL Server is a process that can run as either a service or a console mode application</span><br />
<div style="margin: 0in;">
<br /></div>
<h2 style="margin: 0in; text-align: left;">
<span style="font-family: "georgia" , "times new roman" , serif;"><i><u>Threads</u></i></span></h2>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><i><u><br /></u></i></span></div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">Threads are unit of execution of a process. Without threads application processes are incapable of carrying out any task on the system. By virtue of Windows' process separation, a thread can't access the address space of other processes without a shared memory section. Once a process is created, the system automatically creates its first thread called primary or main thread. When this thread is killed or exits the process ends.</span><br />
<div>
<br /></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="background-color: cyan;"><b><i><u>Quantum</u></i></b></span><br /><span style="color: #444444;"><br /></span></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;">Amount of time a thread is allowed to execute on the processor. When the Quantum is reached or until a higher priority thread interrupts the thread is interrupted and another thread is allowed to run on the processor. This movement of thread out of processor is called Yielding.</span></span><br />
<br />
<br />
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="background-color: cyan;"><b><i><u>Context Switching</u></i></b></span></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">When a new thread is selected to run on a processor if the existing thread is interrupted or if the quantum is met some piece of information is saved and loaded next time the thread is back on the CPU for execution. This information consists of data in the volatile registers and other program counters. This process of saving clearing and loading data between thread switching is called context switching.</span><br />
<span style="font-family: "georgia" , "times new roman" , serif;"><u><i><b style="background-color: cyan;"><br /></b></i></u></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><u><i><b style="background-color: cyan;">Thread States</b></i></u></span><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">A thread can exists in any of the below states <br />0 Initialized<br />1 Readyâ waiting on a processor<br />2 Runningâ currently using a processor<br />3 Standbyâ about to use a processor<br />4 Terminatedâ has been stopped<br />5 Waitâ waiting on a peripheral operation or a resource<br />6 Transitionâ waiting for resource in order to execute<br />7 Unknown<br /><br />Windows allows threads to be suspended and resumed based on Windows API's. If a thread suspends itself for a specified period of time its called a sleeping thread. Else a suspended thread cannot explicitly resume itself until intervened by another thread.</span></div>
<div>
<br />
<div style="text-align: left;">
<span style="background-color: cyan; font-family: "georgia" , "times new roman" , serif;"><u><i><b>Thread priorities</b></i></u></span></div>
<br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">Windows allocates priorities to thread which govern their behaviour for yielding and context switching.Threads begin life inheriting the base priority of their process. This priority can be set when the process is first created.</span><br />
<br />
<div>
<h2 style="text-align: left;">
<span style="font-family: "georgia" , "times new roman" , serif;"><u><i>Fibers</i></u></span></h2>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">Fibers are a user-space construct. Its execution is not managed by kernel like threads but they follow. Cooperative scheduling Windows fibers have less overhead associated with them than threads do. One may also call them lightweight threads.Certain components of SQL Server donât work, or donât work well, when SQL Server runs in fiber mode. These components include SQLMail and SQLXML. Other components, such as heterogeneous and CLR queries, are not supported at all in fiber mode because they need certain thread-specific facilities provided by Windows.</span></div>
<div>
<br /></div>
<div>
<h2 style="text-align: left;">
<u><i><span style="font-family: "georgia" , "times new roman" , serif;">CPU Execution Models</span></i></u></h2>
<div>
<u><i><span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></i></u></div>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="background-color: cyan;"><b><i><u>Single Thread Execution Model</u></i></b></span><br /><span style="color: #444444;"><br />Here one thread is executed as the name suggest per CPU processor.</span></span><br />
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-EbCbhpR_WTLFZPAgvlUYF05uYHotybfYo6YKhrlzFlsBHrrxIUKeVSn_PUTHeKdwZIZBW3PDaQHGymmXknSvDohL1gycX9R_sK2ThKlRupUKSrhYbDVD0BAqPHaxmDQIejLnIGxY9FU/s1600/Singlethread.jpeg.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-EbCbhpR_WTLFZPAgvlUYF05uYHotybfYo6YKhrlzFlsBHrrxIUKeVSn_PUTHeKdwZIZBW3PDaQHGymmXknSvDohL1gycX9R_sK2ThKlRupUKSrhYbDVD0BAqPHaxmDQIejLnIGxY9FU/s1600/Singlethread.jpeg.png" /></a></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<b style="font-family: Georgia, 'Times New Roman', serif;"><i><u style="background-color: cyan;"><br /></u></i></b></div>
<div>
<b style="font-family: Georgia, 'Times New Roman', serif;"><i><u style="background-color: cyan;"><br /></u></i></b></div>
<div>
<b style="font-family: Georgia, 'Times New Roman', serif;"><i><u style="background-color: cyan;"><br /></u></i></b></div>
<div>
<b style="font-family: Georgia, 'Times New Roman', serif;"><i><u style="background-color: cyan;"><br /></u></i></b></div>
<div>
<b style="font-family: Georgia, 'Times New Roman', serif;"><i><u style="background-color: cyan;"><br /></u></i></b></div>
<div>
<b style="font-family: Georgia, 'Times New Roman', serif;"><i><u style="background-color: cyan;"><br /></u></i></b></div>
<div>
<b style="font-family: Georgia, 'Times New Roman', serif;"><i><u style="background-color: cyan;"><br /></u></i></b></div>
<div>
<b style="font-family: Georgia, 'Times New Roman', serif;"><i><u style="background-color: cyan;"><br /></u></i></b></div>
<div>
<b style="font-family: Georgia, 'Times New Roman', serif;"><i><u style="background-color: cyan;"><br /></u></i></b></div>
<div>
<b style="font-family: Georgia, 'Times New Roman', serif;"><i><u style="background-color: cyan;"><br /></u></i></b></div>
<div>
<b style="font-family: Georgia, 'Times New Roman', serif;"><i><u style="background-color: cyan;"><br /></u></i></b></div>
<div>
<b style="font-family: Georgia, 'Times New Roman', serif;"><i><u style="background-color: cyan;"><br /></u></i></b></div>
<div>
<b style="font-family: Georgia, 'Times New Roman', serif;"><i><u style="background-color: cyan;"><br /></u></i></b></div>
<div>
<b style="font-family: Georgia, 'Times New Roman', serif;"><i><u style="background-color: cyan;"><br /></u></i></b></div>
<div>
<b style="font-family: Georgia, 'Times New Roman', serif;"><i><u style="background-color: cyan;"><br /></u></i></b></div>
<div>
<b style="font-family: Georgia, 'Times New Roman', serif;"><i><u style="background-color: cyan;"><br /></u></i></b></div>
<div>
<b style="font-family: Georgia, 'Times New Roman', serif;"><i><u style="background-color: cyan;"><br /></u></i></b></div>
<div>
<b style="font-family: Georgia, 'Times New Roman', serif;"><i><u style="background-color: cyan;"><br /></u></i></b></div>
<div>
<b style="font-family: Georgia, 'Times New Roman', serif;"><i><u style="background-color: cyan;"><br /></u></i></b></div>
<div>
<b style="font-family: Georgia, 'Times New Roman', serif;"><i><u style="background-color: cyan;"><br /></u></i></b></div>
<div>
<b style="font-family: Georgia, 'Times New Roman', serif;"><i><u style="background-color: cyan;"><br /></u></i></b></div>
<br />
<br />
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;">Multi/Hyper-Threaded Execution Model</u></i></b></span><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br />Here multiple threads are executed as the name suggest per CPU processor.</span><br />
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgP2W7CLCmfMak0lsgHdnxaauR1h7V0STQDVktXKmMLp1_TKp-KumjVhZAwh5EGbyvPDHxoo7WVV2cC2bWpJl8Yq7DtahYPQ1bSgwdYkAls1Ayiwey7hQqpf8YYsP4Ix3MgvVrGeV22pZQ/s1600/Multithread.jpeg.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgP2W7CLCmfMak0lsgHdnxaauR1h7V0STQDVktXKmMLp1_TKp-KumjVhZAwh5EGbyvPDHxoo7WVV2cC2bWpJl8Yq7DtahYPQ1bSgwdYkAls1Ayiwey7hQqpf8YYsP4Ix3MgvVrGeV22pZQ/s1600/Multithread.jpeg.png" /></a></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<h2 style="text-align: left;">
<span style="font-family: "georgia" , "times new roman" , serif;"><i><u><br /></u></i></span></h2>
<h2 style="text-align: left;">
<span style="font-family: "georgia" , "times new roman" , serif;"><i><u><br /></u></i></span></h2>
<h2 style="text-align: left;">
<span style="font-family: "georgia" , "times new roman" , serif;"><i><u><br /></u></i></span></h2>
<h2 style="text-align: left;">
<span style="font-family: "georgia" , "times new roman" , serif;"><i><u><br /></u></i></span></h2>
<h2 style="text-align: left;">
<span style="font-family: "georgia" , "times new roman" , serif;"><i><u><br /></u></i></span></h2>
<h2 style="text-align: left;">
<span style="font-family: "georgia" , "times new roman" , serif;"><i><u><br /></u></i></span></h2>
<h2 style="text-align: left;">
<span style="font-family: "georgia" , "times new roman" , serif;"><i><u><br /></u></i></span></h2>
<h2 style="text-align: left;">
<span style="font-family: "georgia" , "times new roman" , serif;"><i><u><br /></u></i></span></h2>
<h2 style="text-align: left;">
<span style="font-family: "georgia" , "times new roman" , serif;"><i><u><br /></u></i></span></h2>
<h2 style="text-align: left;">
<span style="font-family: "georgia" , "times new roman" , serif;"><i><u><br /></u></i></span></h2>
<h2 style="text-align: left;">
<span style="font-family: "georgia" , "times new roman" , serif;"><i><u><br /></u></i></span></h2>
<h2 style="text-align: left;">
<span style="font-family: "georgia" , "times new roman" , serif;"><i><u><br /></u></i></span></h2>
<h2 style="text-align: left;">
<span style="font-family: "georgia" , "times new roman" , serif;"><i><u><br /></u></i></span></h2>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><i><u><br /></u></i></span></div>
<br />
<h2 style="text-align: left;">
<i><u>CPU Scheduling</u></i></h2>
<br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"> CPU scheduling decisions take place under one of four conditions: </span><br />
<ol style="text-align: left;">
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">When a process switches from the running state to the waiting state, such as for an I/O request or invocation of the wait( ) system call. </span></li>
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">When a process switches from the running state to the ready state, for example in response to an interrupt. </span></li>
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">When a process switches from the waiting state to the ready state, say at completion of I/O or a return from wait( ). </span></li>
<li><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">When a process terminates. </span></li>
</ol>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">For conditions 1 and 4 there is no choice - A new process must be selected. <br />For conditions 2 and 3 there is a choice - To either continue running the current process, or select a different one. <br />If scheduling takes place only under conditions 1 and 4, the system is said to be non-<span style="background-color: cyan;"><b>preemptive, or cooperative</b></span>. Under these conditions, once a process starts running it keeps running, until it either voluntarily blocks or until it finishes. With <span style="background-color: cyan;"><b>non-preemptive </b></span>scheduling, the code thatâs being run is written to yield control at key points. At these yield points, the scheduler can determine whether a different task should be run.Otherwise the system is said to be preemptive. Operating system can interrupt the thread execution any time in preemptive scheduling.</span><br />
<br />
<h2 style="text-align: left;">
<i><u>CPU Architecture</u></i></h2>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"></span><br />
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></span></div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">
This refers to how memory is connected with the CPU's It can be either of the following </span><br />
<br />
<span style="background-color: cyan; font-family: "georgia" , "times new roman" , serif;"><b><i><u>Symmetric Multiprocessing </u></i></b></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u><br /></u></i></b></span><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">In a symmetric multiprocessing (SMP) architecture, all processors are connected to all of the memory through a shared system bus. Performance is limited by the bus bandwidth. </span></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKdlskuP26RiT9NXCrOZFrOZibMkTzbEGE1sK1C7hBziVQvJuSLf0KPgRU1u5Be5GBJytJLTH6LyMqqYm6ZUo6wXmGB7A4Zc69ytzG4oaN-A4nGCzzNoQiyPK3oiM454PZZkhi6Ctba4Y/s1600/SMP.JPEG.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKdlskuP26RiT9NXCrOZFrOZibMkTzbEGE1sK1C7hBziVQvJuSLf0KPgRU1u5Be5GBJytJLTH6LyMqqYm6ZUo6wXmGB7A4Zc69ytzG4oaN-A4nGCzzNoQiyPK3oiM454PZZkhi6Ctba4Y/s1600/SMP.JPEG.png" /></a></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span>
<br />
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<br />
<br />
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;">NonUniform Memory Access </u></i></b></span><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">A non-uniform memory access (NUMA) architecture refers to a system where there the total available memory is broken down into multiple nodes. A group of processors are also connected directly to each of these nodes. If a processor is accessing memory on the same node at which it is located its accessing "local" memory pool. If the processor is accessing memory from a different node its accessing remote or non-local memory. Thus it reduces in cost of using shared memory bus but there comes additional higher cost of accessing remote memory.</span><br />
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCaE0oWuV4yTwz7GTgKIakOcl-Gh2i634MyrkWcFlBzcsXLVkjWkzxMDFhm8MRTD6zFvqDjMdDhsXYn8TH-hgoqHRujOgPk_1T5T__Q_1KLDyjqVSDyY8Bol-ypD4yPHoQhsyO5d2_i8w/s1600/NUMA.JPEG.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCaE0oWuV4yTwz7GTgKIakOcl-Gh2i634MyrkWcFlBzcsXLVkjWkzxMDFhm8MRTD6zFvqDjMdDhsXYn8TH-hgoqHRujOgPk_1T5T__Q_1KLDyjqVSDyY8Bol-ypD4yPHoQhsyO5d2_i8w/s1600/NUMA.JPEG.png" /></a></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">In a SQL Server environment, one of the optimizations that SQL Server can choose is to use parallelization in a query plan. If the available processors are hyper-threaded, then they are not really separate processors; and because each thread in a parallel plan needs to update its status to a single set of data structures, on a system with Hyper-Threading enabled, a parallel plan can see a severe performance degradation.</span><br />
<h2 style="text-align: left;">
</h2>
<h2 style="text-align: left;">
<i><u><br /><span style="font-size: x-large;">SQLOS</span></u></i></h2>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif; font-size: small;"><span style="font-weight: normal;">SQLOS is a thin layer that sits between SQL Server and Windows. It is responsible for scheduling, I/O completion, memory management and resource management. A question may arise when windows already has its own memory management unit why is there a need for another user-mode layer. Reasons being</span><span style="font-weight: normal;"><br /></span><span style="font-weight: normal;"><br /></span></span><br />
<ul style="text-align: left;"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif; font-size: small;"><span style="font-weight: normal;">
<li>Optimizing the way threads are chosen in terms of priority to be executed by schedulers</li>
<li>Greater flexibility and control on underlying architecture.</li>
<li>To avoid Context Switching</li>
<li>Provision of extended diagnostic capabilities such as DAC and DMVs for better troubleshooting.</li>
<li>Optimization of Windows performance when running SQL server.</li>
</span></span></ul>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif; font-size: small;"><span style="font-weight: normal;">
</span></span><br />
<div style="text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidegio1HGsmlcFIaIPwDQcNIPUSjvXyKcItY0T4zFjklM9G4_ZgCVqwCxlEUQ7Iwp4-Uph5-9CLRqWfQUoE__8Y12uDEOfgqBA-0Ey8CJuZ6GAEjxaZfhNDogiYGJz9q3da_y5C1nlCcM/s1600/SQLOS.jpeg.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidegio1HGsmlcFIaIPwDQcNIPUSjvXyKcItY0T4zFjklM9G4_ZgCVqwCxlEUQ7Iwp4-Uph5-9CLRqWfQUoE__8Y12uDEOfgqBA-0Ey8CJuZ6GAEjxaZfhNDogiYGJz9q3da_y5C1nlCcM/s1600/SQLOS.jpeg.png" /></a></div>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="background-color: cyan;"><b><i><u>Tasks</u></i></b></span><br /><br /><span style="color: #444444;">Any work assigned for SQL server to be carried out or executed is called a task. They are different from SQL server SPID's. A SPID is merely a connection or channel over which requests can be sent. Not necessary an SPID might have any active task assigned. A batch can map to one or more tasks. Tasks are further broken down to Workers. Similar to a process being broken down to threads.</span><br /><br /><span style="background-color: cyan;"><b><i><u>Worker</u></i></b></span><br /><br /><span style="color: #444444;">UMS worker encapsulates a thread or fiber & carries out the tasks within the SQL server. On receiving any new tasks a worker gets assigned to the tasks and is not released till the completion or termination of the task. If any of the worker is free from the pool it gets assigned to the new tasks. Else if the max worker threads value has not been reached, SQL Server will create and allocate a new worker. When the server is in thread mode and a worker has been idle for 15 minutes, SQL Server destroys it, provided doing so will not reduce the number of workers below a predefined threshold.</span><br /><br /> <br /><br /><span style="background-color: cyan;"><b><i><u>The Scheduler</u></i></b></span><br /><br /><span style="color: #444444;">When SQL server starts one scheduler is created for each processor on the system. So why do we have the option for processor affinity mask. Each scheduler is set to either ONLINE or OFFLINE based on this option. By default this is automatically configured and all the schedulers are supposed to be online. These schedulers picks up workers from the worker pool for execution. The workers are evenly distributed.</span></span></div>
<br />
<b><i><u><span style="background-color: cyan; font-family: "georgia" , "times new roman" , serif;">CPU Node </span></u></i></b><br />
<span style="font-family: "georgia" , "times new roman" , serif;"><br /><span style="color: #444444;">This is a logical unit within SQLOS where in which CPU's are grouped. On an SMP system, all CPUs would be grouped under a single CPU node, whereas on a NUMA-based system, there would be as many CPU nodes as the system supported. </span><br /><br /><span style="background-color: cyan;"><b><i><u>Memory Node </u></i></b></span><br /><br /><span style="color: #444444;">This is a logical unit within SQLOS where in which memory access. There is a memory node for each set of CPUs to localize memory. On an SMP architecture, a memory node shares memory across all CPUs, whereas on a NUMA architecture, a memory node per NUMA node exists. Memory nodes share the memory allocated by Max Server Memory.</span></span><br />
<div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhC4Q2MgQxt4sqP3aXIIVL3Afil2rRlzCVYoscIOr9VIENPa4nFbLcPj0pft4xc9IWLTec8xXROhmX5zLyedIjPMrUDBFL5aY2JTeI5VZy6rQu3uV8-n8gjacrTY7Sev-F7i-oVGFV2lcM/s1600/CPUMemNode.jpeg.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="376" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhC4Q2MgQxt4sqP3aXIIVL3Afil2rRlzCVYoscIOr9VIENPa4nFbLcPj0pft4xc9IWLTec8xXROhmX5zLyedIjPMrUDBFL5aY2JTeI5VZy6rQu3uV8-n8gjacrTY7Sev-F7i-oVGFV2lcM/s640/CPUMemNode.jpeg.png" width="640" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;">SQLOS options in SQL server</u></i></b></span><br />
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhH16d7iNdTMZhOKgP2537BFdCrzR6MRSR-fOCF5hTv4F-EYgjVCsKC9fmbk_2-TudMmITV_zCi-Hs315w910C9JAyr8Xi7dBtntI2PwgvfZiWmsvSi3hX_FRvg6EoW6arHCGko7oSVlQo/s1600/SQLOS+options.jpeg.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="552" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhH16d7iNdTMZhOKgP2537BFdCrzR6MRSR-fOCF5hTv4F-EYgjVCsKC9fmbk_2-TudMmITV_zCi-Hs315w910C9JAyr8Xi7dBtntI2PwgvfZiWmsvSi3hX_FRvg6EoW6arHCGko7oSVlQo/s640/SQLOS+options.jpeg.png" width="640" /></a></div>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span>
<br />
<br />
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="background-color: cyan;"><b><i><u>Connections, SPID's , Workers</u></i></b></span><br /><br /><span style="color: #444444;">When SQL server receives a new connection request an SPID is assigned. Next the scheduler gets assigned to the SPID . The connection is run on the least loaded scheduler on that node. Until SQL server 2008 the connection was scheduler bound. When subsequent requests are sent from the same SPID, if another scheduler has a load factor that is less than a certain percentage it gets assigned to the new worker for the same SPID.</span></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="color: #444444;"><br /></span></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="background-color: cyan;"><b><i><u>So how exactly SQLOS puts up with the OS preemptive scheduling. </u></i></b></span><br /><br /><span style="color: #444444;">Each thread under SQLOS has an associated event object. If a thread is in wait state Windows will not consider it for scheduling. SQLOS puts workers(threads/fibers) to sleep until it wants it to be scheduled by making a call to WaitForSingleObject on their corresponding event object. It passes INFINITE as the parameter for the timeout value. </span><br /><br /><span style="color: #444444;">When it should be scheduled SQLOS the object associated with the worker will be signaled. This allows the worker thread to come out of its wait state and windows scheduler will now be able to place the thread based on scheduling to on of the processors. SQLOS relies on the fact that the workers, (threads or fibers) to yield voluntarily often enough so one process or thread doesnât have exclusive control of the system. However it still adheres to a concept of a quantum. Instead of SQL Server tasks being forced to give up the CPU by the operating system, SQL Server tasks can request to be put on a wait queue periodically, and if they have exceeded the internally defined quantum, and they are not in the middle of an operation that cannot be stopped, they will voluntarily relinquish the CPU.</span><br /><br /><span style="color: #444444;">SQLOS as such is a vast topic to be covered under one post but the above gives a fair idea of its functionality and advantages. Below are a few links for the same. </span><br /><br /><a href="http://blogs.msdn.com/b/sqlmeditation/archive/2012/12/13/tasks-worker-threads-scheduler-threads-explain-it-all-and-dmvs.aspx" style="color: #444444;">http://blogs.msdn.com/b/sqlmeditation/archive/2012/12/13/tasks-worker-threads-scheduler-threads-explain-it-all-and-dmvs.aspx</a><br /><a href="https://technet.microsoft.com/en-us/library/ms189267(v=sql.105).aspx" style="color: #444444;">https://technet.microsoft.com/en-us/library/ms189267(v=sql.105).aspx</a></span></div>
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><a href="https://technet.microsoft.com/en-us/library/ms176043(v=sql.105).aspx">https://technet.microsoft.com/en-us/library/ms176043(v=sql.105).aspx</a><br /><a href="https://technet.microsoft.com/en-us/library/ee210547(v=sql.105).aspx" style="color: #444444;">https://technet.microsoft.com/en-us/library/ee210547(v=sql.105).aspx</a><br /><a href="https://msdn.microsoft.com/en-in/library/ms178074.aspx" style="color: #444444;">https://msdn.microsoft.com/en-in/library/ms178074.aspx</a><br /><a href="https://mssqlwiki.com/2013/01/10/sql-server-operating-system-sos-series-1/" style="color: #444444;">https://mssqlwiki.com/2013/01/10/sql-server-operating-system-sos-series-1/</a></span></div>
<div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><a href="https://blogs.msdn.microsoft.com/sqljourney/2012/12/16/an-in-depth-look-at-sql-server-memorypart-1/">https://blogs.msdn.microsoft.com/sqljourney/2012/12/16/an-in-depth-look-at-sql-server-memorypart-1/</a><br /><br />In the next blogs we shall see the segregation of memory in terms of SQL server<br /><br /></span></div>
</div>
</div>
Krutihttp://www.blogger.com/profile/13385897521211871375noreply@blogger.com3tag:blogger.com,1999:blog-8195522014866487394.post-14947141878504824952016-02-01T01:44:00.000-08:002016-02-08T06:30:11.662-08:00Memory Fundamentals for SQL Server - AWE ( Address Windowing Extensions), /PAE Switch (Physical Address Extension) <div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "georgia" , "times new roman" , serif;">In the previous blog we saw the difference between Virtual Address Space between 32-bit and 64-bit systems. We also saw how virtual memory works and how /3GB switch can be used to increase the user access mode limit.</span><br />
<br />
<a href="http://sqlandmorewithkruti.blogspot.in/2016/01/memory-fundamentals-for-sql-server.html">http://sqlandmorewithkruti.blogspot.in/2016/01/memory-fundamentals-for-sql-server.html</a><br />
<br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">In this module we shall see what is AWE and /PAE switch for 32-bit systems.</span><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span>
<br />
<h2 style="text-align: left;">
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u>Address Windows Extensions</u></i></b></span></h2>
<div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">As we have seen previously that
the addresses are limited to 4GB virtual address space in 32-bit Operating System. However machines may have more
than 4GB of RAM installed.Now Virtual
Memory comprises of RAM and Paging file. So how then these user processes have
access to an address which falls beyond the 4GB addressing scheme. This
is facilitated by Windows through a mechanism called <span style="background-color: cyan;">AWE (Address Window
Extension).</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">It enables a process to
reserve an address in the VAS which is again mapped to a different physical
address range in RAM. This process is called <span style="background-color: cyan;">windowing</span> and is illustrated by
the below diagram.</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIO1AaJUImjMznEWkR9DCXnNB8pRAMl9LB6eSbzkubw8PqHeWxchC9QXxqbgY5dJHlSo_C745C7-o1O7ptv3HX8KiG0-nUYlQJZdTq0YbAFV6aOFHn_jr15GraTFyOhqGJQzY_23GzixM/s1600/AWE.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="405" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIO1AaJUImjMznEWkR9DCXnNB8pRAMl9LB6eSbzkubw8PqHeWxchC9QXxqbgY5dJHlSo_C745C7-o1O7ptv3HX8KiG0-nUYlQJZdTq0YbAFV6aOFHn_jr15GraTFyOhqGJQzY_23GzixM/s640/AWE.jpg" width="640" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><span lang="EN-US">A user process must have
the <span style="background-color: cyan;">"Lock Pages in Memory" permission</span> to leverage the benefits of AWE
mechanism. AWE exists on all editions of Windows 2000 and later.</span>In order for SQL Server to
use the AWE APIs, you need to enable AWE. Once enabled, the next time
SQL Server is started it will attempt to lock memory pages so that it can use AWE.</span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">There are a few
considerations to be made when using AWE<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0pt;">
</div>
<ul style="text-align: left;">
<li><span style="font-family: "georgia" , "times new roman" , serif;"><span lang="EN-US"><span style="color: #444444;"> </span></span><span style="color: #444444; text-indent: -18pt;">Primarily it's obvious that AWE is to support memory more than 4GB. If one were enable
this option where the RAM that is less than 3GB it will be completely ignored. Application will be allocated memory as per <span style="background-color: cyan;">Virtual Memory</span>.</span></span></li>
<li><span style="color: #444444; text-indent: -18pt;"><span style="font-family: "georgia" , "times new roman" , serif;">An
advantage of AWE is that it is never swapped to disk so it has reasonably faster
access. AWE memory management differs from Virtual Memory Management.
Its purely physical memory and its mappings.</span></span></li>
<li><span style="color: #444444; text-indent: -18pt;"><span style="font-family: "georgia" , "times new roman" , serif;">The
design ensures that any memory allocated using the APIs cannot be shared with
any other process and is made nonpageable, or locked.</span></span></li>
<li><span style="color: #444444; text-indent: -18pt;"><span style="font-family: "georgia" , "times new roman" , serif;">Only data
cache pages are stored in AWE mapped memory. Data cache is a component of the
SQL Server Buffer Pool area which will be seen in the later sections of this
blog. </span></span></li>
<li><span style="color: #444444; text-indent: -18pt;"><span style="font-family: "georgia" , "times new roman" , serif;">The
virtual memory window used to buffer the physical memory provided by AWE
requires readwrite access.</span></span></li>
</ul>
<div style="text-indent: -24px;">
<div class="MsoNormal" style="margin: 0cm 0cm 0pt 20.25pt;">
<span style="color: blue; font-family: "courier new"; font-size: 10pt;"><br /></span></div>
</div>
<div class="MsoNormal" style="margin-bottom: 0cm;">
<div style="line-height: 18pt;">
<u><span lang="EN-US" style="background-attachment: initial; background-clip: initial; background-color: cyan; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-size: 12pt;"><b><i><span style="font-family: "georgia" , "times new roman" , serif;">How to Enable AWE</span></i></b></span></u><span lang="EN-US" style="font-size: 12pt;"><o:p></o:p></span></div>
<div style="line-height: 18pt;">
<u><span lang="EN-US" style="background-attachment: initial; background-clip: initial; background-color: cyan; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-size: 12pt;"><b><i><span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></i></b></span></u>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif; line-height: normal;">1. First we need to grant SQL server account "LOCK PAGE IN MEMORY" permission by editing the local group policies.</span></div>
<div style="line-height: 18pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif; line-height: normal;"><br /></span></div>
<div class="separator" style="clear: both; line-height: 18pt; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9ArtTBISFR844jqQgz9HUY4BOwGRU5OdA34C53Ai3pH9Qs81yUQ-oyMbSI2h6yhcCSmatc54YzF8EprxrFPALqFndXVisWlDI-2dRP_2B4JhPFjE8Gw63ZZhBGDHg0S3nYoACJYlXfRY/s1600/Local+policy.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="491" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9ArtTBISFR844jqQgz9HUY4BOwGRU5OdA34C53Ai3pH9Qs81yUQ-oyMbSI2h6yhcCSmatc54YzF8EprxrFPALqFndXVisWlDI-2dRP_2B4JhPFjE8Gw63ZZhBGDHg0S3nYoACJYlXfRY/s640/Local+policy.jpg" width="640" /></a></div>
<div style="line-height: 18pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif; line-height: normal;"><br /></span></div>
<div style="line-height: 18pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif; line-height: normal;"><br /></span></div>
<div style="line-height: 18pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif; line-height: normal;"><br /></span></div>
<div style="line-height: 18pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif; line-height: normal;"><br /></span></div>
<div style="line-height: 18pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif; line-height: normal;"><br /></span></div>
<div style="line-height: 18pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif; line-height: normal;"><br /></span></div>
<div style="line-height: 18pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif; line-height: normal;"><br /></span></div>
<div style="line-height: 18pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif; line-height: normal;"><br /></span></div>
<div style="line-height: 18pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif; line-height: normal;"><br /></span></div>
<div style="line-height: 18pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif; line-height: normal;"><br /></span></div>
<div style="line-height: 18pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif; line-height: normal;"><br /></span></div>
<div style="line-height: 18pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif; line-height: normal;"><br /></span></div>
<div style="line-height: 18pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif; line-height: normal;"><br /></span></div>
<div style="line-height: 18pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif; line-height: normal;"><br /></span></div>
<div style="line-height: 18pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif; line-height: normal;"><br /></span></div>
<div style="line-height: 18pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif; line-height: normal;"><br /></span></div>
<div style="line-height: 18pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif; line-height: normal;"><br /></span></div>
<div style="line-height: 18pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif; line-height: normal;"><br /></span></div>
<div style="line-height: 18pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif; line-height: normal;"><br /></span></div>
<div style="line-height: 18pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif; line-height: normal;"><br /></span></div>
<div style="line-height: 18pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif; line-height: normal;">2. Enabling AWE through GUI</span><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJ6wxK-dOwzsw2u10H8ThOQBt5-GgqBj013q3epURkR9r0Z6xf4iozWAMO-pUd0Y52WcQ0uYExFRYnf6dmBczF8vN5EyCoO0vUyuHWf-u5cvHj14G5sFReOF7rxcSeuF3Q5Rv5NpHJ6lI/s1600/AWE+mapping.jpg" imageanchor="1" style="clear: left; display: inline; line-height: 18pt; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" height="557" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJ6wxK-dOwzsw2u10H8ThOQBt5-GgqBj013q3epURkR9r0Z6xf4iozWAMO-pUd0Y52WcQ0uYExFRYnf6dmBczF8vN5EyCoO0vUyuHWf-u5cvHj14G5sFReOF7rxcSeuF3Q5Rv5NpHJ6lI/s640/AWE+mapping.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; line-height: 18pt; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJ6wxK-dOwzsw2u10H8ThOQBt5-GgqBj013q3epURkR9r0Z6xf4iozWAMO-pUd0Y52WcQ0uYExFRYnf6dmBczF8vN5EyCoO0vUyuHWf-u5cvHj14G5sFReOF7rxcSeuF3Q5Rv5NpHJ6lI/s1600/AWE+mapping.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJ6wxK-dOwzsw2u10H8ThOQBt5-GgqBj013q3epURkR9r0Z6xf4iozWAMO-pUd0Y52WcQ0uYExFRYnf6dmBczF8vN5EyCoO0vUyuHWf-u5cvHj14G5sFReOF7rxcSeuF3Q5Rv5NpHJ6lI/s1600/AWE+mapping.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJ6wxK-dOwzsw2u10H8ThOQBt5-GgqBj013q3epURkR9r0Z6xf4iozWAMO-pUd0Y52WcQ0uYExFRYnf6dmBczF8vN5EyCoO0vUyuHWf-u5cvHj14G5sFReOF7rxcSeuF3Q5Rv5NpHJ6lI/s1600/AWE+mapping.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJ6wxK-dOwzsw2u10H8ThOQBt5-GgqBj013q3epURkR9r0Z6xf4iozWAMO-pUd0Y52WcQ0uYExFRYnf6dmBczF8vN5EyCoO0vUyuHWf-u5cvHj14G5sFReOF7rxcSeuF3Q5Rv5NpHJ6lI/s1600/AWE+mapping.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a></div>
<div style="line-height: 18pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif; line-height: normal;"><br /></span></div>
<div style="line-height: 18pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif; line-height: normal;">3. Enabling AWE through script</span></div>
<div style="line-height: 18pt;">
<span style="color: maroon; font-family: "courier new"; font-size: 10pt; text-indent: -24px;">sp_configure</span><span style="font-family: "courier new"; font-size: 10pt; text-indent: -24px;"> <span style="color: red;">'show advanced options'</span><span style="color: grey;">,</span>
1</span><br />
<span style="color: blue; font-family: "courier new"; font-size: 10pt; text-indent: -24px;">RECONFIGURE</span><br />
<span style="color: blue; font-family: "courier new"; font-size: 10pt; text-indent: -24px;">GO</span><br />
<span style="color: maroon; font-family: "courier new"; font-size: 10pt; text-indent: -24px;">sp_configure</span><span style="font-family: "courier new"; font-size: 10pt; text-indent: -24px;"> <span style="color: red;">'awe enabled'</span><span style="color: grey;">,</span> 1</span><br />
<span style="color: blue; font-family: "courier new"; font-size: 10pt; text-indent: -24px;">RECONFIGURE</span><br />
<span style="color: blue; font-family: "courier new"; font-size: 10pt; line-height: 115%; text-indent: -24px;">GO</span><br />
<span style="color: blue; font-family: "georgia" , "times new roman" , serif; font-size: 10pt; line-height: 115%; text-indent: -24px;"><br /></span></div>
<div style="text-indent: -24px;">
<div class="MsoNormal" style="margin: 0cm 0cm 0pt 20.25pt;">
<span style="font-family: "georgia" , "times new roman" , serif;">You may go through the below links for technet articles on the same.</span><br />
<div style="line-height: normal;">
<a href="https://technet.microsoft.com/en-us/library/ms190673(v=sql.105).aspx" style="font-family: "georgia" , "times new roman" , serif; font-size: 13.33px;">https://technet.microsoft.com/en-us/library/ms190673(v=sql.105).aspx</a></div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif; font-size: 13.33px;"><a href="https://technet.microsoft.com/en-GB/library/ms190731(v=sql.105).aspx">https://technet.microsoft.com/en-GB/library/ms190731(v=sql.105).aspx</a></span><br />
<br /></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0pt 20.25pt;">
<div style="text-align: left;">
<span lang="EN-US" style="color: #444444; font-family: "georgia" , "times new roman" , serif; text-indent: 0px;">AWE option can also be enabled for 64-bit systems but for the purpose of this blog it shall</span></div>
<div style="text-align: left;">
<span lang="EN-US" style="color: #444444; font-family: "georgia" , "times new roman" , serif; text-indent: 0px;"> be covered later.</span></div>
</div>
<div class="MsoNormal" style="margin: 0cm 0cm 0pt 20.25pt;">
<h2 style="text-align: left;">
<b style="color: #444444; font-family: Georgia, 'Times New Roman', serif;"><i><u>Physical Address Extension /PAE</u></i></b></h2>
</div>
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"></span><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"> We've covered how to increase memory for user mode access by using the /3GB switch. We have also seen how to utilize the available physical memory more than 4GB using AWE. There is yet another switch called the Physical Address Extension /PAE switch which allows access for upto 128GB of RAM. Its a hardware related enhancement where the address bus is 36-bit. So now the number of addresses supported is (2^26).In terms of memory management there still exists page directories and page table entries for virtual memory mapping. In addition another level of page directory pointer table is added. The PTE is 4KB instead of 8KB. With this switch the Page Directory Table and Page Table Entries are 64-bit long so more number of addresses can be mapped. Thus unlike AWE there is a change in the memory structures and maps.</span></div>
<div style="text-indent: -24px;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<span style="font-family: "georgia" , "times new roman" , serif;"><b><i><u style="background-color: cyan;">How to Enable /PAE Switch</u></i></b></span><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">Similar to /3GB switch you add /PAE switch in the BOOT.INI file.</span><br />
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span>
<span style="background-color: cyan; text-indent: -24px;"><b><i><u><span style="font-family: "georgia" , "times new roman" , serif;">Microsoft recommends the thumb rule as follows</span></u></i></b></span><br />
If your system has < 4 GB - use only /3GB<br />
If your system has > 4 GB and < 16 GB - use /3GB + /PAE + AWE<br />
If your system has > 16 GB - use /PAE + AWE</div>
<div class="MsoNormal" style="margin-bottom: 0cm;">
<span style="text-indent: -24px;"><b><i><u><span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></u></i></b></span></div>
<div class="MsoNormal" style="margin-bottom: 0cm;">
<span style="text-indent: -24px;"><b><i><u><span style="font-family: "georgia" , "times new roman" , serif;">Technet link for considerations of all the 3 options are as below</span></u></i></b></span></div>
<div class="MsoNormal" style="margin-bottom: 0cm;">
<div style="text-indent: -24px;">
<span style="font-family: "georgia" , "times new roman" , serif;"><span style="font-family: "georgia" , "times new roman" , serif;"><br /> <span style="color: #444444; font-size: xx-small;"><a href="http://blogs.technet.com/b/marcelofartura/archive/2006/09/14/3gb-pae-awe-what-basic.aspx">http://blogs.technet.com/b/marcelofartura/archive/2006/09/14/3gb-pae-awe-what-basic.aspx</a><br /><a href="http://blogs.technet.com/b/beatrice/archive/2008/08/29/3gb-pae-and-awe-taking-away-some-confusion.aspx">http://blogs.technet.com/b/beatrice/archive/2008/08/29/3gb-pae-and-awe-taking-away-some-confusion.aspx</a><br /><a href="http://blogs.technet.com/b/perfguru/archive/2007/12/05/scenarios-using-3gb-and-pae-switch-and-appropriate-uses-of-these-switches.aspx">http://blogs.technet.com/b/perfguru/archive/2007/12/05/scenarios-using-3gb-and-pae-switch-and-appropriate-uses-of-these-switches.aspx</a><br /><a href="http://blogs.msdn.com/b/chadboyd/archive/2007/03/24/pae-and-3gb-and-awe-oh-my.aspx">http://blogs.msdn.com/b/chadboyd/archive/2007/03/24/pae-and-3gb-and-awe-oh-my.aspx</a></span></span><br /><br /><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">Now that the basics are clear in the coming blogs we shall see how memory and CPU execute a user process like SQL server.</span></span><br />
<br />
<br />
<br /></div>
</div>
<div style="text-indent: -24px;">
<div class="MsoNormal" style="margin: 0cm 0cm 0pt 38.25pt; text-indent: -18pt;">
<span lang="EN-US"><o:p></o:p></span><br /></div>
</div>
</div>
</div>
Krutihttp://www.blogger.com/profile/13385897521211871375noreply@blogger.com4tag:blogger.com,1999:blog-8195522014866487394.post-71592578032941118542016-01-28T09:13:00.002-08:002016-01-28T09:20:34.472-08:00Memory Fundamentals for SQL Server - Virtual Memory, /3GB Switch<div dir="ltr" style="text-align: left;" trbidi="on">
<span lang="EN-US" style="font-family: "georgia" , "serif"; font-size: 12.0pt;"><span style="font-family: "georgia" , "times new roman" , serif; font-size: 12pt;">Just a few days back I was asked a very basic question related to AWE and /3GB switch.I was surprised being a DBA I was unable to explain the concept and relate the terms by proper choice of words. That's when I realized how important it is to have this cleared prior to troubleshooting SQL server. You will be able to find lots of good books & blogs relating Windows & SQL Server memory management. The topic is quite vast to be covered in just a few blogs. I shall be giving the references of a few resources used in the last module of this series. My sole purpose of writing this blog is provide a gist of how SQL server is affected by the underlying windows memory architecture and what comprises SQL server memory.</span></span><br />
<span lang="EN-US" style="font-family: "georgia" , "serif"; font-size: 12.0pt;"><span style="font-family: "georgia" , "times new roman" , serif; font-size: 12pt;"><br /></span></span>
<span style="font-family: "georgia" , serif;">Let's get started with the basics.</span><br />
<span style="font-family: "georgia" , serif;"><br /></span>
<h2 style="text-align: left;">
<span style="font-family: "georgia" , serif;"><i><u>Difference Between 32-Bit and 64-Bit Systems</u></i></span></h2>
<div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">The largest integer value a
32-Bit pointer can store is
4,294,967,296= (2^32) addresses. Applications are limited to 4GB <span style="background-color: cyan;">Virtual
Address Space (VAS)</span> . Of these 2GB addresses are
reserved for kernel mode and the
other 2GB are reserved for user mode access.<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">If we were to have a 64-Bit
pointer the largest inter value it could store would be roughly 17 trillion GB
= 2^64 addresses. The number of
addresses are so huge that they are not implemented in reality in terms of
physical memory due to hardware
limitations. Currently the processor manufacturers have implemented a 44-bit
pointer that can refer to 16TB Virtual Address Space for 64-bit systems. Out of
this 8TB is reserved for kernel mode and 8TB for user mode access.</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"></span></div>
<h2>
<span style="font-family: "georgia" , serif;"><i><u>Virtual Memory</u></i></span></h2>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3E9OQLxBH6UH9rmkHEH1sQNhwWg9h98AE5DkqqW7Hl-T4Tgqt6sNBUGVRqYsq_gNErVWIDjaONLirzFbzNR5y1dLTch2C5bVy97_Cr8uXI-cDAAN6U2jnhe0Ae3aTuXyFN4-7DV4ius8/s1600/VM.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="292" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3E9OQLxBH6UH9rmkHEH1sQNhwWg9h98AE5DkqqW7Hl-T4Tgqt6sNBUGVRqYsq_gNErVWIDjaONLirzFbzNR5y1dLTch2C5bVy97_Cr8uXI-cDAAN6U2jnhe0Ae3aTuXyFN4-7DV4ius8/s400/VM.jpg" width="400" /></a></div>
<div>
<span style="font-family: "georgia" , serif;"><i><u><br /></u></i></span></div>
<div>
<span style="font-family: "georgia" , serif;"><i><u><br /></u></i></span></div>
<div>
<span style="font-family: "georgia" , serif;"><i><u><br /></u></i></span></div>
<div>
<span style="font-family: "georgia" , serif;"><i><u><br /></u></i></span></div>
<div>
<span style="font-family: "georgia" , serif;"><i><u><br /></u></i></span></div>
<div>
<span style="font-family: "georgia" , serif;"><i><u><br /></u></i></span></div>
<div>
<span style="font-family: "georgia" , serif;"><i><u><br /></u></i></span></div>
<div>
<span style="font-family: "georgia" , serif;"><i><u><br /></u></i></span></div>
<div>
<span style="font-family: "georgia" , serif;"><i><u><br /></u></i></span></div>
<div>
<span style="font-family: "georgia" , serif;"><i><u><br /></u></i></span></div>
<div>
<span style="font-family: "georgia" , serif;"><i><u><br /></u></i></span></div>
<div>
<span style="font-family: "georgia" , serif;"><i><u><br /></u></i></span></div>
<div>
<span style="font-family: "georgia" , serif;"><i><u><br /></u></i></span></div>
<div>
<span style="font-family: "georgia" , serif;"><i><u><br /></u></i></span></div>
<div>
<span style="font-family: "georgia" , serif;"><i><u><br /></u></i></span></div>
<div>
<span style="font-family: "georgia" , serif;"><i><u><br /></u></i></span></div>
<div>
<span style="font-family: "georgia" , serif;"><i><u><br /></u></i></span></div>
<div>
<span style="font-family: "georgia" , serif;"><i><u><br /></u></i></span></div>
<div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">The total amount of <span style="background-color: cyan;">RAM (Random Access Memory)</span> installed might not always be sufficient
to run all the applications on the system. Windows memory management implements
and manages what is called <span style="background-color: cyan;">Virtual Memory</span>. Itâs the method of extending the available physical
memory on a computer. <span style="background-color: cyan;">PageFile</span> is a file on disk which is used to swap physical
memory pages to and from a disk. Virtual
Memory comprises of total available physical memory(RAM) on the computer and
size of the PageFile on disk.</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="background-color: cyan;"><span style="font-family: "georgia" , "times new roman" , serif;"><b><i>Virtual Memory Manager</i></b></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="background-color: cyan;"><span style="font-family: "georgia" , "times new roman" , serif;"><b><i><br /></i></b></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">Virtual Memory Manager is
responsible for mapping physical memory and virtual address spaces for a process.
It keeps track of each mapping for <span style="background-color: cyan;">VAS</span> addresses using a <span style="background-color: cyan;">page table</span>, and </span></span><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">the mapping information
itself is stored in a </span><span style="background-color: cyan; color: #444444; font-family: "georgia" , "times new roman" , serif;">Page Table Entry (PTE)</span><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">. The PTE is 4K in size and shares
the same space as other system information and structures of the system.</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHoT-2WuRXRDvMyMNK8-j6CYCkbERdCnPVMl_kpBwlekTpNT-B2i3GHlDuQ1XFc8QbJRryx0yStM-sxUCYgySSdS5URdpbBCIN_0dEZuG4J6bO7jYsqOps2y4Phz2QBy2hxvXfe_xWfys/s1600/VMM.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="287" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHoT-2WuRXRDvMyMNK8-j6CYCkbERdCnPVMl_kpBwlekTpNT-B2i3GHlDuQ1XFc8QbJRryx0yStM-sxUCYgySSdS5URdpbBCIN_0dEZuG4J6bO7jYsqOps2y4Phz2QBy2hxvXfe_xWfys/s400/VMM.jpg" width="400" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">Most recently referenced
pages are located in RAM. Those which aren't recently referenced for a while
may be written to the PageFile. This is called <span style="background-color: cyan;">swapping or paging out memory</span>. <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">Thus there is no gaurantee that once a particular page was accessed from certain location within memory,</span></span><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"> the same page is available at the same location the next time its accessed. </span><span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">The next time it may be
loaded from the PageFile on disk so the request will be slower. This is known as a <span style="background-color: cyan;">Page Fault</span> and it occurs
without users intervention or knowledge.</span></span><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">The process of loading the
page back from the PageFile into physical memory, also called </span><span style="background-color: cyan; color: #444444; font-family: "georgia" , "times new roman" , serif;">swapping or
paging in memory.</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: cyan; color: #444444; font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<h2>
<span style="font-family: "georgia" , serif;"><i><u>/3GB switch in 32-bit systems</u></i></span></h2>
</div>
<div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><span lang="EN-US">As explained earlier the primary difference between 32-bit and 64-bit systems is the size of the address pointer and the number of addresses referenced in terms of memory. As we know in 32-bit systems 2GB is reserved
for user mode access. We can increase this memory to 3GB for SQL server process
address space thus reducing the kernel mode access space to 1GB by implementing the /3GB switch. <span style="background-color: cyan;">A /3GB parameter</span> needs to be </span><span lang="EN-US">specified in the <span style="background-color: cyan;">Boot.ini</span> file located under C: drive ideally of Windows 2003 or earlier
version. Once you add the parameter and reboot each process will have a 3GB
address space.</span></span><span lang="EN-US" style="font-family: "times new roman" , "serif"; font-size: 12.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "georgia" , "times new roman" , serif;"><span lang="EN-US"><br /></span></span></div>
<div class="MsoNormal" style="line-height: 18.0pt; margin-bottom: .0001pt; margin-bottom: 0cm;">
<span style="font-family: "georgia" , "times new roman" , serif;"><span lang="EN-US" style="background-attachment: initial; background-clip: initial; background-color: cyan; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-size: 12pt;"><b><i>How to Enable
/3GB switch:</i></b></span><span lang="EN-US" style="font-size: 12pt;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 27pt; text-indent: -18pt; vertical-align: middle;">
<!--[if !supportLists]--><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><span lang="EN-US" style="font-size: 12pt;">1.<span style="font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span lang="EN-US" style="background: white; font-size: 12pt;">Right-click
on the Command Prompt icon in the Accessories program group of the Start menu.
Click Run as Administrator.</span><span lang="EN-US" style="font-size: 12pt;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 27pt; text-indent: -18pt; vertical-align: middle;">
<!--[if !supportLists]--><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><span lang="EN-US" style="font-size: 12pt;">2.<span style="font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span lang="EN-US" style="background: white; font-size: 12pt;">At
the command prompt, enter: bcedit /set IncreaseUserVa 3072</span><span lang="EN-US" style="font-size: 12pt;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
</div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 27pt; text-indent: -18pt; vertical-align: middle;">
<!--[if !supportLists]--><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><span lang="EN-US" style="font-size: 12pt;">3.<span style="font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span lang="EN-US" style="background: white; font-size: 12pt;">Restart
the computer.</span></span><span lang="EN-US" style="font-size: 12pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 27pt; text-indent: -18pt; vertical-align: middle;">
<span style="color: #444444; font-family: "georgia" , "times new roman" , serif;"><span lang="EN-US" style="background: white; font-size: 12pt;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="color: #444444; font-family: "georgia" , "times new roman" , serif;">You could browse this link to check how the /3GB option is enabled.<a href="https://technet.microsoft.com/en-us/library/bb124810(v=exchg.65).aspx">https://technet.microsoft.com/en-us/library/bb124810(v=exchg.65).aspx</a></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="font-family: "georgia" , "times new roman" , serif;">In the next module we will learn about AWE and /PAE switch.</span></span></div>
</div>
</div>
Krutihttp://www.blogger.com/profile/13385897521211871375noreply@blogger.com5tag:blogger.com,1999:blog-8195522014866487394.post-70368123914594135272016-01-13T00:10:00.003-08:002016-01-13T00:10:40.720-08:00Basic Windows Administration through Powershell<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Georgia, Times New Roman, serif;">Hi Guys,</span><br />
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="color: #444444; font-family: Georgia, serif; font-size: 16px;">In the previous blog I took you through PowerShell basics We know that PowerShell to works with different modules like SQL server, Active Directory, Windows Administration, IIS, etc. In this blog I shall be updating a few scripts I've used. You may modify the same as per your environment.</span><br />
<span style="color: #444444; font-family: Georgia, serif; font-size: 16px;">You will be able to find many such scripts online and under </span><span style="color: #444444; font-family: Georgia, serif;"><a href="http://powershell.com/">http://powershell.com</a></span><br />
<span style="color: #444444; font-family: Georgia, serif;"><br /></span>
<span style="font-family: Georgia, serif;"><b><u><i style="background-color: cyan;">1.Deleting Files older than Certain Date</i></u></b></span><br />
<br />
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; color: darkgreen; font-family: 'Lucida Console'; font-size: 9pt;">#Folder from which files are to be
deleted </span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3;"><span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">$filepath</span><span style="color: darkgrey; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">=</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;"> <span style="color: darkred;">"D:\"</span><o:p></o:p></span><span style="color: darkgreen; font-family: 'Lucida Console'; font-size: 12px;">#Change the path based on your file location</span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3;"><span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">#Accepting the number of days prior
to which user wants to delete the files</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3;"><span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">$no_of_days</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;"> <span style="color: darkgrey;">=</span> <span style="color: blue;">read-host</span> <span style="color: darkred;">"Enter the
number of days(integer) prior to which backups should be delete "</span> <o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3;"><span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">$a</span><span style="color: darkgrey; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">=</span><span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">get-date</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3;"><span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">$a</span><span style="color: darkgrey; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">=</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;"> <span style="color: orangered;">$a</span><span style="color: darkgrey;">.</span>adddays(<span style="color: darkgrey;">-</span><span style="color: orangered;">$no_of_days</span>)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3;"><span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">#Confirming the date with the user</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3;"><span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">write-host</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;"> <span style="color: darkred;">"Do you want to
delete files older than"</span><span style="color: orangered;">$a</span><span style="color: blueviolet;">"
Y/N"</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3;"><span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">$response</span><span style="color: darkgrey; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">=</span><span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">read-host</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3;"><span style="color: darkblue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">If</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;"> (<span style="color: orangered;">$response</span> <span style="color: darkgrey;">-eq</span> <span style="color: darkred;">"Y"</span>
<span style="color: darkgrey;">-or</span> <span style="color: orangered;">$response</span>
<span style="color: darkgrey;">-eq</span> <span style="color: darkred;">"y"</span>)
<o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3;"><span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">write-host</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;"> <span style="color: darkred;">" Deleting files
from </span><span style="color: orangered;">$filepath</span><span style="color: darkred;"> older than "</span> <span style="color: orangered;">$a</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3;"><span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">#Deleting files only</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3;"><span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">get-childitem</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;"> <span style="color: orangered;">$path</span> <span style="color: navy;">-recurse</span> <span style="color: darkgrey;">|</span> <span style="color: blue;">where-object</span> {<span style="color: orangered;">$_</span><span style="color: darkgrey;">.</span>mode <span style="color: darkgrey;">-notmatch</span>
<span style="color: darkred;">"d"</span>} <span style="color: darkgrey;">|</span>
<span style="color: blue;">where-object</span> {<span style="color: orangered;">$_</span><span style="color: darkgrey;">.</span>lastwritetime<span style="color: darkgrey;">.</span>date
<span style="color: darkgrey;">-lt</span> <span style="color: orangered;">$a</span>}
<span style="color: darkgrey;">|</span> <span style="color: blue;">ForEach-Object</span>
{ <span style="color: blue;">Write-Host</span> <span style="color: darkred;">"Deleting
"</span><span style="color: orangered;">$_</span><span style="color: darkgrey;">.</span>FullName;
<span style="color: blue;">Remove-Item</span> <span style="color: orangered;">$_</span><span style="color: darkgrey;">.</span>FullName;} <o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;">}<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3;"><span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">#Confirming shell closure</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3;"><span style="color: darkblue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">else</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3;"><span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">write-host</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;"> <span style="color: darkred;">"Execution
cancelled to execute successfully pass the right parameters & hit Y/y. Any
other input will be considered Invalid"</span><o:p></o:p></span></span></div>
<br />
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; color: blue; font-family: 'Lucida Console'; font-size: 9pt;">start-sleep</span><span style="font-family: 'Lucida Console'; font-size: 9pt;"><span style="background-color: #f3f3f3;"> <span style="color: navy;">-s</span> <span style="color: purple;">7</span>} </span><span style="background-color: white;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: cyan; font-family: 'Lucida Console'; font-size: 9pt;"><b><u><i><br /></i></u></b></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: cyan; font-family: Georgia, serif;"><b><u><i>2. Pinging Multiple Servers</i></u></b></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="background-color: transparent; color: #444444; font-family: Georgia, serif;"><br /></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3;"><span style="color: darkgreen; font-family: 'Lucida Console'; font-size: 9pt;">#Servername Text File</span><span style="font-family: 'Lucida Console'; font-size: 9pt;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3;"><span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">$filepath</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"C:\Test.txt"</span> <span style="color: darkgreen;">#Change
the path based on your file location</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3;"><span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">$Sname</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;"> <span style="color: darkgrey;">=</span> <span style="color: blue;">Get-Content</span> <span style="color: orangered;">$filepath</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3;"><span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">#Running Loop for each servername
in text file </span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3;"><span style="color: darkblue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">foreach</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;"> (<span style="color: orangered;">$S</span> <span style="color: darkblue;">in</span> <span style="color: orangered;">$Sname</span>) <o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;">{ <o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;"> <span style="color: darkgreen;">#Checks if the server is pingable</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;"> <span style="color: orangered;">$StatusFlag</span> <span style="color: darkgrey;">=</span><span style="color: blue;">test-Connection</span> <span style="color: navy;">-ComputerName</span>
<span style="color: orangered;">$S</span> <span style="color: navy;">-Count</span> <span style="color: purple;">1</span> <span style="color: navy;">-Quiet</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;"> <span style="color: darkblue;">if</span> (<span style="color: orangered;">$StatusFlag</span>)
<span style="color: darkgreen;">#If server is pingable dispaly source,destination
& response time</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;"> { <o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">#Sends just one packet to the
server and provides the response time <o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;"> <span style="color: blue;">Test-Connection</span> <span style="color: orangered;">$S</span>
<span style="color: navy;">-count</span> <span style="color: purple;">1</span><span style="color: darkgrey;">|</span><span style="color: blue;">select-object</span> <span style="color: navy;">-Property</span> @{Name<span style="color: darkgrey;">=</span><span style="color: darkred;">"Source"</span>; Expression <span style="color: darkgrey;">=</span> {<span style="color: orangered;">$_</span><span style="color: darkgrey;">.</span>pscomputername}}<span style="color: darkgrey;">,</span>@{Name<span style="color: darkgrey;">=</span><span style="color: darkred;">"Destination"</span>;
Expression <span style="color: darkgrey;">=</span> {<span style="color: orangered;">$_</span><span style="color: darkgrey;">.</span>address}}<span style="color: darkgrey;">,</span><span style="color: blueviolet;">responsetime</span> <o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;"> }<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;"> <span style="color: darkblue;">else</span> <o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;"> { <o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;"> <span style="color: blue;">write-host</span> <span style="color: darkred;">"</span><span style="color: orangered;">$S</span><span style="color: darkred;"> is inaccessible
from </span><span style="color: orangered;">$env:computername</span><span style="color: darkred;">"</span> <span style="color: navy;">-ForegroundColor</span>
<span style="color: blueviolet;">Cyan</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;">
} <o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: 'Lucida Console'; font-size: 9pt;"><span style="background-color: #f3f3f3;">} </span><span style="background-color: white;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: 'Lucida Console'; font-size: 9pt;"><span style="background-color: #f3f3f3;"><br /></span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><b><i><u style="background-color: cyan;">3.Multiple Server Entire Directory Structure and File Copy </u></i></b></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3;"><span style="color: darkgreen; font-family: 'Lucida Console'; font-size: 9pt;"># Directory from where the files
and folder structure needs to be copied</span><span style="font-family: 'Lucida Console'; font-size: 9pt;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3;"><span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">$directorypath</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">'C:\directory\*.*'</span> <span style="color: darkgreen;">#Change
the path based on your file location</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3;"><span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">$servercount</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;"> <span style="color: darkgrey;">=</span> <span style="color: blue;">read-host</span> <span style="color: darkred;">"Enter
total number of servers for filecopy"</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3;"><span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;"># Accepting servernames and inserting
them in an Array</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3;"><span style="color: darkblue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">if</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;"> (<span style="color: orangered;">$servercount</span>
<span style="color: darkgrey;">-gt</span> <span style="color: purple;">0</span>)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3;"><span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">#write-host "Enter the
servernames"</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3;"><span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">$servers</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;"> <span style="color: darkgrey;">=</span> @()<o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3;"><span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">$i</span><span style="color: darkgrey; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">=</span><span style="color: purple; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">0</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;"> <span style="color: darkblue;">do</span> <o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;"> <span style="color: orangered;">$servers</span> <span style="color: darkgrey;">+=</span> <span style="color: blue;">read-host</span> <span style="color: darkred;">"Enter
Server </span>$(<span style="color: orangered;">$i</span><span style="color: darkgrey;">+</span><span style="color: purple;">1</span>)<span style="color: darkred;">"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;"> <span style="color: orangered;">$i</span><span style="color: darkgrey;">++</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;">} <span style="color: darkblue;">while</span>(<span style="color: orangered;">$i</span> <span style="color: darkgrey;">-lt</span> <span style="color: orangered;">$servercount</span>)<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;"> <span style="color: darkgreen;">#Once servernames are accepted copy the entire
direcorypath structure with the files to destination </span><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;"> <span style="color: darkblue;">Foreach</span> (<span style="color: orangered;">$s</span> <span style="color: darkblue;">in</span> <span style="color: orangered;">$servers</span>){<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;"> <span style="color: darkgreen;">#write-host "destination is " $s</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;"> <span style="color: blue;">Copy-Item</span> <span style="color: orangered;">$directorypath</span>
<span style="color: navy;">-Destination</span> <span style="color: darkred;">"\\</span><span style="color: orangered;">$s</span><span style="color: darkred;">\C$\directory"</span>
<span style="color: navy;">-Recurse </span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;"><o:p></o:p></span><span style="background-color: #f3f3f3; color: darkgreen; font-family: 'Lucida Console'; font-size: 12px;"> #Change the Destination as per your requirement</span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;"> }<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;">}<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3;"><span style="color: darkblue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">else</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;"> <o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3; font-family: 'Lucida Console'; font-size: 9pt;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="background-color: #f3f3f3;"><span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;">write-host</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console"; mso-fareast-language: EN-GB;"> <span style="color: darkred;">"Total number of
servers is 0 script exccution closed"</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: 'Lucida Console'; font-size: 9pt;"><span style="background-color: #f3f3f3;">}</span><span style="background-color: white;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;">I'll update this with more scripts as and when tested and used. Until then keep learning and exploring...</span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><b><i><u style="background-color: cyan;"><br /></u></i></b></span></div>
</div>
Krutihttp://www.blogger.com/profile/13385897521211871375noreply@blogger.com2tag:blogger.com,1999:blog-8195522014866487394.post-13078338178596878702016-01-11T20:59:00.002-08:002016-01-11T21:00:04.086-08:00Getting Started with PowerShell<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><span style="font-family: Georgia, Times New Roman, serif;">Windows PowerShell is all about exploring .NET framework capability
through the command line</span>.</span><span style="font-family: Georgia, serif; font-size: 12pt;">Announced in 2006 itâs an admins paradise with the number of tasks that
can be automated through the command line. The below table gives the release
dates for various version of PowerShell.</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, serif; font-size: 12pt;"><br /></span></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: none; mso-border-alt: solid #A3A3A3 1.0pt; mso-padding-alt: 0cm 0cm 0cm 0cm; mso-yfti-tbllook: 1184;">
<tbody>
<tr>
<td style="border: solid #A3A3A3 1.0pt; padding: 4.0pt 4.0pt 4.0pt 4.0pt; width: 105.5pt;" valign="top" width="141"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">PowerShell
Version</span></b><span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><o:p></o:p></span></div>
</td>
<td style="border-left: none; border: solid #A3A3A3 1.0pt; mso-border-left-alt: solid #A3A3A3 1.0pt; padding: 4.0pt 4.0pt 4.0pt 4.0pt; width: 89.4pt;" valign="top" width="119"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">Release
Date</span></b><span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><o:p></o:p></span></div>
</td>
<td style="border-left: none; border: solid #A3A3A3 1.0pt; mso-border-left-alt: solid #A3A3A3 1.0pt; padding: 4.0pt 4.0pt 4.0pt 4.0pt; width: 147.15pt;" valign="top" width="196"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">Default
Windows Versions</span></b><span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><o:p></o:p></span></div>
</td>
<td style="border-left: none; border: solid #A3A3A3 1.0pt; mso-border-left-alt: solid #A3A3A3 1.0pt; padding: 4.0pt 4.0pt 4.0pt 4.0pt; width: 148.05pt;" valign="top" width="197"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">Available
Windows Versions</span></b><span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid #A3A3A3 1.0pt; mso-border-top-alt: solid #A3A3A3 1.0pt; padding: 4.0pt 4.0pt 4.0pt 4.0pt; width: 105.5pt;" valign="top" width="141"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">PowerShell
1.0<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid #A3A3A3 1.0pt; border-left: none; border-right: solid #A3A3A3 1.0pt; border-top: none; mso-border-left-alt: solid #A3A3A3 1.0pt; mso-border-top-alt: solid #A3A3A3 1.0pt; padding: 4.0pt 4.0pt 4.0pt 4.0pt; width: 89.4pt;" valign="top" width="119"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">November
2006<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid #A3A3A3 1.0pt; border-left: none; border-right: solid #A3A3A3 1.0pt; border-top: none; mso-border-left-alt: solid #A3A3A3 1.0pt; mso-border-top-alt: solid #A3A3A3 1.0pt; padding: 4.0pt 4.0pt 4.0pt 4.0pt; width: 147.15pt;" valign="top" width="196"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">Windows
Server 2008 (*)<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid #A3A3A3 1.0pt; border-left: none; border-right: solid #A3A3A3 1.0pt; border-top: none; mso-border-left-alt: solid #A3A3A3 1.0pt; mso-border-top-alt: solid #A3A3A3 1.0pt; padding: 4.0pt 4.0pt 4.0pt 4.0pt; width: 148.05pt;" valign="top" width="197"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><a href="http://support.microsoft.com/kb/926140"><span style="color: blue;">Windows
XP SP2</span></a><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><a href="http://support.microsoft.com/kb/926139"><span style="color: blue;">Windows
XP SP3</span></a><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><a href="http://support.microsoft.com/kb/926140"><span style="color: blue;">Windows
Server 2003 SP1</span></a><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><a href="http://support.microsoft.com/kb/926139"><span style="color: blue;">Windows
Server 2003 SP2</span></a><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><a href="http://support.microsoft.com/kb/926139"><span style="color: blue;">Windows
Server 2003 R2</span></a><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><a href="http://www.microsoft.com/en-us/download/details.aspx?id=23200"><span style="color: blue;">Windows Vista</span></a><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><a href="http://support.microsoft.com/kb/928439"><span style="color: blue;">Windows
Vista SP2</span></a><o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid #A3A3A3 1.0pt; mso-border-top-alt: solid #A3A3A3 1.0pt; padding: 4.0pt 4.0pt 4.0pt 4.0pt; width: 105.5pt;" valign="top" width="141"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">PowerShell
2.0<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid #A3A3A3 1.0pt; border-left: none; border-right: solid #A3A3A3 1.0pt; border-top: none; mso-border-left-alt: solid #A3A3A3 1.0pt; mso-border-top-alt: solid #A3A3A3 1.0pt; padding: 4.0pt 4.0pt 4.0pt 4.0pt; width: 89.4pt;" valign="top" width="119"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">October
2009<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid #A3A3A3 1.0pt; border-left: none; border-right: solid #A3A3A3 1.0pt; border-top: none; mso-border-left-alt: solid #A3A3A3 1.0pt; mso-border-top-alt: solid #A3A3A3 1.0pt; padding: 4.0pt 4.0pt 4.0pt 4.0pt; width: 147.15pt;" valign="top" width="196"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">Windows
7<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">Windows
Server 2008 R2 (**)<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid #A3A3A3 1.0pt; border-left: none; border-right: solid #A3A3A3 1.0pt; border-top: none; mso-border-left-alt: solid #A3A3A3 1.0pt; mso-border-top-alt: solid #A3A3A3 1.0pt; padding: 4.0pt 4.0pt 4.0pt 4.0pt; width: 148.05pt;" valign="top" width="197"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><a href="http://support.microsoft.com/kb/968929"><span style="color: blue;">Windows
XP SP3</span></a><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><a href="http://support.microsoft.com/kb/968929"><span style="color: blue;">Windows
Server 2003 SP2</span></a><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><a href="http://support.microsoft.com/kb/968929"><span style="color: blue;">Windows
Vista SP1</span></a><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><a href="http://support.microsoft.com/kb/968929"><span style="color: blue;">Windows
Vista SP2</span></a><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><a href="http://support.microsoft.com/kb/968929"><span style="color: blue;">Windows
Server 2008 SP1</span></a><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><a href="http://support.microsoft.com/kb/968929"><span style="color: blue;">Windows
Server 2008 SP2</span></a><o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid #A3A3A3 1.0pt; mso-border-top-alt: solid #A3A3A3 1.0pt; padding: 4.0pt 4.0pt 4.0pt 4.0pt; width: 105.5pt;" valign="top" width="141"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">PowerShell
3.0<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid #A3A3A3 1.0pt; border-left: none; border-right: solid #A3A3A3 1.0pt; border-top: none; mso-border-left-alt: solid #A3A3A3 1.0pt; mso-border-top-alt: solid #A3A3A3 1.0pt; padding: 4.0pt 4.0pt 4.0pt 4.0pt; width: 89.4pt;" valign="top" width="119"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">September
2012<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid #A3A3A3 1.0pt; border-left: none; border-right: solid #A3A3A3 1.0pt; border-top: none; mso-border-left-alt: solid #A3A3A3 1.0pt; mso-border-top-alt: solid #A3A3A3 1.0pt; padding: 4.0pt 4.0pt 4.0pt 4.0pt; width: 147.15pt;" valign="top" width="196"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">Windows
8<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">Windows
Server 2012<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid #A3A3A3 1.0pt; border-left: none; border-right: solid #A3A3A3 1.0pt; border-top: none; mso-border-left-alt: solid #A3A3A3 1.0pt; mso-border-top-alt: solid #A3A3A3 1.0pt; padding: 4.0pt 4.0pt 4.0pt 4.0pt; width: 148.05pt;" valign="top" width="197"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><a href="http://www.microsoft.com/en-us/download/details.aspx?id=34595"><span style="color: blue;">Windows 7 SP1</span></a><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><a href="http://www.microsoft.com/en-us/download/details.aspx?id=34595"><span style="color: blue;">Windows Server 2008 SP2</span></a><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><a href="http://www.microsoft.com/en-us/download/details.aspx?id=34595"><span style="color: blue;">Windows Server 2008 R2 SP1</span></a><o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid #A3A3A3 1.0pt; mso-border-top-alt: solid #A3A3A3 1.0pt; padding: 4.0pt 4.0pt 4.0pt 4.0pt; width: 105.5pt;" valign="top" width="141"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">PowerShell
4.0<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid #A3A3A3 1.0pt; border-left: none; border-right: solid #A3A3A3 1.0pt; border-top: none; mso-border-left-alt: solid #A3A3A3 1.0pt; mso-border-top-alt: solid #A3A3A3 1.0pt; padding: 4.0pt 4.0pt 4.0pt 4.0pt; width: 89.4pt;" valign="top" width="119"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">October
2013<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid #A3A3A3 1.0pt; border-left: none; border-right: solid #A3A3A3 1.0pt; border-top: none; mso-border-left-alt: solid #A3A3A3 1.0pt; mso-border-top-alt: solid #A3A3A3 1.0pt; padding: 4.0pt 4.0pt 4.0pt 4.0pt; width: 147.15pt;" valign="top" width="196"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">Windows
8.1<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">Windows
Server 2012 R2<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid #A3A3A3 1.0pt; border-left: none; border-right: solid #A3A3A3 1.0pt; border-top: none; mso-border-left-alt: solid #A3A3A3 1.0pt; mso-border-top-alt: solid #A3A3A3 1.0pt; padding: 4.0pt 4.0pt 4.0pt 4.0pt; width: 148.05pt;" valign="top" width="197"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><a href="http://www.microsoft.com/en-us/download/details.aspx?id=40855"><span style="color: blue;">Windows 7 SP1</span></a><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><a href="http://www.microsoft.com/en-us/download/details.aspx?id=40855"><span style="color: blue;">Windows Server 2008 R2 SP1</span></a><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><a href="http://www.microsoft.com/en-us/download/details.aspx?id=40855"><span style="color: blue;">Windows Server 2012</span></a><o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid #A3A3A3 1.0pt; mso-border-top-alt: solid #A3A3A3 1.0pt; padding: 4.0pt 4.0pt 4.0pt 4.0pt; width: 105.5pt;" valign="top" width="141"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">PowerShell
5.0<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid #A3A3A3 1.0pt; border-left: none; border-right: solid #A3A3A3 1.0pt; border-top: none; mso-border-left-alt: solid #A3A3A3 1.0pt; mso-border-top-alt: solid #A3A3A3 1.0pt; padding: 4.0pt 4.0pt 4.0pt 4.0pt; width: 89.4pt;" valign="top" width="119"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">April
2014 <o:p></o:p></span></div>
</td>
<td style="border-bottom: solid #A3A3A3 1.0pt; border-left: none; border-right: solid #A3A3A3 1.0pt; border-top: none; mso-border-left-alt: solid #A3A3A3 1.0pt; mso-border-top-alt: solid #A3A3A3 1.0pt; padding: 4.0pt 4.0pt 4.0pt 4.0pt; width: 147.15pt;" valign="top" width="196"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">Windows
10<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid #A3A3A3 1.0pt; border-left: none; border-right: solid #A3A3A3 1.0pt; border-top: none; mso-border-left-alt: solid #A3A3A3 1.0pt; mso-border-top-alt: solid #A3A3A3 1.0pt; padding: 4.0pt 4.0pt 4.0pt 4.0pt; width: 148.05pt;" valign="top" width="197"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><a href="http://www.microsoft.com/en-us/download/details.aspx?id=44070"><span style="color: blue;">Windows 8.1</span></a><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><a href="http://www.microsoft.com/en-us/download/details.aspx?id=44070"><span style="color: blue;">Windows Server 2012 R2</span></a><o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<br />
<div>
<h2 style="margin-bottom: 0.0001pt; text-align: left;">
<span lang="EN-US" style="background-color: cyan; font-family: Georgia, serif; font-size: 12pt;"><i>1. Why & what is Powershell.</i></span></h2>
</div>
<div>
<span lang="EN-US" style="background-color: cyan; font-family: Georgia, serif; font-size: 12pt;"><i><br /></i></span></div>
<div>
<span lang="EN-US" style="background-color: cyan; font-family: Georgia, serif; font-size: 12pt;"></span><br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="font-family: Georgia, serif; font-size: 12pt;"><span style="background-color: white; color: #444444;"><span lang="EN-US" style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">Prior to Powershell VBscripts/unix scripts or DOS commands were encoded
in batch files to be executed for performing repetitive task.</span><span lang="EN-US" style="font-size: 12pt;">Should there be a need to change the pattern of design the entire code
would have to be re-written.<o:p></o:p></span><span style="font-size: 12pt;">This involved additional work, time and testing. Instead there was a
need of a functionality wherein which you could write you own scripts give it a
command name similar to that like DIR or MKDIR and have different parameter
sets modifiable as per requirements.</span></span></span></div>
<span lang="EN-US" style="background-color: cyan; font-family: Georgia, serif; font-size: 12pt;">
</span>
<br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"></span></div>
<div style="margin-bottom: 0.0001pt; text-align: left;">
<span lang="EN-US" style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">PowerShell was invented with the idea of automating Microsoft GUI
commands through a command-line interface.If you have any of the above windows version installed you will find the
PowerShell under All programs -> Accessories -> Windows Powershell. </span></span></div>
<div style="margin-bottom: 0.0001pt; text-align: left;">
<span style="background-color: white; color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12pt;">PowerShell is both a command-line shell and scripting language. </span></div>
<div style="margin-bottom: 0.0001pt; text-align: left;">
<span style="background-color: white; color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12pt;"><br /></span></div>
<div style="margin-bottom: 0.0001pt; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTuNhHjxlvjPxQUuCdG6JrdZK5ATzXq2dxcGJbr_iuax8VsBnkmZcWXpLO05TrGx2YMqrUIDrTfRjvT-rK2aBJIMsmVkpeuNRk0WKYdxB_gh5iCcgXksRcDxf26szr13_GiGAwuC72IHc/s1600/1.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-left: 1em;"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTuNhHjxlvjPxQUuCdG6JrdZK5ATzXq2dxcGJbr_iuax8VsBnkmZcWXpLO05TrGx2YMqrUIDrTfRjvT-rK2aBJIMsmVkpeuNRk0WKYdxB_gh5iCcgXksRcDxf26szr13_GiGAwuC72IHc/s1600/1.jpg" /></span></a><span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="color: #444444;"><br /></span></span></span><span lang="EN-US" style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="color: #444444;"><br /></span></span></span><span lang="EN-US" style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="color: #444444;"><br /></span></span></span><span lang="EN-US" style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="color: #444444;"><br /></span></span></span><span lang="EN-US" style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="color: #444444;"><br /></span></span></span><span lang="EN-US" style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="color: #444444;"><br /></span></span></span><span lang="EN-US" style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="color: #444444;"><br /></span></span></span><span style="color: #444444;"><span lang="EN-US" style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">You may choose the ISE environment (x86 if your are running a 32-bit
system) once you are familiar with the commands and wish to start scripting
programs in PowerShell.</span><b><span lang="EN-US" style="background: white; font-size: 12pt;"><o:p> </o:p></span></b><span lang="EN-US" style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">PowerShell has its internal variables as well just like any other
shell. </span></span></span><br />
<br />
<h2 style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="background-color: cyan; font-family: Georgia, serif; font-size: 12pt;"><b><i>Get-Variable would return the list.</i></b></span></h2>
<div>
<span lang="EN-US" style="background-color: cyan; font-family: Georgia, serif; font-size: 12pt;"><b><i><br /></i></b></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGPFJiK8U9wja1Xo1xcXQrvz-f96I-2ZjvVoAO_y09WoY8HPId4zPiQMujaf25sS8z4d-7XcCDDQIAYPklRN0yoPH2pk2InHEObBHhvNUeW1Ysq-N_peIp_nyaEvpIk9rxutYkEX1I1mY/s1600/1.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="298" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGPFJiK8U9wja1Xo1xcXQrvz-f96I-2ZjvVoAO_y09WoY8HPId4zPiQMujaf25sS8z4d-7XcCDDQIAYPklRN0yoPH2pk2InHEObBHhvNUeW1Ysq-N_peIp_nyaEvpIk9rxutYkEX1I1mY/s640/1.jpg" width="640" /></a></div>
<br />
<div style="text-align: left;">
<span style="color: #444444;"><span style="font-family: Georgia, Times New Roman, serif;">All the commands written for PowerShell are called CMDLETS and they have the common structure of Verb-Noun. The native Windows-DOS and Unix commands work with PowerShell. For ef - dir,cls,ps,etc. Below are a few basic commands</span></span></div>
</div>
<div>
<span lang="EN-US" style="font-size: 12pt;"></span><br />
<div class="MsoNormal" style="font-family: Georgia, serif; margin: 0cm 0cm 0.0001pt 27pt; text-indent: -18pt; vertical-align: middle;">
<span lang="EN-US" style="font-size: 12pt;"><br /></span>
<!--[if !supportLists]--><span lang="EN-US" style="font-size: 12pt;"><span style="background-color: white;"><span lang="EN-US" style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-ansi-language: EN-US; mso-bidi-font-family: Georgia; mso-fareast-font-family: Georgia; mso-fareast-language: EN-GB;">1.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]--><span lang="EN-US" style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">Get- help<o:p></o:p></span></span></span></div>
<span lang="EN-US" style="font-size: 12pt;">
<div class="MsoNormal" style="font-family: Georgia, serif; margin: 0cm 0cm 0.0001pt 27pt; text-indent: -18pt; vertical-align: middle;">
<!--[if !supportLists]--><span style="background-color: white;"><span lang="EN-US" style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-ansi-language: EN-US; mso-bidi-font-family: Georgia; mso-fareast-font-family: Georgia; mso-fareast-language: EN-GB;">2.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]--><span lang="EN-US" style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">Get-command<o:p></o:p></span></span></div>
<div class="MsoNormal" style="font-family: Georgia, serif; margin: 0cm 0cm 0.0001pt 27pt; text-indent: -18pt; vertical-align: middle;">
<!--[if !supportLists]--><span style="background-color: white;"><span lang="EN-US" style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-ansi-language: EN-US; mso-bidi-font-family: Georgia; mso-fareast-font-family: Georgia; mso-fareast-language: EN-GB;">3.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]--><span lang="EN-US" style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">Get-verb<o:p></o:p></span></span></div>
<div class="MsoNormal" style="font-family: Georgia, serif; margin: 0cm 0cm 0.0001pt 27pt; text-indent: -18pt; vertical-align: middle;">
<!--[if !supportLists]--><span style="background-color: white;"><span lang="EN-US" style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-ansi-language: EN-US; mso-bidi-font-family: Georgia; mso-fareast-font-family: Georgia; mso-fareast-language: EN-GB;">4.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]--><span lang="EN-US" style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">Get-member<o:p></o:p></span></span></div>
<div class="MsoNormal" style="font-family: Georgia, serif; margin: 0cm 0cm 0.0001pt 27pt; text-indent: -18pt; vertical-align: middle;">
<!--[if !supportLists]--><span style="background-color: white;"><span lang="EN-US" style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-ansi-language: EN-US; mso-bidi-font-family: Georgia; mso-fareast-font-family: Georgia; mso-fareast-language: EN-GB;">5.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]--><span lang="EN-US" style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">Get-alias<o:p></o:p></span></span></div>
<div class="MsoNormal" style="font-family: Georgia, serif; margin: 0cm 0cm 0.0001pt 27pt; text-indent: -18pt; vertical-align: middle;">
<span lang="EN-US" style="background-color: white; font-family: Georgia, serif; font-size: 12pt;"><br /></span></div>
<div class="MsoNormal" style="font-family: Georgia, serif; margin: 0cm 0cm 0.0001pt 27pt; text-indent: -18pt; vertical-align: middle;">
<span lang="EN-US" style="background-color: white; font-family: Georgia, serif; font-size: 12pt;"></span></div>
<div class="MsoNormal" style="font-family: Georgia, serif; margin-bottom: 0.0001pt;">
<span style="background-color: white; color: #444444;">Anything and everything can be learnt I believe with proper use of the above CmdLets .Get-Help has a similar functionality as man command in Unix. Powershell works with all the wild card characters similar to Unix or DOS âŚ<span style="font-size: 12pt;">Suppose
you need to know the commands associated with process.</span><span style="font-size: 12pt;">I would
type something like </span></span></div>
<div class="MsoNormal" style="font-family: Georgia, serif; margin-bottom: 0.0001pt;">
<span style="background-color: white;"><span style="font-size: 12pt;"><br /></span></span></div>
<h2 style="font-family: Georgia, serif; margin-bottom: 0.0001pt; text-align: left;">
<span style="background-color: cyan; font-size: 12pt;"><b><i><u>Get-Command *Process</u></i></b></span></h2>
<div class="MsoNormal" style="font-family: Georgia, serif; margin-bottom: 0.0001pt;">
<span style="background-color: white; color: #444444; font-size: 12pt;">and it would return the following output depending on the version.</span></div>
<div class="separator" style="clear: both; font-family: Georgia, serif; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg26lnSU9EzlGhPLxw6jh45N3YwqjNLfeoRckSWRkGXiMfVHOKWqB6tNXJNuBiiPH4A2un_tIM_E_5wGGttk3PfhccIKWe0WdI4X2bT19ex1RYI77f4VTFE053RdYwT0_OIsQjj6AAr7ag/s1600/3.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="68" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg26lnSU9EzlGhPLxw6jh45N3YwqjNLfeoRckSWRkGXiMfVHOKWqB6tNXJNuBiiPH4A2un_tIM_E_5wGGttk3PfhccIKWe0WdI4X2bT19ex1RYI77f4VTFE053RdYwT0_OIsQjj6AAr7ag/s640/3.jpg" width="640" /></a></div>
<div class="MsoNormal" style="font-family: Georgia, serif; margin-bottom: 0.0001pt;">
<span style="background-color: white; color: #444444; font-size: 12pt;"><br /></span></div>
</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="color: #444444; font-family: Georgia, serif; font-size: 12pt;">To know
the syntax and semantics of the usage of the command one could use.</span></div>
<h2 style="margin-bottom: 0.0001pt; text-align: left;">
<span style="background-color: cyan; font-family: Georgia, serif; font-size: 12pt;"><b><i><u>Get-help
Start-process </u></i></b></span></h2>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="color: #444444; font-family: Georgia, serif; font-size: 12pt;">and it would return the following output depending on the
version.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgU1sb6PQheGpLSWUkWei_M_HWPwDV-Rz2a3g2-qpGm4551RH_X0aXsqCY3fe0nQ0oC-2TFilw6-0aNGtZPFGWDJ9j1TI1TsLB7j0IoupYfrheCzGasmy2To_GpBPvKvWF7hiA3doxcXFU/s1600/5.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="322" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgU1sb6PQheGpLSWUkWei_M_HWPwDV-Rz2a3g2-qpGm4551RH_X0aXsqCY3fe0nQ0oC-2TFilw6-0aNGtZPFGWDJ9j1TI1TsLB7j0IoupYfrheCzGasmy2To_GpBPvKvWF7hiA3doxcXFU/s640/5.jpg" width="640" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="color: #444444; font-family: Georgia, serif; font-size: 12pt;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="color: #444444; font-family: Georgia, serif; font-size: 12pt;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="color: #444444; font-family: Georgia, serif; font-size: 12pt;">As I
stated earlier powershell returns object so if one wants to know what kind of
object is returned and how to work further with the object </span><span style="color: #444444; font-family: Georgia, serif; font-size: 12pt;">you could try</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, serif; font-size: 12pt;"><br /></span></div>
<h2 style="margin-bottom: 0.0001pt; text-align: left;">
<span style="background-color: cyan; font-family: Georgia, serif; font-size: 12pt;"><b><i><u>Get-Process
| Get-Member </u></i></b></span></h2>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="color: #444444;"><span style="font-family: Georgia, serif; font-size: 12pt;">and it would return the following output</span><span style="font-family: Georgia, serif; font-size: 12pt;"> </span><span style="font-family: Georgia, serif; font-size: 12pt;">depending on the version.</span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjM7_tcWDeYGqaoGxpqADTq0bdZuT0PQvT8kteWhEFXS1UdiUlqMvuINHAD3VrlzRtF5eoJo-QZnujmTesqjWtNS8qyqywa3T3WFheZqNPMEITRxPnwRI4xN7j7fiRjJqbXFwumM-fMFjQ/s1600/6.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="246" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjM7_tcWDeYGqaoGxpqADTq0bdZuT0PQvT8kteWhEFXS1UdiUlqMvuINHAD3VrlzRtF5eoJo-QZnujmTesqjWtNS8qyqywa3T3WFheZqNPMEITRxPnwRI4xN7j7fiRjJqbXFwumM-fMFjQ/s640/6.jpg" width="640" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="color: #444444;"><span style="font-family: Georgia, serif; font-size: 12pt;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="color: #444444;"><span style="font-family: Georgia, serif; font-size: 12pt;">Wondering
how the native commands works simple.</span><span style="font-family: Georgia, serif; font-size: 12pt;">Type the
command</span></span></div>
<h2 style="margin-bottom: 0.0001pt; text-align: left;">
<u style="font-family: Georgia, serif; font-size: 12pt;"><i><b style="background-color: cyan;">Get-Alias </b></i></u></h2>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, serif; font-size: 12pt;"><span style="color: #444444;">and you would get the below output depending on the version.</span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgShgktDj3I_eK1eUF7svndlJgy5V_R13fXbysywP7Q1JCUtH_I3aJmR-USM64xWYd2p0XZp2N6DC1ek8C7MbgCS_3lk5Gvzff04PNjXQCdMYBvjysznRwYuPMWT8IFXTP803f9oMHYc_Y/s1600/7.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="248" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgShgktDj3I_eK1eUF7svndlJgy5V_R13fXbysywP7Q1JCUtH_I3aJmR-USM64xWYd2p0XZp2N6DC1ek8C7MbgCS_3lk5Gvzff04PNjXQCdMYBvjysznRwYuPMWT8IFXTP803f9oMHYc_Y/s640/7.jpg" width="640" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, serif; font-size: 12pt;"><span style="color: #444444;"><br /></span></span></div>
<h2 style="margin-bottom: 0.0001pt; text-align: left;">
<span style="background-color: cyan; font-family: Georgia, serif; font-size: 12pt;"><b><i><u>Get-verb </u></i></b></span></h2>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="color: #444444;"><span style="font-family: Georgia, serif; font-size: 12pt;">lists the existing verb supported by PowerShell.</span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMOxVYh_QV4O4St6MgLrzucRbibAaAYuKB6U2uPCAP3Lw7WDixnKoK72sDhgOeetiJIz8kXthaY5-5NGQ63Um6xgr5qnwZEJtGI-02am7GkFRsfhyphenhyphenXEOOdK29YvQSap7cXAYegiBN_6fw/s1600/8.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="230" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMOxVYh_QV4O4St6MgLrzucRbibAaAYuKB6U2uPCAP3Lw7WDixnKoK72sDhgOeetiJIz8kXthaY5-5NGQ63Um6xgr5qnwZEJtGI-02am7GkFRsfhyphenhyphenXEOOdK29YvQSap7cXAYegiBN_6fw/s640/8.jpg" width="640" /></a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="color: #444444;"><span style="font-family: Georgia, serif; font-size: 12pt;">I'd
suggest if you really want to learn first run the command Get-Help Get-Help and
browse your way through the options. </span><span style="font-family: Georgia, serif; font-size: 12pt;">If youâre
a keen learner this blog will just help you take your first step to the arena
of automation through PowerShell.</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, serif; font-size: 12pt;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, serif; font-size: 12pt;">Microsoft
Virtual Academy provides and 6 hours intensive course by expert Jeffrey Snover,
the inventor of PowerShell, and Jason Helmick, Senior Technologist at
Concentrated Technolog to get started with powershell. </span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<a href="https://mva.microsoft.com/en-US/training-courses/getting-started-with-powershell-3-0-jump-start-8276?l=5Rb7mQWy_5704984382My" style="font-family: Georgia, serif; font-size: 12pt;">https://mva.microsoft.com/en-US/training-courses/getting-started-with-powershell-3-0-jump-start-8276?l=5Rb7mQWy_5704984382</a></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, serif; font-size: 12pt;"><span style="color: #444444;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="color: #444444;"><span style="font-family: Georgia, serif; font-size: 12pt;">My personal favorite are books by Don Jones. "Learn Powershell in a month of
lunches" It helped me get started. I also recommend to go through the below link which provides a summary of PowerShell basics.</span></span><br />
<span style="color: #444444;"><span style="font-family: Georgia, serif;"><a href="https://technet.microsoft.com/en-us/magazine/hh551144.aspx">https://technet.microsoft.com/en-us/magazine/hh551144.aspx</a></span></span><br />
<span style="color: #444444;"><span style="font-family: Georgia, serif;"><br /></span></span>
<span style="color: #444444;"><span style="font-family: Georgia, serif; font-size: 12pt;">Powershell
has the ability to work with different modules like SQL server, Active
Directory, Windows Administration, IIS. Advantages and usage of Powershell are
limitless for you to explore.</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, serif; font-size: 12pt;"><span style="color: #444444;"><br /></span></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 27pt;">
<span lang="EN-US" style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; line-height: 115%; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: Calibri; mso-fareast-language: EN-GB; mso-no-proof: yes;"><br /><!--[endif]--></span></div>
</div>
</div>
Krutihttp://www.blogger.com/profile/13385897521211871375noreply@blogger.com1tag:blogger.com,1999:blog-8195522014866487394.post-4514009396902794502016-01-05T05:16:00.004-08:002016-01-05T05:28:57.260-08:00One Note is the new WordPad<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal">
<span style="font-family: Georgia, serif;"><span style="font-size: 12pt; line-height: 18.4px;">For all those still using Microsoft Word to take memos, prepare templates for email, preparing to do lists or even recording meetings, one note brings an altogether smart and efficient way for you to makes these tasks easier. For </span><span style="line-height: 18.4px;">book lovers</span><span style="font-size: 12pt; line-height: 18.4px;"> like me who are used to jotting down their ideas on planners or notebooks one note just as the word says is an ideal solution.</span></span><span style="font-family: Georgia, serif; font-size: 12pt; line-height: 18.4px;">You may look up its benefits online on the Microsoft websites.</span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">Letâs hit directly with using it, to get familiarized with its time saving and collaborative office benefits.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<h2>
<span style="background-color: cyan; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><i><u>1. To Start OneNote</u></i></span></h2>
<div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><span style="color: #444444;">To start OneNote you need to get to navigate through Microsoft Office -> One Note or simple type One Note at the Start-> Run prompt.</span><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSj_jrXdr118B8Pm_9I9yIO8HvtWjU6m0MmuRnQWx8CaMQUTqjvqCVX0WwDW5Gn-JgfQgUFG_YH0dUNx2J_Yd_fs1qfCwZTc5e23NfQMd8Z3Nxlh4-aJbAyGkXHX9W2LiPupIDF1kPkqI/s1600/1.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: Georgia, Times New Roman, serif;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSj_jrXdr118B8Pm_9I9yIO8HvtWjU6m0MmuRnQWx8CaMQUTqjvqCVX0WwDW5Gn-JgfQgUFG_YH0dUNx2J_Yd_fs1qfCwZTc5e23NfQMd8Z3Nxlh4-aJbAyGkXHX9W2LiPupIDF1kPkqI/s400/1.jpg" width="332" /></span></a></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><span style="color: #444444;">The very first time that you use One Note it takes you to the below screen.</span><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwdfZ-gB4PIZ9o6kdeI88EWGxG9iP3gTQso440bl0TK8DtMtJzJk_vfz1qGFoi4hHekc6xJe_9qN7_eHxM3t3NU9LcbH0_tFsU7mM_E_6FRZX4DjG-dvKpzdEjpsrlsyQN2vLTHy0D4oY/s1600/2.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: Georgia, Times New Roman, serif;"><img border="0" height="275" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwdfZ-gB4PIZ9o6kdeI88EWGxG9iP3gTQso440bl0TK8DtMtJzJk_vfz1qGFoi4hHekc6xJe_9qN7_eHxM3t3NU9LcbH0_tFsU7mM_E_6FRZX4DjG-dvKpzdEjpsrlsyQN2vLTHy0D4oY/s640/2.jpg" width="640" /></span></a></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><span style="color: #444444;">As a learner I would strongly recommend you to take a few mins and browse through the navigation pane on the right across the various topics listed</span><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguQSf6MVUbI-JY01aGbx5p5dupcS-kO-4T9RdnK7AkDCyazftR7AFln8nJtwXRzaqVMVuLwMTsZAoeJppZJ0RHVbJtkIKsoaBGW309_Re2YS7y85S-jK8Ox97Ywq5DFQbLPd2uEa2MQsA/s1600/3.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: Georgia, Times New Roman, serif;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguQSf6MVUbI-JY01aGbx5p5dupcS-kO-4T9RdnK7AkDCyazftR7AFln8nJtwXRzaqVMVuLwMTsZAoeJppZJ0RHVbJtkIKsoaBGW309_Re2YS7y85S-jK8Ox97Ywq5DFQbLPd2uEa2MQsA/s1600/3.jpg" /></span></a></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoListParagraph">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444; font-family: "Georgia","serif"; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";">You will notice the page change under the general section as you move across the different tabs. </span><span style="color: #444444;"><span style="font-size: 12pt; line-height: 18.4px;">For a blogger like myself I find it very efficient in managing my </span><span style="line-height: 18.4px;">blog-notes</span><span style="font-size: 12pt; line-height: 18.4px;">. </span></span></span></div>
<div class="MsoListParagraph">
<span style="color: #444444;"><span style="font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span></span></div>
<h2>
<span style="background-color: cyan; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><i><u>2. To Create a New Note</u></i></span></h2>
<div>
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444; font-size: 12pt; line-height: 18.4px;">Hereâs how </span><span style="color: #444444; font-size: 12pt; line-height: 18.4px;">I created a Note and named it Blog Topics as you can see below.</span></span></div>
<div>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPHrtoZT4-6JlC1_AxgL75roLucRkWNzjML7aj1Z-MycqA8veP9CiSl43VTTMvGk_0EEZUT5y5PcYTuVq1g81sWLoDzSJDRsG3edhL9HFdFdvyzbf-BZoJv7jxAV0MuvejDcTXMGuw1f4/s1600/4.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: Georgia, Times New Roman, serif;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPHrtoZT4-6JlC1_AxgL75roLucRkWNzjML7aj1Z-MycqA8veP9CiSl43VTTMvGk_0EEZUT5y5PcYTuVq1g81sWLoDzSJDRsG3edhL9HFdFdvyzbf-BZoJv7jxAV0MuvejDcTXMGuw1f4/s400/4.jpg" width="375" /></span></a></div>
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2XQVhYX81IEJAlLTFysNc-xMDO3JwtK1quZ0Ot-5ps5lxUJqFSodZC-O8eI7yXfeZZO2oZvd3uXcoMw7O55kdwquc7JUq5E73x3S9q1p2gcNUtEaa_W7MhtM3i_5oy6RFBFuRNPWT_uU/s1600/5.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: Georgia, Times New Roman, serif;"><br /></span></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2XQVhYX81IEJAlLTFysNc-xMDO3JwtK1quZ0Ot-5ps5lxUJqFSodZC-O8eI7yXfeZZO2oZvd3uXcoMw7O55kdwquc7JUq5E73x3S9q1p2gcNUtEaa_W7MhtM3i_5oy6RFBFuRNPWT_uU/s1600/5.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: Georgia, Times New Roman, serif;"> </span></a></div>
<div class="MsoListParagraph">
<span style="color: #444444;"><span style="font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span></span></div>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2XQVhYX81IEJAlLTFysNc-xMDO3JwtK1quZ0Ot-5ps5lxUJqFSodZC-O8eI7yXfeZZO2oZvd3uXcoMw7O55kdwquc7JUq5E73x3S9q1p2gcNUtEaa_W7MhtM3i_5oy6RFBFuRNPWT_uU/s1600/5.jpg" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><span style="font-family: Georgia, Times New Roman, serif;"><img border="0" height="195" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2XQVhYX81IEJAlLTFysNc-xMDO3JwtK1quZ0Ot-5ps5lxUJqFSodZC-O8eI7yXfeZZO2oZvd3uXcoMw7O55kdwquc7JUq5E73x3S9q1p2gcNUtEaa_W7MhtM3i_5oy6RFBFuRNPWT_uU/s640/5.jpg" width="640" /></span></a></td></tr>
<tr><td class="tr-caption" style="font-size: 12.8px; text-align: center;"><span style="font-family: Georgia, Times New Roman, serif;">Section Diagram</span><br />
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></td></tr>
</tbody></table>
<div class="MsoListParagraph">
<span style="color: #444444;"><span style="font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span></span></div>
<div class="MsoListParagraph">
<span style="color: #444444;"><span style="font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span></span></div>
<div class="MsoListParagraph">
<span style="color: #444444;"><span style="font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span></span></div>
<div class="MsoListParagraph">
<span style="color: #444444;"><span style="font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span></span></div>
<div class="MsoListParagraph">
<span style="color: #444444;"><span style="font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span></span></div>
<div class="MsoListParagraph">
<span style="color: #444444;"><span style="font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span></span></div>
<div class="MsoListParagraph">
<span style="color: #444444;"><span style="font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span></span></div>
<div class="MsoListParagraph">
<span style="color: #444444;"><span style="font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span></span></div>
<div class="MsoListParagraph">
<span style="color: #444444;"><span style="font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span></span></div>
<div class="MsoListParagraph">
<span style="color: #444444;"><span style="font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span></span></div>
<h2>
<span style="background-color: cyan; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><i><u>3. To Create a New Sections, Pages</u></i></span></h2>
<div>
<div class="MsoListParagraphCxSpFirst">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><span style="color: #444444; font-family: "Georgia","serif"; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";">As the sections are tabbed so are the options to create those sections.</span><span style="font-size: 12pt; line-height: 18.4px;">Just like a notebook you can have multiple sections in one note. They shall be listed above in Section 1.</span></span></div>
<div class="MsoListParagraphCxSpLast">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;">Options to create the sections are on the left in Section 2. When you right click you will see the below options.</span><o:p></o:p></span></div>
<div class="MsoListParagraphCxSpLast">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPM5e_-3u7DmbH2kD8Mu-eVBLaOkFpS81pYjD6g78gAw8dUA5SQ4-bWw9Pb8y-O-khhCzIzLlayNgZhfKE44vJoTJBHIYRzCc_feTx1QRGwmD2tIfdXHS_0wIGZqlZywj2lxAmefS0P48/s1600/6.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: Georgia, Times New Roman, serif;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPM5e_-3u7DmbH2kD8Mu-eVBLaOkFpS81pYjD6g78gAw8dUA5SQ4-bWw9Pb8y-O-khhCzIzLlayNgZhfKE44vJoTJBHIYRzCc_feTx1QRGwmD2tIfdXHS_0wIGZqlZywj2lxAmefS0P48/s1600/6.jpg" /></span></a></div>
<div class="MsoListParagraphCxSpLast">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
</div>
<div class="MsoListParagraph">
<span style="color: #444444;"><span style="font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span></span></div>
<div class="MsoListParagraph">
<span style="color: #444444;"><span style="font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span></span></div>
<div class="MsoListParagraph">
<span style="color: #444444;"><span style="font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span></span></div>
<div class="MsoListParagraph">
<span style="color: #444444;"><span style="font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span></span></div>
<div class="MsoListParagraph">
<span style="color: #444444;"><span style="font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span></span></div>
<div class="MsoListParagraph">
<span style="color: #444444;"><span style="font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span></span></div>
<div class="MsoListParagraph">
<span style="color: #444444;"><span style="font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span></span></div>
<div class="MsoListParagraph">
<span style="color: #444444;"><span style="font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span></span></div>
<div class="MsoListParagraph">
<span style="color: #444444;"><span style="font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span></span></div>
<div class="MsoListParagraph">
<span style="color: #444444;"><span style="font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span></span></div>
<div class="MsoListParagraph">
<span style="color: #444444;"><span style="font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span></span></div>
<div class="MsoListParagraph">
<span style="color: #444444;"><span style="font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span></span></div>
<div class="MsoListParagraph">
<span style="color: #444444;"><span style="font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span></span></div>
<div class="MsoListParagraph">
<span style="color: #444444;"><span style="font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;">Under Section 3 you may create pages for the section selected. On Right click you get the below screen.</span><o:p></o:p></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZXEF9ggF6chHTPKcEmOngWQE2cjhL7_cvuvoAb2uWZ9uIeF24fljCFwk4Pki1bhJBA5RmqLe7VuEFpraDhsSaee2dZmvBH_YrOd4ofd-0eHA3XyF98m-3cq6NeSUUdtEsaHj_h_ZMCWc/s1600/7.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: Georgia, Times New Roman, serif;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZXEF9ggF6chHTPKcEmOngWQE2cjhL7_cvuvoAb2uWZ9uIeF24fljCFwk4Pki1bhJBA5RmqLe7VuEFpraDhsSaee2dZmvBH_YrOd4ofd-0eHA3XyF98m-3cq6NeSUUdtEsaHj_h_ZMCWc/s1600/7.jpg" /></span></a></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;">Once a page is created you may right click on the same to make it a sub page for the section. </span><br />
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span></div>
<h2>
<span style="background-color: cyan; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><i><u>4. To Create Automated To Do List Pages</u></i></span></h2>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;">You may also select the drop down under section 3 - > new Page to get the below screen.</span><o:p></o:p></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-reBGRFDnb0v3JsdkSgCdx5Gu4XVkNosx4t8HDyxKoKXP_HAc2XZ5UMvPFEcUXUbg1HUZVZhOyhcOm8xtVRomZdF4kBbkT4yPSFQ8c5anXTz94IcW7Pwcarmqt_Wx7GrynBTFfa8BxYo/s1600/9.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: Georgia, Times New Roman, serif;"><img border="0" height="186" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-reBGRFDnb0v3JsdkSgCdx5Gu4XVkNosx4t8HDyxKoKXP_HAc2XZ5UMvPFEcUXUbg1HUZVZhOyhcOm8xtVRomZdF4kBbkT4yPSFQ8c5anXTz94IcW7Pwcarmqt_Wx7GrynBTFfa8BxYo/s640/9.jpg" width="640" /></span></a></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;">It simplifies the tasks of creating the lists. Under the home section out of the various options I found the Tags and Find Tags section very useful when making notes. </span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><br /></span></div>
<h2>
<span style="background-color: cyan; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><i><u>5. To Create Tags, Find Tags</u></i></span></h2>
</div>
<div>
<span style="background-color: cyan; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><i><u><br /></u></i></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkjkR3dwvi49TsG-BnPft0ZhcSl_c-ljXy3-cgL1RK0Ynhm5xOJZIwqoMFe0jctlPYrnv8GtkUxv1fEDfxpo7jhAy0b059lu02t_nJkU1ITh0tN3tcVnJkDRzuNO3WOfjcXfSrAykv0SA/s1600/12.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: Georgia, Times New Roman, serif;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkjkR3dwvi49TsG-BnPft0ZhcSl_c-ljXy3-cgL1RK0Ynhm5xOJZIwqoMFe0jctlPYrnv8GtkUxv1fEDfxpo7jhAy0b059lu02t_nJkU1ITh0tN3tcVnJkDRzuNO3WOfjcXfSrAykv0SA/s400/12.jpg" width="151" /></span></a></div>
<div>
<span style="background-color: cyan; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><i><u><br /></u></i></span></div>
<div>
<span style="background-color: cyan; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><i><u><br /></u></i></span></div>
<div>
<span style="background-color: cyan; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><i><u><br /></u></i></span></div>
<div>
<span style="background-color: cyan; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><i><u><br /></u></i></span></div>
<div>
<span style="background-color: cyan; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><i><u><br /></u></i></span></div>
<div>
<span style="background-color: cyan; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><i><u><br /></u></i></span></div>
<div>
<span style="background-color: cyan; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><i><u><br /></u></i></span></div>
<div>
<span style="background-color: cyan; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><i><u><br /></u></i></span></div>
<div>
<span style="background-color: cyan; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><i><u><br /></u></i></span></div>
<div>
<span style="background-color: cyan; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><i><u><br /></u></i></span></div>
<div>
<span style="background-color: cyan; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><i><u><br /></u></i></span></div>
<div>
<span style="background-color: cyan; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><i><u><br /></u></i></span></div>
<div>
<span style="background-color: cyan; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><i><u><br /></u></i></span></div>
<div>
<span style="background-color: cyan; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><i><u><br /></u></i></span></div>
<div>
<span style="background-color: cyan; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><i><u><br /></u></i></span></div>
<div>
<span style="background-color: cyan; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><i><u><br /></u></i></span></div>
<div>
<span style="background-color: cyan; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><i><u><br /></u></i></span></div>
<div>
<span style="background-color: cyan; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><i><u><br /></u></i></span></div>
<div>
<span style="background-color: cyan; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><i><u><br /></u></i></span></div>
<div>
<span style="background-color: cyan; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><i><u><br /></u></i></span></div>
<div>
<span style="background-color: cyan; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><i><u><br /></u></i></span></div>
<div>
<span style="background-color: cyan; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><i><u><br /></u></i></span></div>
<div>
<br /></div>
<div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;">Find the below screenshot for the same. </span><o:p></o:p></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGfUbRxOkWd-LR_4Ql8oyZpJbGxSHJd0DeZQ0OLGEEjH3kQMdNVSTnCetyrD1wsicQQ5i-NOM_BvhAju92TUuYANSlscgZx4q28FkA4rmTUoiUge8qcka6hrRdPVTXJLUxOJKg4Wm9s8U/s1600/14.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: Georgia, Times New Roman, serif;"><img border="0" height="233" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGfUbRxOkWd-LR_4Ql8oyZpJbGxSHJd0DeZQ0OLGEEjH3kQMdNVSTnCetyrD1wsicQQ5i-NOM_BvhAju92TUuYANSlscgZx4q28FkA4rmTUoiUge8qcka6hrRdPVTXJLUxOJKg4Wm9s8U/s640/14.jpg" width="640" /></span></a></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";">The part where one can see the advantage of OneNote over word is the ability to work with outlook tasks/ emails/ meeting scheduler using OneNote.<o:p></o:p></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<h2>
<span style="background-color: cyan; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><i><u>6. To Generate automated mail containing contents of OneNote</u></i></span></h2>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;">When I clicked on Email I got the below new mail opened for me with the contents of the page I was editing as follows.</span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgxipqV_d2IrK2t62eNx8JZpSuihVX1BlEzdxkS9MuBQoCXgyuEAwTm5f9m4MNvEFPTqRlJiGuH4qWEabTpHfywQv4qBLy7QuS2WghlFqHDru7MT9ovh7VYpCU1VSZNdQSp0CsvMOAIek/s1600/15.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: Georgia, Times New Roman, serif;"><img border="0" height="466" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgxipqV_d2IrK2t62eNx8JZpSuihVX1BlEzdxkS9MuBQoCXgyuEAwTm5f9m4MNvEFPTqRlJiGuH4qWEabTpHfywQv4qBLy7QuS2WghlFqHDru7MT9ovh7VYpCU1VSZNdQSp0CsvMOAIek/s640/15.jpg" width="640" /></span></a></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><br /></span></div>
<div class="MsoListParagraph">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoListParagraph">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><span style="color: #444444; font-family: "Georgia","serif"; font-size: 12.0pt; line-height: 115%; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;">I could also use the task option for any of the items in the list and it would sync the changes with my outlook. </span><span style="font-size: 12pt; line-height: 18.4px;">Isnât it amazing to draft and send mails on the fly without ctrl+c / ctrl+x.</span></span></div>
<div class="MsoListParagraphCxSpLast">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";">The insert tab gives tones of other options of adding contents to the pages.<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpLast">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<h2>
<span style="background-color: cyan; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><i><u>7. To add links of different sections on one page</u></i></span></h2>
</div>
<div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;">One can add links of different section on one page as follows</span><o:p></o:p></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRFLysBVT4ZNaC0FrYIfIEPcBsi7JOkSAZkbbqdO6uG-ScU30zxgInJbCiQC5dXLypziw-ThVezFsDmRUFtXp-SMwqiStfHK5Sp5LqgxJGg1Q6bcyU1U-Lbd6hKufA47xiCz1lj8QzHZU/s1600/16.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: Georgia, Times New Roman, serif;"><img border="0" height="440" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRFLysBVT4ZNaC0FrYIfIEPcBsi7JOkSAZkbbqdO6uG-ScU30zxgInJbCiQC5dXLypziw-ThVezFsDmRUFtXp-SMwqiStfHK5Sp5LqgxJGg1Q6bcyU1U-Lbd6hKufA47xiCz1lj8QzHZU/s640/16.jpg" width="640" /></span></a></div>
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiH8vpNhJYgObOmCP9lI6exl2K_HYJ4FU36K5xqyIzK2rL6DNH4knKli1xuEtPd1QmbR06LWm8xIfgG8zsNt0aNB3T8VhphCGq69Re4OijfUb8fvZp1xLUIthrcKKEFsW4rnyixRI9RHjA/s1600/18.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: Georgia, Times New Roman, serif;"><img border="0" height="222" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiH8vpNhJYgObOmCP9lI6exl2K_HYJ4FU36K5xqyIzK2rL6DNH4knKli1xuEtPd1QmbR06LWm8xIfgG8zsNt0aNB3T8VhphCGq69Re4OijfUb8fvZp1xLUIthrcKKEFsW4rnyixRI9RHjA/s400/18.jpg" width="400" /></span></a></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><span style="color: #444444; font-family: "Georgia","serif"; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";">The screen clipping option under Insert tab provides a functionality similar to the sniping tool to capture screenshots on the fly while making notes.<o:p></o:p></span><span style="font-size: 12pt; line-height: 18.4px;">The record video option for insert is also a powerful functionality which is available in OneNote and cannot be performed in Word.</span></span></div>
<div class="MsoListParagraphCxSpLast">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<h2>
<span style="background-color: cyan; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><i><u>8. To add videos in OneNote</u></i></span></h2>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpZPEdATbM6KDew7wDO-ayX7339Cm7pB302ttusQUexs4X15OB3iUaSg2TdUa_C1Hmu8tOtqQRk27naXd1USXMEYcrUSvsl28vIPSNLh3_HiGnvM-rPy5RZA7yUpBbWxXcYVZUM7f5alg/s1600/20.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: Georgia, Times New Roman, serif;"><br /></span></a></div>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;">Go to Insert - > Record Video</span><br />
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDLUi8qBni5BhUwEMjg6hP-UdBNvNPI0kdSr0gb9hJcP3-qHAhtrnNZKrma8GLbZPZM1xUybU4FcqJUuLmquXKUswp0M0aWwezLH-4nt-G6KTRKyQOTSuZ6eJ5WB41Mn4Bqg95g-bmI2Y/s1600/19.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: Georgia, Times New Roman, serif;"><img border="0" height="115" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDLUi8qBni5BhUwEMjg6hP-UdBNvNPI0kdSr0gb9hJcP3-qHAhtrnNZKrma8GLbZPZM1xUybU4FcqJUuLmquXKUswp0M0aWwezLH-4nt-G6KTRKyQOTSuZ6eJ5WB41Mn4Bqg95g-bmI2Y/s640/19.jpg" width="640" /></span></a></div>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12pt; line-height: 18.4px;"><br /></span>
<br />
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";">Once video is recorded you will get the below screen</span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimI_yl87_qI18PpeXBlHZzwxb5CxcSeIL8tddSKB1rNQkUoIBOm-zfaIyMClkitcVvv748tPzkn0IZgcGGx64PVTs6Pu8Z1RlCxUzmIFjC1ZeQ0PCXn_Ef0AmrxKv156qFxmYThOnQxL8/s1600/20.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: Georgia, Times New Roman, serif;"><img border="0" height="315" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimI_yl87_qI18PpeXBlHZzwxb5CxcSeIL8tddSKB1rNQkUoIBOm-zfaIyMClkitcVvv748tPzkn0IZgcGGx64PVTs6Pu8Z1RlCxUzmIFjC1ZeQ0PCXn_Ef0AmrxKv156qFxmYThOnQxL8/s400/20.jpg" width="400" /></span></a></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;">One note automatically attaches the wmv file when email is selected</span><o:p></o:p></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNB-izEVMEUwT_j4ZgBB59xE8TwbsA9r3rkf5k_sFr43dXiNTFCXfQgiunDIiI6I1gLM5Y-FHKmFmlgXVejTgfLsTdmd5Ri9iyIq_MsbEKdbcg8dxaweQsoNqwoWmwMYi3fxacIBp8H30/s1600/21.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: Georgia, Times New Roman, serif;"><img border="0" height="440" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNB-izEVMEUwT_j4ZgBB59xE8TwbsA9r3rkf5k_sFr43dXiNTFCXfQgiunDIiI6I1gLM5Y-FHKmFmlgXVejTgfLsTdmd5Ri9iyIq_MsbEKdbcg8dxaweQsoNqwoWmwMYi3fxacIBp8H30/s640/21.jpg" width="640" /></span></a></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;">There are several other useful option under the Share, Draw, Review, View. There is also a Playback tab which will be enabled if you have recorded a video for OneNote.</span><o:p></o:p></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrv0rmnmCtAqJ_QV5rIFRP1EqqcbRiRjFbH_KtJOiDNV1XFF2iJPE_6tbYH_fIwqIOGIgZbvCeCFTjgSx8noQV88ZPF5ixtNxomRLKe0qDXNFZdjRGRPYwkC0QFoO6EcsWddPNC6K14MQ/s1600/25.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: Georgia, Times New Roman, serif;"><img border="0" height="70" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrv0rmnmCtAqJ_QV5rIFRP1EqqcbRiRjFbH_KtJOiDNV1XFF2iJPE_6tbYH_fIwqIOGIgZbvCeCFTjgSx8noQV88ZPF5ixtNxomRLKe0qDXNFZdjRGRPYwkC0QFoO6EcsWddPNC6K14MQ/s400/25.jpg" width="400" /></span></a></div>
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDLUi8qBni5BhUwEMjg6hP-UdBNvNPI0kdSr0gb9hJcP3-qHAhtrnNZKrma8GLbZPZM1xUybU4FcqJUuLmquXKUswp0M0aWwezLH-4nt-G6KTRKyQOTSuZ6eJ5WB41Mn4Bqg95g-bmI2Y/s1600/19.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: Georgia, Times New Roman, serif;"><img border="0" height="72" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDLUi8qBni5BhUwEMjg6hP-UdBNvNPI0kdSr0gb9hJcP3-qHAhtrnNZKrma8GLbZPZM1xUybU4FcqJUuLmquXKUswp0M0aWwezLH-4nt-G6KTRKyQOTSuZ6eJ5WB41Mn4Bqg95g-bmI2Y/s400/19.jpg" width="400" /></span></a></div>
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiS-mqrw4HzydZ1emRTTNDuq2DQQh11e3pJeIGkubbKuQt6Bwh_bVisKmY2btusf7ImPNRpI9VZEdGY2leXLGKr8iRX4pxzYYTeUQ-sQl32lrHoT9xa8Txc1-MXk1NHYdzMCyYeWzA9zwo/s1600/22.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: Georgia, Times New Roman, serif;"><img border="0" height="100" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiS-mqrw4HzydZ1emRTTNDuq2DQQh11e3pJeIGkubbKuQt6Bwh_bVisKmY2btusf7ImPNRpI9VZEdGY2leXLGKr8iRX4pxzYYTeUQ-sQl32lrHoT9xa8Txc1-MXk1NHYdzMCyYeWzA9zwo/s400/22.jpg" width="400" /></span></a></div>
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9rsC5bSnd0n_E4t5ehB2Jy3ySrDsxwvZfOONxVjDjyptttPJxrmwLnudW-VbnxSzTWJzOSutmHPcEM7q4BMglmkFclSjuPoC5kvogWm8t0FB9QKx4yHMjCRe8l6yjQfQqGYG6RE709SQ/s1600/23.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: Georgia, Times New Roman, serif;"><img border="0" height="60" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9rsC5bSnd0n_E4t5ehB2Jy3ySrDsxwvZfOONxVjDjyptttPJxrmwLnudW-VbnxSzTWJzOSutmHPcEM7q4BMglmkFclSjuPoC5kvogWm8t0FB9QKx4yHMjCRe8l6yjQfQqGYG6RE709SQ/s400/23.jpg" width="400" /></span></a></div>
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUGbC6hcPlYV5rrAz-4z6ngMPW8B1yCN7Vg7egXO8z0tUNoojFI2Nc_XO-XNteBned5Uks0IYYLt1KCo7d7btpd3CbQRpGqnLZ4tHDo_zgzCDVO8tU1aYCyF-KdIwDv042dd9uBYEx9eE/s1600/24.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: Georgia, Times New Roman, serif;"><img border="0" height="106" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUGbC6hcPlYV5rrAz-4z6ngMPW8B1yCN7Vg7egXO8z0tUNoojFI2Nc_XO-XNteBned5Uks0IYYLt1KCo7d7btpd3CbQRpGqnLZ4tHDo_zgzCDVO8tU1aYCyF-KdIwDv042dd9uBYEx9eE/s400/24.jpg" width="400" /></span></a></div>
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7JnizTpZe-9NWa5p5wbWrWvZOWEycbuPUZFM-ha4G4e0mnKXF97HvQFXgl0NsqCK-519B5ofUecJOf6Xm3KnXJJ7WwXP3KQBG1t3KiQezLbodJ490iwrd8taizdYT-7zf0xnL_rkzKJ4/s1600/26.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: Georgia, Times New Roman, serif;"><img border="0" height="76" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7JnizTpZe-9NWa5p5wbWrWvZOWEycbuPUZFM-ha4G4e0mnKXF97HvQFXgl0NsqCK-519B5ofUecJOf6Xm3KnXJJ7WwXP3KQBG1t3KiQezLbodJ490iwrd8taizdYT-7zf0xnL_rkzKJ4/s400/26.jpg" width="400" /></span></a></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraph">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraphCxSpFirst">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";">You may explore each tab and options to learn more. Microsoft provides helpful links to work with OneNote in case you are stuck on how to perform a certain tasks.<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoListParagraphCxSpMiddle">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444; text-decoration: none; text-underline: none;"><a href="https://support.office.com/en-us/article/Office-Training-Center-b8f02f81-ec85-4493-a39b-4c48e6bc4bfb">https://support.office.com/en-us/article/Office-Training-Center-b8f02f81-ec85-4493-a39b-4c48e6bc4bfb</a></span><o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoListParagraphCxSpMiddle">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444; text-decoration: none; text-underline: none;"><a href="https://support.office.com/en-us/article/Work-together-in-a-shared-notebook-823abe9b-8c8f-46f5-86c0-6ea4491cfd5b?ui=en-US&rs=en-US&ad=US">https://support.office.com/en-us/article/Work-together-in-a-shared-notebook-823abe9b-8c8f-46f5-86c0-6ea4491cfd5b?ui=en-US&rs=en-US&ad=US#</a></span><o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoListParagraph">
</div>
<div class="MsoListParagraphCxSpLast">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 12.0pt; line-height: 115%; mso-fareast-font-family: "Times New Roman";">So keep exploring keep learning, keep having fun with this new tool.</span></div>
</div>
</div>
Krutihttp://www.blogger.com/profile/13385897521211871375noreply@blogger.com3tag:blogger.com,1999:blog-8195522014866487394.post-32328536071224196092015-10-15T02:41:00.002-07:002016-01-05T05:29:11.653-08:00SQL server Encryption â Transact SQL Functions.<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
<span style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', serif; line-height: 17.75pt;">In the previous blogs we came across various
encrypt functions like </span><a href="http://msdn.microsoft.com/en-us/library/ms174361.aspx" style="background-color: white; font-family: Georgia, 'Times New Roman', serif; line-height: 17.75pt;" target="_blank"><span style="color: #0e5f8b; text-decoration: none;">ENCRYPTBYKEY</span></a><span style="background-color: white; color: #0e5f8b; font-family: Georgia, 'Times New Roman', serif; line-height: 17.75pt;">(),</span><a href="http://msdn.microsoft.com/en-us/library/ms186950.aspx" style="background-color: white; font-family: Georgia, 'Times New Roman', serif; line-height: 17.75pt;" target="_blank"><span style="color: #0e5f8b; text-decoration: none;">ENCRYPTBYASYMKEY</span></a><span style="background-color: white; color: #0e5f8b; font-family: Georgia, 'Times New Roman', serif; line-height: 17.75pt;">(),</span><a href="http://msdn.microsoft.com/en-us/library/ms188061.aspx" style="background-color: white; font-family: Georgia, 'Times New Roman', serif; line-height: 17.75pt;" target="_blank"><span style="color: #0e5f8b; text-decoration: none;">ENCRYPTBYCERT</span></a><span style="background-color: white; color: #0e5f8b; font-family: Georgia, 'Times New Roman', serif; line-height: 17.75pt;">()</span><span style="background-color: white; font-family: Georgia, 'Times New Roman', serif; line-height: 17.75pt;">.</span></div>
<div class="MsoNormal" style="background: white; line-height: 17.75pt; margin: 12pt 0cm; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;">We also saw the corresponding decrypt functions like<span style="color: #333333;"> </span><a href="http://msdn.microsoft.com/en-us/library/ms181860.aspx" target="_blank"><span style="color: #0e5f8b; text-decoration: none;">DECRYPTBYKEY</span></a><span style="color: #0e5f8b;">(),</span><a href="http://msdn.microsoft.com/en-us/library/ms178601.aspx" target="_blank"><span style="color: #0e5f8b; text-decoration: none;">DECRYPTBYCERT</span></a><span style="color: #0e5f8b;">(),</span><a href="http://msdn.microsoft.com/en-us/library/ms189507.aspx" target="_blank"><span style="color: #0e5f8b; text-decoration: none;">DECRYPTBYASYMKEY</span></a><span style="color: #0e5f8b;">(),</span><a href="http://msdn.microsoft.com/en-us/library/ms178601.aspx" target="_blank"><span style="color: #0e5f8b; text-decoration: none;">DECRYPTBYCERT</span></a><span style="color: #0e5f8b;">(),</span>
<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: 17.75pt; margin: 12pt 0cm; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;">We shall be covering a few more in this blog <o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 17.75pt; margin: 12pt 0cm; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="background-color: cyan; text-decoration: none;"><b><i>1) ENCRYPTBYPASSPHRASE</i></b></span><b><i style="background-color: cyan;">() </i></b><span style="background-color: white; color: #0e5f8b;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background: white; line-height: 17.75pt; margin: 12pt 0cm; text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">This function accepts the data of nvarchar
type and after encryption the data is returned in the varbinary format<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: 17.75pt; margin: 12pt 0cm; text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Syntax :<a href="https://msdn.microsoft.com/en-us/library/ms190357.aspx"> https://msdn.microsoft.com/en-us/library/ms190357.aspx</a><o:p></o:p></span></div>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">You could look up the syntax and arguments on the Microsoft website. @passphrase & @cleartext are the mandate arguments. The passphrase is an important argument here. Until now all the functions we have seen require an alphanumeric password for either the keys or the certificates that we created. In scenarios where we do not wish to implement the windows policy of password rather we go for a phrase that will be used for encryption this function comes in handy. After all we are good with mnemonics like âMy very educated mother just showed us nine planets â .... rather than recalling planets like this<br /><br />Planet 1 = Mercury <br /><br />Planet 2 = Venus<br /><br />and so on so forth.</span><br />
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span>
<br />
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 17.75pt; margin: 12pt 0cm; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><b><i style="background-color: cyan;"><span style="text-decoration: none;">2) DECRYPTBYPASSPHRASE</span>()</i></b><span style="background-color: white;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background: white; line-height: 17.75pt; margin: 12pt 0cm; text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">This fucntions access the varbinary encrypted data that
was derived from <a href="http://msdn.microsoft.com/en-us/library/ms190357.aspx" target="_blank"><span style="text-decoration: none;">ENCRYPTBYPASSPHRASE</span></a>() function. And when the same phrase is
passed the data is decrypted in the nvarchar form.<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: 17.75pt; margin: 12pt 0cm; text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Syntax : <a href="https://msdn.microsoft.com/en-us/library/ms188910.aspx">https://msdn.microsoft.com/en-us/library/ms188910.aspx</a><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: 17.75pt; margin: 12pt 0cm; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;">Not much of rocket
science required here to use this function. Itâs similar to DECRYPTBYKEY() or
DECRYPTBYCERT() function. We are however spared from opening any certificates
or keys, rather we just recall the phrase that we used. Simple enough just like <a href="http://msdn.microsoft.com/en-us/library/ms190357.aspx" target="_blank"><span style="text-decoration: none;">ENCRYPTBYPASSPHRASE</span></a>() function's the mandate arguments are
first 2. </span><span lang="EN"><span style="color: #444444;">@passphrase
& @ciphertext.</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background: white; line-height: 17.75pt; margin: 12pt 0cm; text-align: left;">
<span lang="EN"><span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;">Letâs see this with a use of example</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;">USE</span> TESTDB<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;">GO</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;">DECLARE</span> @DATAforENCRYPTION <span style="color: blue;">NVARCHAR</span><span style="color: grey;">(</span>4000<span style="color: grey;">)</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;">DECLARE</span> @ENCRYPTEDdata <span style="color: blue;">VARBINARY</span><span style="color: grey;">(</span>8000<span style="color: grey;">)</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;">DECLARE</span> @PHRASE <span style="color: blue;">VARCHAR</span><span style="color: grey;">(</span><span style="color: magenta;">MAX</span><span style="color: grey;">)</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;">DECLARE</span> @DECRYPTEDdata <span style="color: blue;">NVARCHAR</span><span style="color: grey;">(</span>4000<span style="color: grey;">)</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;">SET</span> @DATAforENCRYPTION <span style="color: grey;">=</span> <span style="color: red;">'SECRET CODES ARE NEVER REVEILED'</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;">SET</span> @PHRASE <span style="color: grey;">=</span> <span style="color: red;">'ILL ACT AS THE ENCRYPTING KEY'</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;">SET</span> @ENCRYPTEDdata <span style="color: grey;">=</span> <span style="color: magenta;">ENCRYPTBYPASSPHRASE</span><span style="color: grey;">(</span>@PHRASE<span style="color: grey;">,</span>@DATAforENCRYPTION<span style="color: grey;">)</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"> <span style="color: blue;">PRINT</span> <span style="color: red;">'DATA AFTER ENCRYPTION
IN VARBINARY FORM'</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"> <span style="color: blue;">PRINT</span> @ENCRYPTEDdata<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;">SET</span> @DECRYPTEDdata <span style="color: grey;">=</span> <span style="color: magenta;">DECRYPTBYPASSPHRASE</span><span style="color: grey;">(</span>@PHRASE<span style="color: grey;">,</span>@ENCRYPTEDdata<span style="color: grey;">)</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"> <span style="color: blue;">PRINT</span> <span style="color: red;">'DATA AFTER ENCRYPTION
IN NVARCHAR FORM AGAIN'</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"> <span style="color: blue;">PRINT</span> @DECRYPTEDdata<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<br /></div>
<div class="MsoNormal" style="background: white; line-height: 17.75pt; margin: 12pt 0cm; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;">The only drawback
here is if you know the location or column within the table where data is
encrypted and stored and if someone gets hold of your passphrase.....; well nothing
more is left to decrypt then. Often you may want to club this with TDE.</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: 17.75pt; margin: 12pt 0cm; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;">That leaves us
with an explanation of 2 functions</span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin: 12pt 0cm; text-align: left; text-indent: 0px;">
<b><i style="background-color: cyan;"><span style="font-family: Georgia, 'Times New Roman', serif; text-indent: -18pt;"><span style="font-stretch: normal; line-height: 23.6667px;">3) </span><span style="font-stretch: normal; line-height: normal;"> </span></span><span style="text-decoration: none;">DECRYPTBYKEYAUTOASYMKEY</span><span style="font-family: Georgia, 'Times New Roman', serif; line-height: 17.75pt; text-indent: -18pt;">()</span></i></b></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin: 12pt 0cm; text-align: left; text-indent: 0px;">
<span style="font-family: Georgia, Times New Roman, serif;">Syntax: <a href="https://msdn.microsoft.com/en-us/library/ms365420.aspx"><span style="color: blue;">h</span><span style="background-color: white; line-height: 17.75pt; text-indent: -24px;">ttps://msdn.microsoft.com/en-us/library/ms365420.aspx</span></a></span></div>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">This function is used to decrypt data that is encrypted using symmetric keys which in turn is protected by an asymmetric key. </span><br />
<div>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Its combines the functionality of code segments OPEN SYMMETRIC KEY & DecryptByKey() in one function <a href="http://msdn.microsoft.com/en-us/library/ms365420.aspx">DECRYPTBYKEYAUTOASYMKEY</a>()</span><br />
<div>
<br /></div>
<div>
<i><b style="background-color: cyan;"><span style="font-family: Georgia, 'Times New Roman', serif; line-height: 17.75pt; text-decoration: none;">4) DECRYPTBYKEYAUTOCERT</span><span style="font-family: Georgia, 'Times New Roman', serif; line-height: 17.75pt;">().</span></b></i></div>
<div>
<span style="background-color: white; color: #0e5f8b; font-family: Georgia, 'Times New Roman', serif; line-height: 17.75pt;"><br /></span></div>
<div>
<span style="background-color: white; color: #0e5f8b; font-family: Georgia, 'Times New Roman', serif; line-height: 17.75pt;">Syntax: </span><a href="https://msdn.microsoft.com/en-us/library/ms182559.aspx" style="background-color: white; font-family: Georgia, 'Times New Roman', serif; line-height: 17.75pt;">https://msdn.microsoft.com/en-us/library/ms182559.asp</a> </div>
<div>
<span style="background-color: white; color: #0e5f8b; font-family: Georgia, 'Times New Roman', serif; line-height: 17.75pt; text-indent: -18pt;"><br /></span></div>
<div>
<span style="background-color: white; font-family: Georgia, 'Times New Roman', serif; line-height: 17.75pt; text-indent: -18pt;"><span style="color: #444444;">This
function is used to decrypt data that is encrypted using symmetric keys which
in turn is protected by certificate. </span></span></div>
<div>
<span style="color: #444444;"><span style="background-color: white; font-family: Georgia, 'Times New Roman', serif; line-height: 17.75pt; text-indent: -18pt;">Its combines the functionality of code
segments </span><span lang="EN" style="background-color: white; font-family: Georgia, 'Times New Roman', serif; line-height: 17.75pt; text-indent: -18pt;">OPEN SYMMETRIC KEY &
DecryptByKey() in one function </span><a href="http://msdn.microsoft.com/en-us/library/ms182559.aspx" style="background-color: white; font-family: Georgia, 'Times New Roman', serif; line-height: 17.75pt; text-indent: -18pt;" target="_blank"><span style="text-decoration: none;">DECRYPTBYKEYAUTOCERT</span></a><span style="background-color: white; font-family: Georgia, 'Times New Roman', serif; line-height: 17.75pt; text-indent: -18pt;">().</span></span></div>
<div>
<span style="background-color: white; font-family: Georgia, 'Times New Roman', serif; line-height: 17.75pt;"><br /></span></div>
<div>
<span style="background-color: white; font-family: Georgia, 'Times New Roman', serif; line-height: 17.75pt;">None other than MVP K Brian Kelly has already described
them beautifully in the below blogs.</span><br />
<div class="MsoNormal" style="background: white; line-height: 17.75pt; margin: 12pt 0cm; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><a href="https://www.mssqltips.com/sqlservertip/3081/using-views-to-expose-encrypted-data-in-sql-server/">https://www.mssqltips.com/sqlservertip/3081/using-views-to-expose-encrypted-data-in-sql-server/</a><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: 17.75pt; margin: 12pt 0cm; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><a href="https://www.mssqltips.com/sqlservertip/1760/using-authenticators-with-sql-server-encryption/">https://www.mssqltips.com/sqlservertip/1760/using-authenticators-with-sql-server-encryption/</a><o:p></o:p></span></div>
<div style="text-align: left;">
</div>
<div class="MsoNormal" style="text-align: left;">
<o:p><span style="font-family: Georgia, Times New Roman, serif;"> I'd suggest you refer to them once. </span></o:p></div>
<div class="MsoNormal" style="text-align: left;">
<o:p><span style="font-family: Georgia, Times New Roman, serif;"><br /></span></o:p></div>
<div class="MsoNormal" style="text-align: left;">
<o:p><span style="font-family: Georgia, Times New Roman, serif;">This being the last blog for this series covers the 5 techniques to encrypt data within SQL server. However that's not all. Its the responsibility of the person encrypting the data to ensure the keys, certificates are backed up accordingly and in a timely fashion. Just like stored procedures and tables access will have to be granted for users to view the encrypted data or decrypt the data. The very sound mechanism provided by SQL server to protect data can become a nuisance if access is not granted wisely and keys or certificates are lost during decrypt or restore operations.</span></o:p></div>
<div class="MsoNormal" style="text-align: left;">
<o:p><span style="font-family: Georgia, Times New Roman, serif;"><br /></span></o:p></div>
</div>
</div>
</div>
Krutihttp://www.blogger.com/profile/13385897521211871375noreply@blogger.com0tag:blogger.com,1999:blog-8195522014866487394.post-7063295800647976772015-10-13T02:50:00.001-07:002016-01-05T05:29:22.734-08:00SQL server Encryption â Transparent Data Encryption<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal">
<span style="font-family: Georgia, Times New Roman, serif;">In the previous blogs we saw the use of certificates to
encapsulate symmetric keys. How it benefits the user by maintaining the
password rather than user having to mention it every time a key is opened for
use.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Georgia, Times New Roman, serif;">In all the above methods we are protecting data at a
granular level like tables and columns. </span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><a href="http://sqlandmorewithkruti.blogspot.co.uk/2015/10/sql-server-encryption-certificates.html">http://sqlandmorewithkruti.blogspot.co.uk/2015/10/sql-server-encryption-certificates.html</a></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">What if we wish to protect data at the
higher level? Letâs say no one should be
able to see any data in my database until I authorize to do so. I wish to
protect all my data which implies all the data that resides in my database
files and log files. From SQL server 2008 this functionality was provided through Transparent Data Encryption. As per definition by Microsoft, TDE<span lang="EN"> performs real-time I/O encryption and decryption
of the data and log files. The encryption uses a database encryption key (DEK),
which is stored in the database boot record for availability during recovery.<o:p></o:p></span></span></div>
<div class="MsoNormal">
<span lang="EN"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></span></div>
<div class="MsoNormal">
<span lang="EN"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Isnât it amazing
even if accidentally someone were to get access to the data and log files they
would be able to attach the database and view the information. Or letâs say
they get access to the backup files they still wouldnât get the data by a
normal restore operation. <o:p></o:p></span></span></div>
<br />
<div class="MsoNormal">
<span lang="EN"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">The encryption of
files and decryption happens by SQL server in memory. The data at rest is
cipher text. It does impact the performance while these operations are
performed in memory. Pages are first decrypted and then the data is provided to
the receiving client.</span><o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: left;">
<span lang="EN"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></span></div>
<div class="MsoNormal" style="text-align: left;">
<span lang="EN"><span style="font-family: Georgia, Times New Roman, serif;"><b><i style="background-color: cyan;">How it happens</i></b><o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: left;">
<span lang="EN"><span style="font-family: Georgia, Times New Roman, serif;"><b><i style="background-color: cyan;"><br /></i></b></span></span></div>
<div class="MsoListParagraphCxSpFirst" style="text-align: left; text-indent: -18pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN"><i><b>1)<span style="font-stretch: normal;"> </span></b></i></span><span lang="EN"><i><b>CREATE
MASTER KEY</b></i><o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-bottom: 0.0001pt; text-align: left;">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">USE</span><span lang="EN-US">
<span style="color: teal;">TESTDB</span><span style="color: grey;">;</span><o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">GO</span><span lang="EN-US"><o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">CREATE</span><span lang="EN-US">
<span style="color: blue;">MASTER</span> <span style="color: blue;">KEY</span> <span style="color: blue;">ENCRYPTION</span> <span style="color: blue;">BY</span> <span style="color: blue;">PASSWORD</span> <span style="color: grey;">=</span> <span style="color: red;">'1211!pwD##'</span><span style="color: grey;">;</span><o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-bottom: 0.0001pt; text-align: left;">
<span lang="EN-US" style="color: blue;"><span style="font-family: Georgia, Times New Roman, serif;">GO<o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpMiddle" style="text-align: left;">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="text-align: left; text-indent: -18pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN"><i><b>2) </b></i></span><span lang="EN"><i><b>CREATE
CERTIFICATE</b></i><o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpMiddle" style="text-align: left;">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">CREATE CERTIFICATE</span><span lang="EN-US"> </span><span lang="EN-US" style="color: teal; mso-ansi-language: EN-US; mso-bidi-font-family: Consolas; mso-bidi-font-size: 10.0pt;">TestCertificate</span><o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;"> <span lang="EN-US">WITH SUBJECT</span></span><span lang="EN-US"> </span><span style="color: grey;">=</span> <span style="color: red;">'For TDE for TESTDBâ</span><span style="color: grey;">,</span><o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="color: blue;"><span style="font-family: Georgia, Times New Roman, serif;"> GO<o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpMiddle" style="text-align: left;">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="text-align: left; text-indent: -18pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN"><i><b>3) </b></i></span><span lang="EN"><i><b>CREATE
DATABASE ENCRYPTION KEY</b></i><o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpLast" style="text-align: left;">
<span lang="EN"><span style="font-family: Georgia, Times New Roman, serif;"> </span></span></div>
<div class="MsoListParagraphCxSpLast" style="text-align: left;">
<span style="color: blue; font-family: Georgia, 'Times New Roman', serif; text-indent: 36pt;">CREATE</span><span style="font-family: Georgia, 'Times New Roman', serif; text-indent: 36pt;"> </span><span style="color: blue; font-family: Georgia, 'Times New Roman', serif; text-indent: 36pt;">DATABASE</span><span style="font-family: Georgia, 'Times New Roman', serif; text-indent: 36pt;"> </span><span style="color: blue; font-family: Georgia, 'Times New Roman', serif; text-indent: 36pt;">ENCRYPTION</span><span style="font-family: Georgia, 'Times New Roman', serif; text-indent: 36pt;"> </span><span style="color: blue; font-family: Georgia, 'Times New Roman', serif; text-indent: 36pt;">KEY</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;">WITH</span> <span style="color: blue;">ALGORITHM</span>
<span style="color: grey;">=</span> <span style="color: blue;">AES_128</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;">ENCRYPTION</span> <span style="color: blue;">BY</span> <span style="color: blue;">SERVER</span> <span style="color: blue;">CERTIFICATE</span> <span lang="EN-US" style="color: teal; mso-ansi-language: EN-US; mso-bidi-font-family: Consolas; mso-bidi-font-size: 10.0pt;">TestCertificate</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"> G<span style="color: blue;">O</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<br /></div>
<div class="MsoListParagraphCxSpFirst" style="text-align: left;">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="text-align: left; text-indent: -18pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN"><i><b>4) </b></i></span><span lang="EN"><i><b>ALTER
DATABASE SET ENCRYPTION ON</b></i><o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpMiddle" style="text-align: left;">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;">ALTER</span> <span style="color: blue;">DATABASE</span>
<span lang="EN-US" style="color: teal;">TESTDB</span><o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;">SET</span> <span style="color: blue;">ENCRYPTION</span>
<span style="color: blue;">ON</span><o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;">GO</span><o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-bottom: 0.0001pt; text-align: left;">
<br /></div>
<div class="MsoListParagraphCxSpLast">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN">
</span></div>
<div class="MsoNormal">
<br /></div>
</div>
Krutihttp://www.blogger.com/profile/13385897521211871375noreply@blogger.com5tag:blogger.com,1999:blog-8195522014866487394.post-18837019388657800112015-10-10T02:55:00.000-07:002016-01-05T05:29:37.625-08:00SQL server encryption â Certificates<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNoSpacing">
<span style="font-family: Georgia, Times New Roman, serif;">In the
previous blogs we saw how to encrypt data using symmetric and asymmetric keys. <o:p></o:p></span></div>
<div class="MsoNoSpacing">
<span style="font-family: Georgia, Times New Roman, serif;">We saw how to
use functions like <a href="http://msdn.microsoft.com/en-us/library/ms174361.aspx" target="_blank"><span style="color: #0e5f8b; text-decoration: none;">ENCRYPTBYKEY</span></a>, <a href="http://msdn.microsoft.com/en-us/library/ms181860.aspx" target="_blank"><span style="color: #0e5f8b; text-decoration: none;">DECRYPTBYKEY</span></a><span style="color: #0e5f8b;"> & </span><a href="http://msdn.microsoft.com/en-us/library/ms186950.aspx" target="_blank"><span style="color: #0e5f8b; text-decoration: none;">ENCRYPTBYASYMKEY</span></a><span style="color: #0e5f8b;">,</span><a href="http://msdn.microsoft.com/en-us/library/ms189507.aspx" target="_blank"><span style="color: #0e5f8b; text-decoration: none;">DECRYPTBYASYMKEY</span></a><span style="color: #0e5f8b;">.<o:p></o:p></span></span></div>
<div class="MsoNoSpacing">
<span style="color: #0e5f8b;"><span style="font-family: Georgia, Times New Roman, serif;"><br /></span></span></div>
<div class="MsoNoSpacing">
<a href="http://sqlandmorewithkruti.blogspot.com/2015/10/sql-server-encryption-symmetric-keys.html" style="background-color: #eefff9; color: #888888; line-height: 18.4px; text-decoration: none;"><span style="font-family: Georgia, Times New Roman, serif;">http://sqlandmorewithkruti.blogspot.com/2015/10/sql-server-encryption-symmetric-keys.html</span></a></div>
<div class="MsoNoSpacing">
<a href="http://sqlandmorewithkruti.blogspot.com/2015/10/sql-server-encryption-symmetric-keys.html" style="background-color: #eefff9; color: #888888; line-height: 18.4px; text-decoration: none;"><span style="font-family: Georgia, Times New Roman, serif;">http://sqlandmorewithkruti.blogspot.com/2015/10/sql-server-encryption-asymmetric-keys.html</span></a></div>
<div class="MsoNoSpacing">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNoSpacing" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Its important to note that while using these functions we need to ensure the
password is included correctly. This involves a risk.In-case we lose the
password, the keys render useless. Apart from this the password would have to be
maintained in case of changes. <o:p></o:p></span></div>
<div class="MsoNoSpacing" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"> In this blog
we shall see something similar but with the use of SQL server certificates.</span></div>
<div class="MsoNoSpacing" style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;">Certificates
encapsulate data like password, user information, validity,etc. Their prime
benefit is <span lang="EN">relieving the
hosts of the need to maintain a set of passwords for individual subjects.</span></span><o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoListParagraphCxSpFirst" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l2 level1 lfo1; text-indent: -18.0pt;">
<!--[if !supportLists]--><span style="font-family: Georgia, Times New Roman, serif;"><b><i><span style="line-height: 115%;">1) </span><span style="line-height: 115%;">Create Database Master Key<o:p></o:p></span></i></b></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l2 level1 lfo1; text-indent: -18.0pt;">
<!--[if !supportLists]--><span style="font-family: Georgia, Times New Roman, serif;"><b><i><span style="line-height: 115%;">2)<span style="font-stretch: normal; line-height: normal;"> </span></span><span style="line-height: 115%;">Create Certificate<o:p></o:p></span></i></b></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l2 level1 lfo1; text-indent: -18.0pt;">
<!--[if !supportLists]--><span style="font-family: Georgia, Times New Roman, serif;"><b><i><span style="line-height: 115%;">3)<span style="font-stretch: normal; line-height: normal;"> </span></span><span style="line-height: 115%;">Create Key using Certificate</span></i></b></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l2 level1 lfo1; text-indent: -18.0pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="line-height: 115%;"><b><i>4) Encrypt Data</i></b></span></span></div>
<ul style="text-align: left;">
<li><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Open Key</span></li>
<li><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Encrypt Data</span></li>
<li><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Close Key</span></li>
</ul>
<div class="MsoNormal">
<span style="line-height: 115%;"><span style="font-family: Georgia, Times New Roman, serif;"><b><i>5) Using EncryptByCert(),
DecryptByCert() Functions</i></b><o:p></o:p></span></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoListParagraphCxSpFirst" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l1 level1 lfo3; text-indent: -18.0pt;">
<!--[if !supportLists]--><span style="font-family: Georgia, Times New Roman, serif;"><b><i style="background-color: cyan;"><span style="line-height: 115%;">1)<span style="font-stretch: normal; line-height: normal;"> </span></span></i></b><span style="line-height: 115%;"><b><i style="background-color: cyan;">Create Database Master Key</i></b><o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpFirst" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l1 level1 lfo3; text-indent: -18.0pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="line-height: 115%;"><b><i style="background-color: cyan;"><br /></i></b></span></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0cm 0cm 0.0001pt 18pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">USE</span><span lang="EN-US"> <span style="color: teal;">TESTDB</span><span style="color: grey;">;</span><o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0cm 0cm 0.0001pt 18pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">GO</span><span lang="EN-US"><o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0cm 0cm 0.0001pt 18pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">CREATE</span><span lang="EN-US"> <span style="color: blue;">MASTER</span> <span style="color: blue;">KEY</span> <span style="color: blue;">ENCRYPTION</span> <span style="color: blue;">BY</span> <span style="color: blue;">PASSWORD</span> <span style="color: grey;">=</span> </span><span style="color: red;">'456##456hhhh'</span><span lang="EN-US" style="color: grey;">;</span><span lang="EN-US"><o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0cm 0cm 0.0001pt 18pt;">
<span lang="EN-US" style="color: blue;"><span style="font-family: Georgia, Times New Roman, serif;">GO<o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto;">
<br /></div>
<div class="MsoListParagraphCxSpLast" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l1 level1 lfo3; text-indent: -18.0pt;">
<!--[if !supportLists]--><span style="font-family: Georgia, Times New Roman, serif;"><b><i style="background-color: cyan;"><span style="line-height: 115%;">2)</span> </i></b><span style="line-height: 115%;"><b><i style="background-color: cyan;">Create certificate</i></b><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Now we proceed with creating a ceritificate which will serve as our container for the key.</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Syntax : <a href="https://msdn.microsoft.com/en-us/library/ms187798.aspx">https://msdn.microsoft.com/en-us/library/ms187798.aspx</a></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;"> USE</span> <span style="color: #45818e;">TESTDB</span><span style="color: grey;">;</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;"> GO</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;"> CREATE</span> <span style="color: blue;">CERTIFICATE</span>
<span style="color: #45818e;">SymKeyCertificate </span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"> <span style="color: blue;">ENCRYPTION</span> <span style="color: blue;">BY</span> <span style="color: blue;">PASSWORD</span> <span style="color: grey;">=</span> <span style="color: red;">'456##456hhhh'</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"> <span style="color: blue;">WITH</span> <span style="color: blue;">SUBJECT</span> <span style="color: grey;">=</span> <span style="color: red;">'Symmetric Key Certificate'</span><span style="color: grey;">,</span> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"> <span style="color: blue;">EXPIRY_DATE</span> <span style="color: grey;">=</span> <span style="color: red;">'10/31/2020'</span><span style="color: grey;">;</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue;"><span style="font-family: Georgia, Times New Roman, serif;"> GO<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;">The reason we created a database master
key here is if we dint mention the password the certificate would be encrypted
by the DMK.</span><span style="color: blue;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l1 level1 lfo3; text-indent: -18.0pt;">
<!--[if !supportLists]--><span style="font-family: Georgia, Times New Roman, serif;"><b><i style="background-color: cyan;"><span style="line-height: 115%;">3)</span> </i></b><span style="line-height: 115%;"><b><i style="background-color: cyan;">Create symmetric key using certificate</i></b><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;"> CREATE</span> <span style="color: blue;">SYMMETRIC</span> <span style="color: blue;">KEY</span> <span style="color: #45818e;">SymKeyCertTest</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"> <span style="color: blue;">WITH</span> <span style="color: blue;">ALGORITHM</span> <span style="color: grey;">=</span> <span style="color: blue;">TRIPLE_DES</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"> <span style="color: blue;">ENCRYPTION</span> <span style="color: blue;">BY</span> <span style="color: blue;">CERTIFICATE</span><span style="color: #45818e;"> SymKeyCertificate</span><span style="color: grey;">;</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"> <span style="color: blue;">GO<o:p></o:p></span></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<span style="font-family: Georgia, Times New Roman, serif;">We shall be
using a different table structure this time <o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;"> USE</span><span style="color: #45818e;"> [TESTDB]</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;"> GO</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;"> SET</span> <span style="color: blue;">ANSI_NULLS</span> <span style="color: blue;">ON</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;"> GO</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"> </span><span style="color: blue; font-family: Georgia, 'Times New Roman', serif;"> SET</span><span style="font-family: Georgia, 'Times New Roman', serif;"> </span><span style="color: blue; font-family: Georgia, 'Times New Roman', serif;">QUOTED_IDENTIFIER</span><span style="font-family: Georgia, 'Times New Roman', serif;"> </span><span style="color: blue; font-family: Georgia, 'Times New Roman', serif;">ON</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;"> GO</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"> </span><span style="color: blue; font-family: Georgia, 'Times New Roman', serif;">SET</span><span style="font-family: Georgia, 'Times New Roman', serif;"> </span><span style="color: blue; font-family: Georgia, 'Times New Roman', serif;">ANSI_PADDING</span><span style="font-family: Georgia, 'Times New Roman', serif;"> </span><span style="color: blue; font-family: Georgia, 'Times New Roman', serif;">ON</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;"> GO</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;">CREATE</span> <span style="color: blue;">TABLE</span> [dbo]<span style="color: grey;">.</span>[CertificateDemo1]<span style="color: grey;">(</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"> [EmpId]
[int] <span style="color: grey;">NOT</span> <span style="color: grey;">NULL,</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"> [EmpName]
[nchar]<span style="color: grey;">(</span>50<span style="color: grey;">)</span> <span style="color: grey;">NULL,</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"> [EmpSal]
[varchar]<span style="color: grey;">(</span>10<span style="color: grey;">)</span> <span style="color: grey;">NOT</span> <span style="color: grey;">NULL</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: grey;">)</span> <span style="color: blue;">ON</span> [PRIMARY]<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;">Data is as follows</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<table border="0" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; margin-left: 4.65pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-yfti-tbllook: 1184; width: 300px;">
<tbody>
<tr style="height: 15.0pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0;">
<td nowrap="" style="background: yellow; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 48.0pt;" valign="top" width="64"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;">EmpId<o:p></o:p></span></div>
</td>
<td nowrap="" style="background: yellow; border-left: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 129.0pt;" valign="top" width="172"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;">EmpName<o:p></o:p></span></div>
</td>
<td nowrap="" style="background: yellow; border-left: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 48.0pt;" valign="top" width="64"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;">EmpSal<o:p></o:p></span></div>
</td>
</tr>
<tr style="height: 15.0pt; mso-yfti-irow: 1;">
<td nowrap="" style="border-top: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 48.0pt;" valign="top" width="64"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;">1<o:p></o:p></span></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 129.0pt;" valign="top" width="172"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;">abc
<o:p></o:p></span></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 48.0pt;" valign="top" width="64"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;">5000<o:p></o:p></span></div>
</td>
</tr>
<tr style="height: 15.0pt; mso-yfti-irow: 2;">
<td nowrap="" style="border-top: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 48.0pt;" valign="top" width="64"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;">2<o:p></o:p></span></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 129.0pt;" valign="top" width="172"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;">def
<o:p></o:p></span></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 48.0pt;" valign="top" width="64"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;">15000<o:p></o:p></span></div>
</td>
</tr>
<tr style="height: 15.0pt; mso-yfti-irow: 3; mso-yfti-lastrow: yes;">
<td nowrap="" style="border-top: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 48.0pt;" valign="top" width="64"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;">3<o:p></o:p></span></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 129.0pt;" valign="top" width="172"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;">hij
<o:p></o:p></span></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 48.0pt;" valign="top" width="64"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;">25000<o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b style="font-family: Georgia, 'Times New Roman', serif; line-height: 18.4px; text-indent: -24px;"><i style="background-color: cyan;">4) Encrypt Data</i></b></div>
<div class="MsoNoSpacing">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNoSpacing">
<span style="font-family: Georgia, Times New Roman, serif;">We shall be
encrypting and showing the data using the same functions for symmetric keys but
this time we skip mentioning the password instead we use certificates.<o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;">USE</span> <span style="color: #45818e;">TESTDB;</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;">GO</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; color: green; font-family: Georgia, 'Times New Roman', serif; font-size: 15.4px; line-height: 21.56px;">-- Create symmetric key using the certificate</span><span style="font-family: Georgia, Times New Roman, serif;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;">OPEN</span> <span style="color: blue;">SYMMETRIC</span> <span style="color: blue;">KEY</span> <span style="color: #45818e;">SymKeyCertTest</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;">DECRYPTION</span> <span style="color: blue;">BY</span> <span style="color: blue;">CERTIFICATE</span><span style="color: #45818e;"> SymKeyCertificate </span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; color: green; font-family: Georgia, 'Times New Roman', serif; font-size: 15.4px; line-height: 21.56px;">-- Encrypt the data</span><span style="background-color: #eefff9; color: #222222; font-family: Georgia, 'Times New Roman', serif; font-size: 15.4px; line-height: 21.56px;"><span style="color: blue;"> </span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;">GO</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;">SELECT</span><span style="color: #45818e;"> empID,empname,</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: magenta;">EncryptByKey</span><span style="color: grey;">(</span><span style="color: magenta;">Key_GUID</span><span style="color: grey;">(</span><span style="color: red;">'SymKeyCertTest'</span><span style="color: grey;">),</span> <span style="color: #45818e;">empsal</span><span style="color: grey;">)</span>
<span style="color: blue;">as</span> "Encrypted Salary"<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;">FROM</span><span style="color: #45818e;"> CertificateDemo1</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; color: green; font-family: Georgia, 'Times New Roman', serif; font-size: 15.4px; line-height: 21.56px;">--Close symmetric key</span><span style="background-color: #eefff9; color: #222222; font-family: Georgia, 'Times New Roman', serif; font-size: 15.4px; line-height: 21.56px;"><span style="color: blue;"> </span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;">GO</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;">CLOSE</span> <span style="color: blue;">SYMMETRIC</span> <span style="color: blue;">KEY</span> <span style="color: #45818e;">SymKeyCertTest</span><span style="color: grey;">;</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"> <o:p></o:p></span></div>
<div class="MsoNoSpacing">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;">Im leaving
the use of</span><span style="color: magenta;"> DecryptByKey() </span><span style="color: #444444;"> function here. You can try that on your own.</span><o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b style="font-family: Georgia, 'Times New Roman', serif; line-height: 18.4px;"><i style="background-color: cyan;">5) Using EncryptByCert(), DecryptByCert() Functions</i></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<span style="font-family: Georgia, Times New Roman, serif;">If one wishes
to use the certificate directly you can try the below options as well<o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<span style="font-family: Georgia, Times New Roman, serif;"><b><i>EncryptByCert() function</i></b><o:p></o:p></span></div>
<div class="MsoNoSpacing">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: magenta;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;">ALTER</span> <span style="color: blue;">TABLE</span> CertificateDemo1 <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;">ADD</span> certcolumn <span style="color: blue;">varbinary</span><span style="color: grey;">(</span><span style="color: magenta;">MAX</span><span style="color: grey;">)</span> <span style="color: grey;">NULL</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;">GO</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: magenta;">UPDATE</span> certificatedemo1<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;">SET</span> certcolumn <span style="color: grey;">=</span><span style="color: blue;"> </span><span style="color: grey;">(</span><span style="color: magenta;">EncryptByCert</span><span style="color: grey;">(</span><span style="color: magenta;">cert_id</span><span style="color: grey;">(</span><span style="color: red;">'SymKeyCertTes'</span><span style="color: grey;">),</span>empsal<span style="color: grey;">))</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNoSpacing">
<span style="font-family: Georgia, Times New Roman, serif;"><b><i>DecryptByCert() function</i></b><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;">SELECT</span> empid<span style="color: grey;">,</span>empname<span style="color: grey;">,</span><span style="color: magenta;">convert</span><span style="color: grey;">(</span><span style="color: blue;">varchar</span><span style="color: grey;">(</span><span style="color: magenta;">max</span><span style="color: grey;">),</span> <span style="color: magenta;">DecryptByCert</span><span style="color: grey;">(</span><span style="color: magenta;">cert_id</span><span style="color: grey;">(</span><span style="color: red;">'SymKeyCertTesT'</span><span style="color: grey;">),</span>empsal<span style="color: grey;">,</span><span style="color: red;">'</span></span><span style="color: red; font-family: Georgia, 'Times New Roman', serif;">456##456hhhh</span><span style="font-family: Georgia, Times New Roman, serif;"><span style="color: red;">'</span><span style="color: grey;">)</span> <span style="color: blue;">as</span> "decrypted salary"<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;">FROM</span> certificatedemo1<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;">Its that simple. In the next blog we see how to use the Transparent Data Encryption Technique</span></div>
<br />
<div class="MsoNoSpacing">
<br /></div>
</div>
Krutihttp://www.blogger.com/profile/13385897521211871375noreply@blogger.com0tag:blogger.com,1999:blog-8195522014866487394.post-22731879384283124692015-10-10T02:15:00.002-07:002016-01-05T05:29:52.193-08:00SQL server encryption â Asymmetric Keys<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal">
<span style="font-family: Georgia, serif; line-height: 115%;">In the previous blog we learnt about symmetric key
encryption. We also learnt through an example how data is stored in varbinary form
after encryption and how the original text can be retrieve using the
corresponding decrypt function.</span></div>
<div class="MsoNormal">
<span style="font-family: Georgia, serif; line-height: 115%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: Georgia, serif;"><span style="line-height: 18.4px;"><a href="http://sqlandmorewithkruti.blogspot.com/2015/10/sql-server-encryption-symmetric-keys.html">http://sqlandmorewithkruti.blogspot.com/2015/10/sql-server-encryption-symmetric-keys.html</a></span></span></div>
<div class="MsoNormal">
<span style="font-family: Georgia, serif;"><span style="line-height: 18.4px;"><br /></span></span></div>
<div class="MsoNormal">
<span style="color: #444444;"><span style="font-family: Georgia, serif; line-height: 115%;">In this blog we will see something similar with
the same table structures using Asymmetric keys</span><span style="font-family: Georgia, serif; line-height: 115%;">As stated earlier Asymmetric keys consists of public keys
and private keys.</span><span style="font-family: Georgia, serif; line-height: 115%;">
Each key can decrypt data encrypted by the other.<span class="apple-converted-space"> This is a fairly resource intensive operation
as compared to Symmetric keys. This option may be chosen over the previous if
we need a higher degree of data protection.</span></span></span></div>
<div class="MsoNormal">
<i><b style="background-color: cyan;"><br /></b></i></div>
<div style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><i><b style="background-color: white;">1) Create Database Master Key </b></i></span></div>
<div style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><br /><b><i style="background-color: white;">2) Encrypt Data </i></b></span></div>
<ul style="text-align: left;">
<li><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Create Asymmetric Key</span></li>
<li><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Open Key</span></li>
<li><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Encrypt Data</span></li>
<li><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Close Key</span></li>
</ul>
<span style="font-family: Georgia, Times New Roman, serif;"><b><i style="background-color: white;">3) Decrypt Data</i></b></span><br />
<ul style="text-align: left;">
<li><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Open Key</span></li>
<li><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Dencrypt Data</span></li>
<li><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Close Key</span></li>
</ul>
<br />
<div>
<div class="MsoNormal" style="text-align: left;">
<span style="font-family: Georgia, serif; line-height: 115%;"><b><i style="background-color: cyan;">1) Create Database Master Key (DMK)</i></b><o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="font-family: Georgia, serif; line-height: 115%;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: blue;"> USE</span><span lang="EN-US"> <span style="color: teal;">TESTDB</span><span style="color: grey;">;</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: blue;"> GO</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: blue;"> CREATE</span><span lang="EN-US"> <span style="color: blue;">MASTER</span> <span style="color: blue;">KEY</span> <span style="color: blue;">ENCRYPTION</span> <span style="color: blue;">BY</span> <span style="color: blue;">PASSWORD</span> <span style="color: grey;">=</span> <span style="color: red;">'1211!pwD##'</span><span style="color: grey;">;</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: blue;"> GO<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Georgia, serif; line-height: 115%; text-indent: -18pt;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="background-color: cyan; font-family: Georgia, Times New Roman, serif;"><b><i><span style="line-height: 115%; text-indent: -18pt;">2)<span style="font-stretch: normal; line-height: normal;"> </span></span><span style="line-height: 115%; text-indent: -18pt;">Encrypt Data</span></i></b></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: Georgia, serif; line-height: 115%;"><span style="color: #444444;">I have a table with the below structure</span><o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin: 0cm 0cm 0.0001pt 27pt;">
<br /></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 9pt;">
<span lang="EN-US" style="color: blue;">CREATE</span><span lang="EN-US">
<span style="color: blue;">TABLE</span> <span style="color: teal;">[dbo]</span><span style="color: grey;">.</span><span style="color: teal;">[BankDemo1]</span><span style="color: grey;">(</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 9pt;">
<span lang="EN-US"> <span style="color: teal;">[BankID]</span> <span style="color: teal;">[tinyint]</span> <span style="color: grey;">NOT</span> <span style="color: grey;">NULL,</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 9pt;">
<span lang="EN-US"> <span style="color: teal;">[BankName]</span> <span style="color: teal;">[varchar]</span><span style="color: grey;">(</span>10<span style="color: grey;">)</span> <span style="color: grey;">NOT</span> <span style="color: grey;">NULL,</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"> </span><span lang="EN-US" style="color: teal; font-family: Consolas;">[BankAmt]</span><span lang="EN-US" style="font-family: Consolas;"> <span style="color: teal;">[varchar]</span><span style="color: grey;">(</span>10<span style="color: grey;">)</span> <span style="color: grey;">NOT</span> <span style="color: grey;">NULL,<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 9pt;">
<br /></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 9pt;">
<span lang="EN-US"> <span style="color: blue;">CONSTRAINT</span> <span style="color: teal;">[PK_BankDemo1]</span>
<span style="color: blue;">PRIMARY</span> <span style="color: blue;">KEY</span> <span style="color: blue;">CLUSTERED</span> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 9pt;">
<span lang="EN-US" style="color: grey;">(</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 9pt;">
<span lang="EN-US"> <span style="color: teal;">[BankID]</span> <span style="color: blue;">ASC</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 9pt;">
<span lang="EN-US" style="color: grey;">)</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 9pt;">
<span lang="EN-US" style="color: grey;">)</span><span lang="EN-US">
<span style="color: blue;">ON</span> <span style="color: teal;">[PRIMARY]</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 18pt;">
<br /></div>
<table border="0" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; margin-left: 72.0pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-yfti-tbllook: 1184; width: 212px;">
<tbody>
<tr style="height: 15.0pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0;">
<td nowrap="" style="background: yellow; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 48.0pt;" valign="top" width="64"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US">BankID<o:p></o:p></span></div>
</td>
<td nowrap="" style="background: yellow; border-left: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 59.5pt;" valign="top" width="79"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US">BankName<o:p></o:p></span></div>
</td>
<td nowrap="" style="background: yellow; border-left: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 51.7pt;" valign="top" width="69"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US">BankAmt<o:p></o:p></span></div>
</td>
</tr>
<tr style="height: 15.0pt; mso-yfti-irow: 1;">
<td nowrap="" style="border-top: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 48.0pt;" valign="top" width="64"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US">1<o:p></o:p></span></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 59.5pt;" valign="top" width="79"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US">abc<o:p></o:p></span></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 51.7pt;" valign="top" width="69"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US">1000<o:p></o:p></span></div>
</td>
</tr>
<tr style="height: 15.0pt; mso-yfti-irow: 2;">
<td nowrap="" style="border-top: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 48.0pt;" valign="top" width="64"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US">2<o:p></o:p></span></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 59.5pt;" valign="top" width="79"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US">def<o:p></o:p></span></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 51.7pt;" valign="top" width="69"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US">2000<o:p></o:p></span></div>
</td>
</tr>
<tr style="height: 15.0pt; mso-yfti-irow: 3; mso-yfti-lastrow: yes;">
<td nowrap="" style="border-top: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 48.0pt;" valign="top" width="64"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US">3<o:p></o:p></span></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 59.5pt;" valign="top" width="79"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US">hij<o:p></o:p></span></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 51.7pt;" valign="top" width="69"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US">3000<o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 36pt;">
<br /></div>
<div class="MsoNormal">
<span style="font-family: Georgia, serif; line-height: 115%;"><span style="color: #444444;">We shall be encrypting the [BankAmt] column. But the cipher
data generated during encryption can only be of type varbinary. So the first
step is for us to change the structure of the table.<o:p></o:p></span></span></div>
<div class="MsoListParagraph" style="margin: 0cm 0cm 0.0001pt;">
<span lang="EN-US"><span style="color: #444444;"><br /></span></span></div>
<div class="MsoListParagraph" style="margin: 0cm 0cm 0.0001pt;">
<span style="background-color: white;"><span lang="EN-US"><span style="color: #444444;"> </span></span><span lang="EN-US" style="color: blue; font-family: Georgia, 'Times New Roman', serif; font-size: 15.4px; line-height: 21.56px;">USE</span><span lang="EN-US" style="color: #222222; font-family: Georgia, 'Times New Roman', serif; font-size: 15.4px; line-height: 21.56px;"> <span style="color: teal;">TESTDB</span><span style="color: grey;">;</span></span></span></div>
<div class="MsoNormal" style="color: #222222; font-family: Georgia, Utopia, 'Palatino Linotype', Palatino, serif; font-size: 15.4px; line-height: 21.56px; margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: Georgia, 'Times New Roman', serif;"><span lang="EN-US" style="color: blue;"> GO</span><span lang="EN-US"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="color: #222222; font-family: Georgia, Utopia, 'Palatino Linotype', Palatino, serif; font-size: 15.4px; line-height: 21.56px; margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: Georgia, 'Times New Roman', serif;"><span lang="EN-US" style="color: blue;"> ALTER</span><span lang="EN-US"> <span style="color: blue;">TABLE</span> <span style="color: teal;">BankDemo1</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="color: #222222; font-family: Georgia, Utopia, 'Palatino Linotype', Palatino, serif; font-size: 15.4px; line-height: 21.56px; margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: Georgia, 'Times New Roman', serif;"><span lang="EN-US" style="color: blue;"> ADD</span><span lang="EN-US"> <span style="color: teal;">BankAmtAsymKey</span> <span style="color: blue;">varbinary</span><span style="color: grey;">(</span><span style="color: magenta;">MAX</span><span style="color: grey;">)</span> <span style="color: grey;">NULL</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="color: #222222; font-family: Georgia, Utopia, 'Palatino Linotype', Palatino, serif; font-size: 15.4px; line-height: 21.56px; margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, 'Times New Roman', serif;"><span lang="EN-US" style="background-color: white; color: blue;"> GO</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal">
<span style="font-family: Georgia, serif; line-height: 115%;"><span style="color: #444444;">Now that our table schema is modified we proceed with
creation of the asymmetric key</span><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Georgia, serif; line-height: 115%;"><span style="color: #444444;"><br /></span></span></div>
<div class="MsoNormal">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">Syntax : </span><a href="https://msdn.microsoft.com/en-us/library/ms174430.aspx"><span lang="EN-US">https://msdn.microsoft.com/en-us/library/ms174430.aspx</span></a></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US"> </span><span style="color: blue;">USE</span> <span lang="EN-US" style="color: teal;">TESTDB;</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;"> GO</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; color: green; font-family: Georgia, 'Times New Roman', serif; font-size: 15.4px; line-height: 21.56px;">-- Create symmetric key</span><span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;"> </span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;">CREATE</span> <span style="color: blue;">ASYMMETRIC</span> <span style="color: blue;">KEY</span> <span lang="EN-US" style="color: teal;">TestAsymmKey </span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;"> WITH</span> <span style="color: blue;">ALGORITHM</span> <span style="color: grey;">=</span> <span style="color: blue;">RSA_512</span> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue;"> ENCRYPTION</span> <span style="color: blue;">BY</span> <span style="color: blue;">PASSWORD</span> <span style="color: grey;">=</span> <span style="color: red;">'1211!pwD##'</span><span style="color: grey;">;</span> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue;"><span style="font-family: Georgia, Times New Roman, serif;"> GO</span></span><span style="font-family: Consolas; font-size: 9.5pt;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue;"><span style="font-family: Georgia, Times New Roman, serif;"><br /></span></span></div>
<div class="MsoNormal">
<span style="font-family: Georgia, serif; line-height: 115%;">Letâs do the trick!!!<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 36pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: blue; font-family: Consolas;">USE</span><span lang="EN-US" style="font-family: Consolas;">
<span style="color: teal;">TESTDB</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: blue; font-family: Consolas;">GO</span><span lang="EN-US" style="font-family: Consolas;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: blue; font-family: Consolas;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="background-color: white; color: blue; font-family: Consolas;"><span style="color: green; font-family: Georgia, 'Times New Roman', serif; font-size: 15.4px; line-height: 21.56px;">-- Open the asymmetric key</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: blue; font-family: Consolas;">OPEN</span><span lang="EN-US" style="font-family: Consolas;">
<span style="color: blue;">ASYMMETRIC</span> <span style="color: blue;">KEY</span> <span style="color: teal;">TestAsymmKey</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: blue; font-family: Consolas;">DECRYPTION</span><span lang="EN-US" style="font-family: Consolas;">
<span style="color: blue;">BY</span> <span style="color: blue;">PASSWORD</span> <span style="color: grey;">=</span> <span style="color: red;">'1211!pwD##'</span><span style="color: grey;">;</span> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: blue; font-family: Consolas;">GO<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: magenta; font-family: Consolas;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: magenta; font-family: Consolas;"><span style="background-color: white; color: green; font-family: Georgia, 'Times New Roman', serif; font-size: 15.4px; line-height: 21.56px;">--Encrypt Data</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: magenta; font-family: Consolas;">UPDATE</span><span lang="EN-US" style="font-family: Consolas;"> <span style="color: teal;">BankDemo1</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: blue; font-family: Consolas;">SET</span><span lang="EN-US" style="font-family: Consolas;">
<span style="color: teal;">BankAmtSymKey</span> <span style="color: grey;">=</span> E</span><span style="color: magenta; font-family: Consolas;">NCRYPTBYASYMKEY</span><span style="color: grey; font-family: Consolas;">(</span><span style="color: magenta; font-family: Consolas;">ASYMKEY_ID</span><span style="color: grey; font-family: Consolas;">(</span><span style="color: red; font-family: Consolas;">'TestAsymmKey'</span><span style="color: grey; font-family: Consolas;">),</span><span style="font-family: Consolas;">BankAmt<span style="color: grey;">)</span></span><span lang="EN-US" style="font-family: Consolas;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: blue; font-family: Consolas;">GO<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: blue; font-family: Consolas;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: blue; font-family: Consolas;"><span style="color: #222222; font-family: Georgia, 'Times New Roman', serif; font-size: 15.4px; line-height: 21.56px;"> </span><span style="color: green; font-family: Georgia, 'Times New Roman', serif; font-size: 15.4px; line-height: 21.56px;">-- Close the asymmetric key</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: blue; font-family: Consolas;">CLOSE</span><span lang="EN-US" style="font-family: Consolas;">
<span style="color: blue;">ASYMMETRIC</span> <span style="color: blue;">KEY</span> <span style="color: teal;">TestAsymmKey</span><span style="color: grey;">;</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: blue; font-family: Consolas;">GO<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 36pt;">
<br /></div>
<div class="MsoNormal">
<span style="font-family: Georgia, serif; line-height: 115%;"><span style="color: #444444;">Letâs see the magic we created!!!<o:p></o:p></span></span></div>
<div class="MsoNormal">
<span style="font-family: Georgia, serif; line-height: 115%;"><span style="color: #444444;"><br /></span></span></div>
<div class="MsoNormal">
<span style="font-family: Georgia, serif; line-height: 115%;"><span style="color: #444444;"><br /></span></span></div>
<table border="0" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; margin-left: 4.75pt; width: 626px;"><tbody>
<tr style="height: 15pt;"><td nowrap="" style="background: yellow; border: 1pt solid windowtext; height: 15pt; padding: 0cm 5.4pt; width: 32.1pt;" valign="bottom" width="43"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US">BankID<o:p></o:p></span></div>
</td><td nowrap="" style="background: yellow; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: solid solid solid none; border-top-color: windowtext; border-top-width: 1pt; height: 15pt; padding: 0cm 5.4pt; width: 37.45pt;" valign="bottom" width="50"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US">BankName<o:p></o:p></span></div>
</td><td nowrap="" style="background: yellow; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: solid solid solid none; border-top-color: windowtext; border-top-width: 1pt; height: 15pt; padding: 0cm 5.4pt; width: 399.75pt;" valign="bottom" width="533"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US">BankAmtSymKey<span style="color: #444444;"><o:p></o:p></span></span></div>
</td></tr>
<tr style="height: 33pt;"><td nowrap="" style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-left-color: windowtext; border-left-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid; height: 33pt; padding: 0cm 5.4pt; width: 32.1pt;" valign="top" width="43"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="color: #444444;">1<o:p></o:p></span></span></div>
</td><td nowrap="" style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; height: 33pt; padding: 0cm 5.4pt; width: 37.45pt;" valign="top" width="50"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="color: #444444;">Abc<o:p></o:p></span></span></div>
</td><td style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; height: 33pt; padding: 0cm 5.4pt; width: 399.75pt;" valign="top" width="533"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="color: #444444;">0x00F5998B8C856F4E92697DBA96BD44AD01000000547D8E1730DEF80F</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="color: #444444;">F7B2055C8478DA0DDCF7FCAC8E1C23B9C3E7F4A9D1712F75<o:p></o:p></span></span></div>
</td></tr>
<tr style="height: 33pt;"><td nowrap="" style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-left-color: windowtext; border-left-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid; height: 33pt; padding: 0cm 5.4pt; width: 32.1pt;" valign="top" width="43"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="color: #444444;">2<o:p></o:p></span></span></div>
</td><td nowrap="" style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; height: 33pt; padding: 0cm 5.4pt; width: 37.45pt;" valign="top" width="50"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="color: #444444;">Def<o:p></o:p></span></span></div>
</td><td style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; height: 33pt; padding: 0cm 5.4pt; width: 399.75pt;" valign="top" width="533"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="color: #444444;">0x00F5998B8C856F4E92697DBA96BD44AD0100000015C40BFAD6271818</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="color: #444444;">6D1EC41375B167FE96C96CB177F8A171C2C81E48E171D1C9<o:p></o:p></span></span></div>
</td></tr>
<tr style="height: 33pt;"><td nowrap="" style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-left-color: windowtext; border-left-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid; height: 33pt; padding: 0cm 5.4pt; width: 32.1pt;" valign="top" width="43"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="color: #444444;">3<o:p></o:p></span></span></div>
</td><td nowrap="" style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; height: 33pt; padding: 0cm 5.4pt; width: 37.45pt;" valign="top" width="50"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="color: #444444;">Hij<o:p></o:p></span></span></div>
</td><td style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; height: 33pt; padding: 0cm 5.4pt; width: 399.75pt;" valign="top" width="533"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="color: #444444;">0x00F5998B8C856F4E92697DBA96BD44AD01000000738A3FA8152E5CD6</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="color: #444444;">6335CF2231B37BD5FBFD94BECD0CF056389E6614E5E40037<o:p></o:p></span></span></div>
</td></tr>
</tbody></table>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 36pt;">
<br /></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 36pt;">
<br /></div>
<div class="MsoNormal">
<span style="font-family: Georgia, serif; line-height: 115%;"><span style="color: #444444;">In the current example Iâm saving both the text prior to
encryption under the [BankAmt] column and the cipher text in [BankAmtAsymKey]
column. In practical scenarios itâs obvious to use a mechanism like stored
procedures to perform the encryption task. This stored procedure would ideally be taking inputs for data to be encrypted and storing only the cipher text in the
table. </span><o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoListParagraphCxSpFirst" style="mso-list: l3 level1 lfo4; text-indent: -18.0pt;">
<!--[if !supportLists]--><b><i><span style="font-family: Georgia, serif; line-height: 115%;"><span style="background-color: white;"> </span><span style="background-color: cyan;">3)</span></span><span style="background-color: cyan;"> </span></i></b><span style="font-family: Georgia, serif; line-height: 115%;"><b><i style="background-color: cyan;">Dencrypt Data</i></b></span></div>
<div class="MsoListParagraphCxSpFirst" style="mso-list: l3 level1 lfo4; text-indent: -18.0pt;">
<span style="font-family: Georgia, serif; line-height: 115%;"> </span></div>
<div class="MsoListParagraphCxSpFirst" style="mso-list: l3 level1 lfo4; text-indent: -18.0pt;">
<span style="color: #444444;"><span style="font-family: Georgia, serif; line-height: 115%;"> Well
since we used</span><span style="line-height: 115%;"> </span><span lang="EN-US" style="font-family: Consolas; line-height: 115%;">ENCRYPTBYASMKEY </span><span lang="EN-US" style="font-family: Georgia, serif; line-height: 115%;">function your guess is
right we will use the corresponding</span><span lang="EN-US" style="font-family: Consolas; line-height: 115%;"> DENCRYPTBYASMKEY </span><span lang="EN-US" style="font-family: Georgia, serif; line-height: 115%;">function to retrieve the data.</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: blue; font-family: Consolas;"> USE</span><span lang="EN-US" style="font-family: Consolas;">
<span style="color: teal;">TESTDB</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: blue; font-family: Consolas;"> GO</span><span lang="EN-US" style="font-family: Consolas;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: blue; font-family: Consolas;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: blue; font-family: Consolas;"><span style="background-color: white; color: green; font-family: Georgia, 'Times New Roman', serif; font-size: 15.4px; line-height: 21.56px;"> -- Open the asymmetric key</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: blue; font-family: Consolas;"> OPEN</span><span lang="EN-US" style="font-family: Consolas;">
<span style="color: blue;">ASYMMETRIC</span> <span style="color: blue;">KEY</span> <span style="color: teal;">TestAsymmKey</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: blue; font-family: Consolas;"> DECRYPTION</span><span lang="EN-US" style="font-family: Consolas;">
<span style="color: blue;">BY</span> <span style="color: blue;">PASSWORD</span> <span style="color: grey;">=</span> <span style="color: red;">'1211!pwD##'</span><span style="color: grey;">;</span> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: blue; font-family: Consolas;"> GO</span><span lang="EN-US" style="font-family: Consolas;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; color: green; font-family: Georgia, 'Times New Roman', serif; font-size: 15.4px; line-height: 21.56px;"> -- Decrypt Data</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: Consolas;"> SELECT</span><span style="font-family: Consolas;"><span style="color: #45818e;"> BankID,BankName,</span> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: grey; font-family: Consolas;"> (</span><span style="color: magenta; font-family: Consolas;">CONVERT</span><span style="color: grey; font-family: Consolas;">(</span><span style="color: blue; font-family: Consolas;">CHAR</span><span style="color: grey; font-family: Consolas;">(</span><span style="font-family: Consolas;">52<span style="color: grey;">),</span> <span style="color: magenta;">DECRYPTBYASYMKEY</span><span style="color: grey;">(</span><span style="color: magenta;">ASYMKEY_ID</span><span style="color: grey;">(</span><span style="color: red;">'TestAsymmKey'</span><span style="color: grey;">),</span> <span style="color: #45818e;"> BankAmtAsymKey,</span> <span style="color: red;">N'1211!pwD##'</span><span style="color: grey;">)))</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas;"> <span style="color: blue;">AS</span> <span style="color: red;">'Decrypted Amount' </span></span><span style="color: blue; font-family: Consolas;">FROM</span><span style="font-family: Consolas;"> <span style="color: #45818e;">BankDemo1</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; color: green; font-family: Georgia, 'Times New Roman', serif; font-size: 15.4px; line-height: 21.56px;"> -- Close the asymmetric key</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: blue; font-family: Consolas;">CLOSE</span><span lang="EN-US" style="font-family: Consolas;">
<span style="color: blue;">SYMMETRIC</span> <span style="color: blue;">KEY</span> <span style="color: teal;">TestSymmKey</span><span style="color: grey;">;</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: blue; font-family: Consolas;">GO<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Now that we are clear on using both symmetric and asymmetric keys with their respective functions we shall see how to use certificates which encapsulate key information in the next blog.</span></div>
<div class="MsoNormal">
<br /></div>
<br />
<div class="MsoNormal">
<br /></div>
</div>
</div>
Krutihttp://www.blogger.com/profile/13385897521211871375noreply@blogger.com0tag:blogger.com,1999:blog-8195522014866487394.post-3285528675014237092015-10-10T01:46:00.003-07:002016-01-05T05:30:01.391-08:00SQL server encryption â Symmetric Keys<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal">
<span style="line-height: 115%;"><span style="font-family: Georgia, Times New Roman, serif;">In the previous blog we learnt about encryption and a brief
about the SQL server option provided for data protection through encryption. </span></span></div>
<div class="MsoNormal">
<span style="line-height: 115%;"><span style="font-family: Georgia, Times New Roman, serif;"><br /></span></span></div>
<div class="MsoNormal">
<span style="line-height: 15.3333px;"><a href="http://sqlandmorewithkruti.blogspot.com/2015/10/sql-server-encryption.html"><span style="font-family: Georgia, Times New Roman, serif;">http://sqlandmorewithkruti.blogspot.com/2015/10/sql-server-encryption.html</span></a></span></div>
<div class="MsoNormal">
<span style="line-height: 15.3333px;"><span style="font-family: Georgia, Times New Roman, serif;"><br /></span></span></div>
<div class="MsoNormal">
<span style="line-height: 115%;"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">In
this blog we will learn with a demo how to use the first option Symmetric Keys
for encryption.</span></span><span style="color: #444444; font-family: Georgia, 'Times New Roman', serif; line-height: 115%;">As stated earlier symmetric keys use the same key to encrypt
and decrypt data.</span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, 'Times New Roman', serif; line-height: 115%;">When
a symmetric key is created, the symmetric key must be encrypted by using at
least one of the following: certificate, password, symmetric key, asymmetric
key, or PROVIDER. </span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, 'Times New Roman', serif; line-height: 115%;">In this blog we will be using one protected
with password. In later modules we will
be using asymmetric keys and certificates</span></div>
<br />
<div style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><b><i>1) Create Database Master Key</i></b></span></div>
<div style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><br /><b><i>2) Encrypt Data</i></b></span></div>
<ul style="text-align: left;">
<li><span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;">Create Symmetric Key</span></span></li>
<li><span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;">Open Key</span></span></li>
<li><span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;">Encrypt Data</span></span></li>
<li><span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;">Close Key</span></span></li>
</ul>
<span style="font-family: Georgia, Times New Roman, serif;"><b><i>3) Decrypt Data</i></b></span><br />
<ul style="text-align: left;"><span style="font-family: Georgia, Times New Roman, serif;">
<li><span style="color: #444444;">Open Key</span></li>
<li><span style="color: #444444;">Dencrypt Data</span></li>
<li><span style="color: #444444;">Close Key</span></li>
</span></ul>
<span style="font-family: Georgia, Times New Roman, serif;">
</span>
<br />
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 108pt; text-align: left; text-indent: -18pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoListParagraphCxSpLast" style="margin-left: 9pt; text-align: left; text-indent: -18pt;">
<!--[if !supportLists]--><span style="font-family: Georgia, Times New Roman, serif;"><b><i style="background-color: cyan;"><span style="line-height: 115%;"> 1)<span style="font-stretch: normal; line-height: normal;"> </span></span></i></b><span style="line-height: 115%;"><b><i style="background-color: cyan;">Create Database
Master Key </i></b><o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpLast" style="margin-left: 9pt; text-align: left; text-indent: -18pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="line-height: 115%;"><br /></span></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 18pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">USE</span><span lang="EN-US">
<span style="color: teal;">TESTDB</span><span style="color: grey;">;</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 18pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">GO</span><span lang="EN-US"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 18pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">CREATE</span><span lang="EN-US">
<span style="color: blue;">MASTER</span> <span style="color: blue;">KEY</span> <span style="color: blue;">ENCRYPTION</span> <span style="color: blue;">BY</span> <span style="color: blue;">PASSWORD</span> <span style="color: grey;">=</span> <span style="color: red;">'1211!pwD##'</span><span style="color: grey;">;</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 18pt;">
<span lang="EN-US" style="color: blue;"><span style="font-family: Georgia, Times New Roman, serif;">GO<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 36pt;">
<br /></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 36pt;">
<br /></div>
<div class="MsoListParagraphCxSpFirst" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l2 level1 lfo4; text-indent: -18.0pt;">
<!--[if !supportLists]--><span style="font-family: Georgia, Times New Roman, serif;"><b><i style="background-color: cyan;"><span style="line-height: 115%;">2)</span> </i></b><span style="line-height: 115%;"><b><i style="background-color: cyan;">Encrypt Data </i></b><o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0cm 0cm 0.0001pt 9pt;">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0cm 0cm 0.0001pt 9pt;">
<span lang="EN-US"><span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;">I have a table with the below structure</span><o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpLast" style="margin: 0cm 0cm 0.0001pt 27pt;">
<br /></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 9pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">CREATE</span><span lang="EN-US">
<span style="color: blue;">TABLE</span> <span style="color: teal;">[dbo]</span><span style="color: grey;">.</span><span style="color: teal;">[BankDemo1]</span><span style="color: grey;">(</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 9pt;">
<span lang="EN-US"><span style="font-family: Georgia, Times New Roman, serif;"> <span style="color: teal;">[BankID]</span> <span style="color: teal;">[tinyint]</span> <span style="color: grey;">NOT</span> <span style="color: grey;">NULL,</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 9pt;">
<span lang="EN-US"><span style="font-family: Georgia, Times New Roman, serif;"> <span style="color: teal;">[BankName]</span> <span style="color: teal;">[varchar]</span><span style="color: grey;">(</span>10<span style="color: grey;">)</span> <span style="color: grey;">NOT</span> <span style="color: grey;">NULL,</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US"> </span><span lang="EN-US" style="color: teal;">[BankAmt]</span><span lang="EN-US"> <span style="color: teal;">[varchar]</span><span style="color: grey;">(</span>10<span style="color: grey;">)</span> <span style="color: grey;">NOT</span> <span style="color: grey;">NULL,<o:p></o:p></span></span></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 9pt;">
<br /></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 9pt;">
<span lang="EN-US"><span style="font-family: Georgia, Times New Roman, serif;"> <span style="color: blue;">CONSTRAINT</span> <span style="color: teal;">[PK_BankDemo1]</span>
<span style="color: blue;">PRIMARY</span> <span style="color: blue;">KEY</span> <span style="color: blue;">CLUSTERED</span> <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 9pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: grey;">(</span><span lang="EN-US"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 9pt;">
<span lang="EN-US"><span style="font-family: Georgia, Times New Roman, serif;"> <span style="color: teal;">[BankID]</span> <span style="color: blue;">ASC</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 9pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: grey;">)</span><span lang="EN-US"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 9pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: grey;">)</span><span lang="EN-US">
<span style="color: blue;">ON</span> <span style="color: teal;">[PRIMARY]</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 18pt;">
<br /></div>
<table border="0" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; margin-left: 72.0pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-yfti-tbllook: 1184; width: 212px;">
<tbody>
<tr style="height: 15.0pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0;">
<td nowrap="" style="background: yellow; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 48.0pt;" valign="top" width="64"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="font-family: Georgia, Times New Roman, serif;">BankID<o:p></o:p></span></span></div>
</td>
<td nowrap="" style="background: yellow; border-left: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 59.5pt;" valign="top" width="79"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="font-family: Georgia, Times New Roman, serif;">BankName<o:p></o:p></span></span></div>
</td>
<td nowrap="" style="background: yellow; border-left: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 51.7pt;" valign="top" width="69"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="font-family: Georgia, Times New Roman, serif;">BankAmt<o:p></o:p></span></span></div>
</td>
</tr>
<tr style="height: 15.0pt; mso-yfti-irow: 1;">
<td nowrap="" style="border-top: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 48.0pt;" valign="top" width="64"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="font-family: Georgia, Times New Roman, serif;">1<o:p></o:p></span></span></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 59.5pt;" valign="top" width="79"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="font-family: Georgia, Times New Roman, serif;">abc<o:p></o:p></span></span></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 51.7pt;" valign="top" width="69"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="font-family: Georgia, Times New Roman, serif;">1000<o:p></o:p></span></span></div>
</td>
</tr>
<tr style="height: 15.0pt; mso-yfti-irow: 2;">
<td nowrap="" style="border-top: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 48.0pt;" valign="top" width="64"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="font-family: Georgia, Times New Roman, serif;">2<o:p></o:p></span></span></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 59.5pt;" valign="top" width="79"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="font-family: Georgia, Times New Roman, serif;">def<o:p></o:p></span></span></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 51.7pt;" valign="top" width="69"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="font-family: Georgia, Times New Roman, serif;">2000<o:p></o:p></span></span></div>
</td>
</tr>
<tr style="height: 15.0pt; mso-yfti-irow: 3; mso-yfti-lastrow: yes;">
<td nowrap="" style="border-top: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 48.0pt;" valign="top" width="64"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="font-family: Georgia, Times New Roman, serif;">3<o:p></o:p></span></span></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 59.5pt;" valign="top" width="79"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="font-family: Georgia, Times New Roman, serif;">hij<o:p></o:p></span></span></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 51.7pt;" valign="top" width="69"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="font-family: Georgia, Times New Roman, serif;">3000<o:p></o:p></span></span></div>
</td>
</tr>
</tbody></table>
<br />
<br />
<div class="MsoListParagraphCxSpFirst" style="margin: 0cm 0cm 0.0001pt;">
<span lang="EN-US"><span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;">We shall be encrypting
the [BankAmt] column. But the cipher data
generated during encryption can only be of type varbinary. So the first step is
for us to change the structure of the table.</span><o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpLast" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">USE</span><span lang="EN-US"> <span style="color: teal;">TESTDB</span><span style="color: grey;">;</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">GO</span><span lang="EN-US"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">ALTER</span><span lang="EN-US"> <span style="color: blue;">TABLE</span> <span style="color: teal;">BankDemo1</span> <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">ADD</span><span lang="EN-US"> <span style="color: teal;">BankAmtSymKey</span>
<span style="color: blue;">varbinary</span><span style="color: grey;">(</span><span style="color: magenta;">MAX</span><span style="color: grey;">)</span> <span style="color: grey;">NULL</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">GO</span><span lang="EN-US"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="font-family: Georgia, Times New Roman, serif;"> <o:p></o:p></span></span></div>
<div class="MsoListParagraph" style="margin-left: 0cm; mso-add-space: auto;">
<span style="line-height: 115%;"><span style="font-family: Georgia, Times New Roman, serif;">Now
that our table schema is modified we proceed with creation of the symmetric key<o:p></o:p></span></span></div>
<div class="MsoListParagraph" style="margin-left: 0cm; mso-add-space: auto;">
<span style="line-height: 115%;"><span style="font-family: Georgia, Times New Roman, serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;"><span lang="EN-US">Syntax : </span><a href="https://msdn.microsoft.com/en-us/library/ms188357.aspx"><span lang="EN-US">https://msdn.microsoft.com/en-us/library/ms188357.aspx</span></a></span><span lang="EN-US" style="color: blue;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">USE</span><span lang="EN-US"> <span style="color: teal;">TESTDB</span><span style="color: grey;">;</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">GO</span><span lang="EN-US"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">CREATE</span><span lang="EN-US">
<span style="color: blue;">SYMMETRIC</span> <span style="color: blue;">KEY</span> <span style="color: teal;">TestSymmKey</span> <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">WITH</span><span lang="EN-US">
<span style="color: blue;">ALGORITHM</span> <span style="color: grey;">=</span> <span style="color: blue;">AES_256</span> <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">ENCRYPTION</span><span lang="EN-US">
<span style="color: blue;">BY</span> <span style="color: blue;">PASSWORD</span> <span style="color: grey;">=</span> <span style="color: red;">'1211!pwD##'</span><span style="color: grey;">;</span> <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">GO</span><span lang="EN-US">
<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US"><span style="color: #444444;">Letâs do the trick!!!</span></span><span lang="EN-US"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 36pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">USE</span><span lang="EN-US">
<span style="color: teal;">TESTDB</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">GO</span><span lang="EN-US"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, 'Times New Roman', serif;"> </span><span style="color: green; font-family: Georgia, 'Times New Roman', serif;">-- Open the symmetric key</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">OPEN</span><span lang="EN-US">
<span style="color: blue;">SYMMETRIC</span> <span style="color: blue;">KEY</span> <span style="color: teal;">TestSymmKey</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: blue; font-family: Georgia, 'Times New Roman', serif;">DECRYPTION</span><span lang="EN-US" style="font-family: Georgia, 'Times New Roman', serif;">
<span style="color: blue;">BY</span> <span style="color: blue;">PASSWORD</span> <span style="color: grey;">=</span> <span style="color: red;">'1211!pwD##'</span><span style="color: grey;">;</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, 'Times New Roman', serif;"> </span><span style="color: green; font-family: Georgia, 'Times New Roman', serif;">--Encrypt Data</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">GO</span><span lang="EN-US"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: magenta;">UPDATE</span><span lang="EN-US"> <span style="color: teal;">BankDemo1</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">SET</span><span lang="EN-US">
<span style="color: teal;">BankAmtSymKey</span> <span style="color: grey;">=</span>
<span style="color: magenta;">ENCRYPTBYKEY</span><span style="color: blue;"> </span><span style="color: grey;">(</span><span style="color: magenta;">Key_GUID</span><span style="color: grey;">(</span><span style="color: red;">'TestSymmKey'</span><span style="color: grey;">),</span><span style="color: teal;">BankAmt</span><span style="color: grey;">)</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: blue;"><span style="font-family: Georgia, Times New Roman, serif;">GO<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, 'Times New Roman', serif;"> </span><span style="color: green; font-family: Georgia, 'Times New Roman', serif;">-- Close the symmetric key</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">CLOSE</span><span lang="EN-US">
<span style="color: blue;">SYMMETRIC</span> <span style="color: blue;">KEY</span> <span style="color: teal;">TestSymmKey</span><span style="color: grey;">;</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: blue;"><span style="font-family: Georgia, Times New Roman, serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: blue;"><span style="font-family: Georgia, Times New Roman, serif;">GO<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 36pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Letâs see the magic we created!!!<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 36pt;">
<br /></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 72pt;">
<span lang="EN-US"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></span></div>
<table border="0" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; margin-left: 4.75pt; width: 626px;"><tbody>
<tr style="height: 15pt;"><td nowrap="" style="background: yellow; border: 1pt solid windowtext; height: 15pt; padding: 0cm 5.4pt; width: 32.1pt;" valign="bottom" width="43"><div class="MsoNormal" style="margin: 0px 0px 0.0001pt;">
<span lang="EN-US"><span style="font-family: Georgia, Times New Roman, serif;">BankID<o:p></o:p></span></span></div>
</td><td nowrap="" style="background: yellow; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: solid solid solid none; border-top-color: windowtext; border-top-width: 1pt; height: 15pt; padding: 0cm 5.4pt; width: 37.45pt;" valign="bottom" width="50"><div class="MsoNormal" style="margin: 0px 0px 0.0001pt;">
<span lang="EN-US"><span style="font-family: Georgia, Times New Roman, serif;">BankName<o:p></o:p></span></span></div>
</td><td nowrap="" style="background: yellow; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: solid solid solid none; border-top-color: windowtext; border-top-width: 1pt; height: 15pt; padding: 0cm 5.4pt; width: 399.75pt;" valign="bottom" width="533"><div class="MsoNormal" style="margin: 0px 0px 0.0001pt;">
<span lang="EN-US"><span style="font-family: Georgia, Times New Roman, serif;">BankAmtSymKey<span style="color: #444444;"><o:p></o:p></span></span></span></div>
</td></tr>
<tr style="height: 33pt;"><td nowrap="" style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-left-color: windowtext; border-left-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid; height: 33pt; padding: 0cm 5.4pt; width: 32.1pt;" valign="top" width="43"><div class="MsoNormal" style="margin: 0px 0px 0.0001pt;">
<span lang="EN-US"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">1<o:p></o:p></span></span></div>
</td><td nowrap="" style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; height: 33pt; padding: 0cm 5.4pt; width: 37.45pt;" valign="top" width="50"><div class="MsoNormal" style="margin: 0px 0px 0.0001pt;">
<span lang="EN-US"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Abc<o:p></o:p></span></span></div>
</td><td style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; height: 33pt; padding: 0cm 5.4pt; width: 399.75pt;" valign="top" width="533"><div class="MsoNormal" style="margin: 0px 0px 0.0001pt;">
<span lang="EN-US"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">0x00F5998B8C856F4E92697DBA96BD44AD01000000</span></span><span style="color: #444444; font-family: Georgia, 'Times New Roman', serif;">547D8E1730</span><br />
<span style="color: #444444; font-family: Georgia, 'Times New Roman', serif;">DEF80FF7B2055C8478DA0DDCF7FCAC8E1</span><span style="color: #444444; font-family: Georgia, 'Times New Roman', serif;">C23B9C3E7F4A9D1712F75</span></div>
</td></tr>
<tr style="height: 33pt;"><td nowrap="" style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-left-color: windowtext; border-left-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid; height: 33pt; padding: 0cm 5.4pt; width: 32.1pt;" valign="top" width="43"><div class="MsoNormal" style="margin: 0px 0px 0.0001pt;">
<span lang="EN-US"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">2<o:p></o:p></span></span></div>
</td><td nowrap="" style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; height: 33pt; padding: 0cm 5.4pt; width: 37.45pt;" valign="top" width="50"><div class="MsoNormal" style="margin: 0px 0px 0.0001pt;">
<span lang="EN-US"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Def<o:p></o:p></span></span></div>
</td><td style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; height: 33pt; padding: 0cm 5.4pt; width: 399.75pt;" valign="top" width="533"><div class="MsoNormal" style="margin: 0px 0px 0.0001pt;">
<span lang="EN-US"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">0x00F5998B8C856F4E92697DBA96BD44AD0100000015C40BFAD6</span></span><br />
<span lang="EN-US"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">2718186D1EC41375B167FE96C96CB177F8A171C2C81E48E171D1C9<o:p></o:p></span></span></div>
</td></tr>
<tr style="height: 33pt;"><td nowrap="" style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-left-color: windowtext; border-left-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid; height: 33pt; padding: 0cm 5.4pt; width: 32.1pt;" valign="top" width="43"><div class="MsoNormal" style="margin: 0px 0px 0.0001pt;">
<span lang="EN-US"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">3<o:p></o:p></span></span></div>
</td><td nowrap="" style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; height: 33pt; padding: 0cm 5.4pt; width: 37.45pt;" valign="top" width="50"><div class="MsoNormal" style="margin: 0px 0px 0.0001pt;">
<span lang="EN-US"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Hij<o:p></o:p></span></span></div>
</td><td style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; height: 33pt; padding: 0cm 5.4pt; width: 399.75pt;" valign="top" width="533"><div class="MsoNormal" style="margin: 0px 0px 0.0001pt;">
<span lang="EN-US"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">0x00F5998B8C856F4E92697DBA96BD44AD01000000738A3FA8152</span></span><br />
<span lang="EN-US"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">E5CD66335CF2231B37BD5FBFD94BECD0CF056389E6614E5E40037<o:p></o:p></span></span></div>
</td></tr>
</tbody></table>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 72pt;">
<span lang="EN-US"><span style="color: #444444;"><span style="font-family: Georgia, 'Times New Roman', serif;"> </span><span style="font-family: Georgia, Times New Roman, serif;"> </span></span></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 0.0001pt 36pt;">
<br /></div>
<div class="MsoListParagraphCxSpFirst" style="margin: 0cm 0cm 0.0001pt;">
<span lang="EN-US"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">In the current example have saved both the text prior to encryption under the [BankAmt] column and
the cipher text in [BankAmtSymKey] column. </span></span></div>
<div class="MsoListParagraphCxSpFirst" style="margin: 0cm 0cm 0.0001pt;">
<span lang="EN-US"><span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;">In practical scenarios itâs obvious
to use a mechanism like stored procedures to perform the encryption task. This
stored procedure would ideally taking inputs for data to encrypt and storing
only the cipher text in the table. </span><o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpFirst" style="margin: 0cm 0cm 0.0001pt;">
<span lang="EN-US"><span style="font-family: Georgia, Times New Roman, serif;"><br /></span></span></div>
<div class="MsoListParagraphCxSpFirst" style="margin: 0cm 0cm 0.0001pt;">
<span style="background-color: cyan;"><b><i><span lang="EN-US"><span style="font-family: Georgia, Times New Roman, serif;">3)</span></span><span lang="EN-US"><span style="font-family: Georgia, Times New Roman, serif;"> </span></span><span style="font-family: Georgia, 'Times New Roman', serif; line-height: 115%; text-indent: -18pt;">Dencrypt Data</span></i></b></span></div>
<div class="MsoListParagraphCxSpFirst" style="margin: 0cm 0cm 0.0001pt;">
<span style="background-color: cyan;"><b><i><span style="font-family: Georgia, 'Times New Roman', serif; line-height: 115%; text-indent: -18pt;"><br /></span></i></b></span></div>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Well since we used ENCRYPTBYKEY function your guess is right we will use the corresponding DENCRYPTBYKEY function to retrieve the data.</span><br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">USE</span><span lang="EN-US">
<span style="color: teal;">TESTDB</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">GO</span><span lang="EN-US"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, 'Times New Roman', serif;"> </span><span style="color: green; font-family: Georgia, 'Times New Roman', serif;">-- Open the symmetric key</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">OPEN</span><span lang="EN-US">
<span style="color: blue;">SYMMETRIC</span> <span style="color: blue;">KEY</span> <span style="color: teal;">TestSymmKey</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">DECRYPTION</span><span lang="EN-US">
<span style="color: blue;">BY</span> <span style="color: blue;">PASSWORD</span> <span style="color: grey;">=</span> <span style="color: red;">'1211!pwD##'</span><span style="color: grey;">;</span> <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: Georgia, 'Times New Roman', serif;">GO</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: green;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: green;">--
Decrypt Data</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">SELECT</span><span lang="EN-US">
<span style="color: teal;">BankID</span><span style="color: grey;">,</span><span style="color: teal;">BankName</span><span style="color: grey;">,</span> <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: magenta;">CONVERT</span><span lang="EN-US" style="color: grey;">(</span><span lang="EN-US" style="color: blue;">varchar</span><span lang="EN-US" style="color: grey;">,</span><span lang="EN-US"> <span style="color: magenta;">DecryptByKey</span><span style="color: grey;">(</span><span style="color: teal;">BankAmtSymKey</span><span style="color: grey;">))</span> <span style="color: blue;">AS</span> <span style="color: red;">'Decrypted Amount'</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">FROM</span><span lang="EN-US">
<span style="color: teal;">BankDemo1</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="font-family: Georgia, Times New Roman, serif;"> <span style="color: green;">-- Close the
symmetric key</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">CLOSE</span><span lang="EN-US">
<span style="color: blue;">SYMMETRIC</span> <span style="color: blue;">KEY</span> <span style="color: teal;">TestSymmKey</span><span style="color: grey;">;</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: blue;"><span style="font-family: Georgia, Times New Roman, serif;">GO<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">In the next blog we shall see the same example but this time we shall be using asymmetric keys.</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span lang="EN-US" style="color: blue;"><span style="font-family: Georgia, Times New Roman, serif;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
</div>
Krutihttp://www.blogger.com/profile/13385897521211871375noreply@blogger.com1tag:blogger.com,1999:blog-8195522014866487394.post-21907488324453757352015-10-10T01:20:00.002-07:002016-01-05T05:30:11.318-08:00SQL Server Encryption<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal" style="text-align: left;">
<span style="line-height: 115%;"><span style="font-family: Georgia, Times New Roman, serif;">Encryption
is a methodology used to hide confidential information from any illegitimate
user is such a way that they do not see the actual contents of the information. Rather they get access to some cipher text. This text can be decrypted to its original form by legitimate
users by the use of certain algorithms and secret code known as encryption keys or passwords.<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="line-height: 115%;"><span style="font-family: Georgia, Times New Roman, serif;"><br /></span></span></div>
<h2 style="text-align: left;">
<u><span style="line-height: 115%;"><span style="font-family: Georgia, Times New Roman, serif;"><b><i>Windows
OS Encryption Interface</i></b></span></span></u></h2>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Starting windows 2000 an <a href="https://msdn.microsoft.com/en-gb/library/ms995355.aspx">API</a> is provided by the operating system to accommodate such data protection
mechanism. </span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">How does the operating system
do this? In a nutshell there are 2 functions namely <a href="https://msdn.microsoft.com/en-us/library/aa380261(VS.85).aspx">CryptProtectData</a>() & <a href="https://msdn.microsoft.com/en-us/library/aa380882(v=vs.85).aspx">CryptUnprotectData</a>(). As the name suggests
first one will be used to encrypt the data the latter will be used to decrypt
the cipher text.<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, 'Times New Roman', serif;">Both these
functions are available under </span><span style="color: #444444; font-family: Georgia, 'Times New Roman', serif;">Crypt32.lib
library. If the library is not linked to the application that needs to use
these windows functions one can dynamically call the <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa379884(v=vs.85).aspx">Crypt32.dll</a> dynamic link library in their application.</span><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">The functions run in the
security context of the <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa378326(v=vs.85).aspx">Local Security Authority</a> (LSA). For those who are
unaware LSA is a system process that loads when the system is started and runs
till the system is shut down.</span><span style="color: #444444; font-family: Georgia, 'Times New Roman', serif;"> </span></div>
<div class="MsoNormal" style="margin-left: 36pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6CWh3E9yM_GUpiFz0olScvxpROQ9pdLLjpQkL-7E3_yGoirJLsPWqizyD9rPJaeHmFI5T0Hll8klZHL1Nr36bXwvpM5cL1ApQHJwAyK7vzDsPFSYVRxiSlgk7-fDWIfKPqX-Xd7GF9iI/s1600/LSA.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6CWh3E9yM_GUpiFz0olScvxpROQ9pdLLjpQkL-7E3_yGoirJLsPWqizyD9rPJaeHmFI5T0Hll8klZHL1Nr36bXwvpM5cL1ApQHJwAyK7vzDsPFSYVRxiSlgk7-fDWIfKPqX-Xd7GF9iI/s1600/LSA.jpg" /></a></div>
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="margin-left: 36pt; text-align: left;">
<br /></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">The CryptProtectData() requires a password to create the cipher. The LSA
provides the existing user's password hash. Obviously all applications running under the
same user account will be able to access these functions and decrypt any
protected data if aware of the location under the same context.</span><span style="color: #444444; font-family: Georgia, 'Times New Roman', serif;">The operating system however
only provides the mechanism for data protection. This implies that the
applications calling these functions should implement their own storage for
protected data. When you arenât aware of the location where the cipher text is
stored; the functions and password hash serve no purpose to get unauthorized access
to sensitive information.</span><span style="color: #444444; font-family: Georgia, 'Times New Roman', serif;"> </span><span style="color: #444444; font-family: Georgia, 'Times New Roman', serif;">But itâs certainly possible hence DPAPI allows an application to use an
additional secret when protecting data. </span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">This additional secret is then required
to decrypt the data.<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><a href="https://msdn.microsoft.com/en-gb/library/ms995355.aspx">DPAPI</a> generates MasterKeys
which are in turn used to generate session keys. These keys along-with some
random data & encryption algorithm are used for data encryption. The
operating system stores this random data and on discovery of any cipher text
uses this random text to generate the session key and decrypt the actual data.<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">One may wonder how does
DPAPI work and get the same MasterKey back if the password is changed. This has
also been taken care of by the operating system so we need not worry. Iâd
recommend you read the below article to understand in depth the<a href="https://msdn.microsoft.com/en-gb/library/ms995355.aspx"> WindowsOperating System DPAPI functionality</a>. <o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;">This master key is used by
SQL server to create something called as Service Master Key (SMK). The SMK sits at the top of hierarchy of SQL
server encryption.</span><o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<h2 style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><i><b><u>Encryption in SQL server.</u></b></i></span></h2>
<div class="MsoNormal" style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;">The SQL server service
master key (SMK) is generated at the time of SQL server setup with the master
key from Windows DPAPI and the service account configured credentials provided
for setup. One service master key per instance.</span> <o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: left;">
<i><span style="color: red;"><span style="font-family: Georgia, Times New Roman, serif;">Note: SMK is a symmetric key.</span></span></i></div>
<div class="MsoNormal" style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;">One will find its entry in
the below table</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">USE</span><span lang="EN-US">
<span style="color: blue;">master</span><span style="color: grey;">;</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">GO</span><span lang="EN-US"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">SELECT</span><span lang="EN-US">
<span style="color: grey;">*</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">FROM</span><span lang="EN-US">
<span style="color: green;">sys</span><span style="color: grey;">.</span><span style="color: green;">symmetric_keys</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span lang="EN-US" style="color: blue;">WHERE</span><span lang="EN-US">
<span style="color: teal;">name</span> <span style="color: grey;">=</span> <span style="color: red;">'##MS_ServiceMasterKey##'</span><span style="color: grey;">;</span><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span lang="EN-US" style="color: blue;"><span style="font-family: Georgia, Times New Roman, serif;">GO<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span lang="EN-US" style="color: blue;"><span style="font-family: Georgia, Times New Roman, serif;"><br /></span></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;">The service master key is
used to encrypt the Database Master Key (DMK).
The DMK is used to generate asymmetric keys, symmetric keys and
certificates in SQL server. Microsoft depicts this beautifully in the below Microsoft diagram.</span></span><br />
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;"><br /></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqU9ZPUKrHfk8TfLcPvNEVAZsOOmd91jf7bJZEU5TCTUWn9UEQEynikR1uDrRvXSWovTjfKCtKLWdjLX5BFHzoybE0dlASm6v1Zh7TMNsCZ7XJ6oEwSvkXmqAVda5eOpID9po0vqfBDUQ/s1600/Hierarchy.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqU9ZPUKrHfk8TfLcPvNEVAZsOOmd91jf7bJZEU5TCTUWn9UEQEynikR1uDrRvXSWovTjfKCtKLWdjLX5BFHzoybE0dlASm6v1Zh7TMNsCZ7XJ6oEwSvkXmqAVda5eOpID9po0vqfBDUQ/s1600/Hierarchy.jpg" /></a></div>
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;"><br /></span></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="font-family: Georgia, 'Times New Roman', serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="font-family: Georgia, 'Times New Roman', serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, 'Times New Roman', serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, 'Times New Roman', serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, 'Times New Roman', serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, 'Times New Roman', serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, 'Times New Roman', serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, 'Times New Roman', serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, 'Times New Roman', serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, 'Times New Roman', serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, 'Times New Roman', serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, 'Times New Roman', serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, 'Times New Roman', serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, 'Times New Roman', serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, 'Times New Roman', serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, 'Times New Roman', serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, 'Times New Roman', serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, 'Times New Roman', serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, 'Times New Roman', serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, 'Times New Roman', serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, 'Times New Roman', serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, 'Times New Roman', serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, 'Times New Roman', serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, 'Times New Roman', serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, 'Times New Roman', serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, 'Times New Roman', serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, 'Times New Roman', serif;"><span style="color: #444444;">Thus we
have 3 techniques to encrypt data in SQL server</span></span></div>
<div style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><br /><b><i style="background-color: cyan;">1) Symmetric Keys</i></b><br /><span style="color: #444444;"> Symmetric keys use the same key to encrypt and decrypt data.</span></span></div>
<div style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><br /><b><i style="background-color: cyan;">2) Asymmetric Keys</i></b><br /><span style="color: #444444;"> Asymmetric key ideally uses a public key to encrypt data and a matching private key is used to decrypt the data. It can also be used vice versa but only the matching pair of keys can decrypt the data encrypted by other.</span></span></div>
<div style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><br /><i><b style="background-color: cyan;">3) Certificates.</b></i><br /><span style="color: #444444;"> Certificates are containers for the user's public key which store additional data identifying the organization that issued the certification.</span></span></div>
<div>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">There is
a utility called <em><span style="background: white; border: 1pt none windowtext; padding: 0cm;">certmgr.msc used to view/install certificates on
the current machine.</span></em></span><br />
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><em><span style="background: white; border: 1pt none windowtext; padding: 0cm;"><br /></span></em></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9GZC0Q61K16FHAXVsV_Do5HbXoWgMNaT-qMJYu0NiIS4ZVSls3O2n2EYYMHetCL5o72d63k2axGJdDtW6h4O54e5UQLcI3ob_yJF3YNWmAEisxbX3l7l60wB8E1UanvwEFZZMr4Hk4-I/s1600/CertUtility.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9GZC0Q61K16FHAXVsV_Do5HbXoWgMNaT-qMJYu0NiIS4ZVSls3O2n2EYYMHetCL5o72d63k2axGJdDtW6h4O54e5UQLcI3ob_yJF3YNWmAEisxbX3l7l60wB8E1UanvwEFZZMr4Hk4-I/s1600/CertUtility.jpg" /></a></div>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><em><span style="background: white; border: 1pt none windowtext; padding: 0cm;"><br /></span></em></span>
<br />
<div class="MsoNormal" style="margin-left: 36pt; text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;">Until SQL server 2005 these
were the only 3 techniques for encryption. With the advent of SQL server 2008
SQL server introduced 2 new techniques for encryption namely</span></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="font-family: Georgia, 'Times New Roman', serif; text-indent: -18pt;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<b><i style="background-color: cyan;"><span style="font-family: Georgia, 'Times New Roman', serif; text-indent: -18pt;">4) </span><span style="font-family: Georgia, 'Times New Roman', serif; text-indent: -18pt;">Transact-SQL
functions</span></i></b></div>
<div class="MsoNormal" style="text-align: left;">
<span style="font-family: Georgia, 'Times New Roman', serif; text-indent: -18pt;"><br /></span></div>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">This feature is available in all editions of SQL server. This is also known as <b><u>Cell-Level Encryption /Column Level Encryption</u></b> in SQL server. SQL server makes use of the below encrypt,decrypt functions to protect data within columns of record.</span><br />
<div class="MsoNormal" style="background: white; line-height: 17.75pt; margin: 12pt 0cm; text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">The encryption functions are:<o:p></o:p></span></div>
<div class="MsoNoSpacing" style="margin-left: 36pt; text-align: left; text-indent: -18pt;">
<!--[if !supportLists]--><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">¡<span style="font-stretch: normal;">
</span><!--[endif]--><a href="http://msdn.microsoft.com/en-us/library/ms174361.aspx" target="_blank"><span style="text-decoration: none;">ENCRYPTBYKEY</span></a>, which uses a symmetric key to encrypt data<o:p></o:p></span></div>
<div class="MsoNoSpacing" style="margin-left: 36pt; text-align: left; text-indent: -18pt;">
<!--[if !supportLists]--><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">¡<span style="font-stretch: normal;">
</span><!--[endif]--><a href="http://msdn.microsoft.com/en-us/library/ms188061.aspx" target="_blank"><span style="text-decoration: none;">ENCRYPTBYCERT</span></a>, which uses the public key of a certificate to encrypt
data<o:p></o:p></span></div>
<div class="MsoNoSpacing" style="margin-left: 36pt; text-align: left; text-indent: -18pt;">
<!--[if !supportLists]--><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">¡<span style="font-stretch: normal;">
</span><!--[endif]--><a href="http://msdn.microsoft.com/en-us/library/ms190357.aspx" target="_blank"><span style="text-decoration: none;">ENCRYPTBYPASSPHRASE</span></a>, which uses a passphrase to encrypt data<o:p></o:p></span></div>
<div class="MsoNoSpacing" style="margin-left: 36pt; text-align: left; text-indent: -18pt;">
<!--[if !supportLists]--><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">¡<span style="font-stretch: normal;">
</span><!--[endif]--><a href="http://msdn.microsoft.com/en-us/library/ms186950.aspx" target="_blank"><span style="text-decoration: none;">ENCRYPTBYASYMKEY</span></a>, which uses an asymmetric key to encrypt data<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: 17.75pt; margin: 12pt 0cm; text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">The decryption functions are:<o:p></o:p></span></div>
<div class="MsoNoSpacing" style="margin-left: 36pt; text-align: left; text-indent: -18pt;">
<!--[if !supportLists]--><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">¡<span style="font-stretch: normal;">
</span><!--[endif]--><a href="http://msdn.microsoft.com/en-us/library/ms181860.aspx" target="_blank"><span style="text-decoration: none;">DECRYPTBYKEY</span></a>,
which uses a symmetric key to decrypt data<o:p></o:p></span></div>
<div class="MsoNoSpacing" style="margin-left: 36pt; text-align: left; text-indent: -18pt;">
<!--[if !supportLists]--><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">¡<span style="font-stretch: normal;">
</span><!--[endif]--><a href="http://msdn.microsoft.com/en-us/library/ms178601.aspx" target="_blank"><span style="text-decoration: none;">DECRYPTBYCERT</span></a>,
which uses the private key of a certificate to decrypt data<o:p></o:p></span></div>
<div class="MsoNoSpacing" style="margin-left: 36pt; text-align: left; text-indent: -18pt;">
<!--[if !supportLists]--><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">¡<span style="font-stretch: normal;">
</span><!--[endif]--><a href="http://msdn.microsoft.com/en-us/library/ms188910.aspx" target="_blank"><span style="text-decoration: none;">DECRYPTBYPASSPHRASE</span></a>,
which uses a passphrase to decrypt data<o:p></o:p></span></div>
<div class="MsoNoSpacing" style="margin-left: 36pt; text-align: left; text-indent: -18pt;">
<!--[if !supportLists]--><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">¡<span style="font-stretch: normal;">
</span><!--[endif]--><a href="http://msdn.microsoft.com/en-us/library/ms189507.aspx" target="_blank"><span style="text-decoration: none;">DECRYPTBYASYMKEY</span></a>,
which uses an asymmetric key to decrypt data<o:p></o:p></span></div>
<div class="MsoNoSpacing" style="margin-left: 36pt; text-align: left; text-indent: -18pt;">
<!--[if !supportLists]--><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">¡<span style="font-stretch: normal;">
</span><!--[endif]--><a href="http://msdn.microsoft.com/en-us/library/ms365420.aspx" target="_blank"><span style="text-decoration: none;">DECRYPTBYKEYAUTOASYMKEY</span></a>,
which decrypts data by using a symmetric key that's automatically decrypted
with an asymmetric key<o:p></o:p></span></div>
<div class="MsoNoSpacing" style="margin-left: 36pt; text-align: left; text-indent: -18pt;">
<!--[if !supportLists]--><span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;">¡<span style="font-stretch: normal;">
</span><!--[endif]--><a href="http://msdn.microsoft.com/en-us/library/ms182559.aspx" target="_blank"><span style="text-decoration: none;">DECRYPTBYKEYAUTOCERT</span></a>,
which decrypts data by using a symmetric key that's automatically decrypted
with a certificate</span><o:p></o:p></span></div>
<div class="MsoListParagraphCxSpFirst" style="margin-left: 72pt; text-align: left;">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="text-align: left; text-indent: -18pt;">
<!--[if !supportLists]--><span style="font-family: Georgia, Times New Roman, serif;"><b><i style="background-color: cyan;"> 5)<span style="font-stretch: normal;"> </span>Transparent Data
Encryption</i></b><o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="text-align: left; text-indent: -18pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><b><i style="background-color: cyan;"><br /></i></b></span></div>
<div class="MsoListParagraphCxSpMiddle" style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;">The
entire database is encrypted both the data and the log files. Data at rest is
encrypted. Data transformation happens in memory by SQL server; thus the
application using the database need not bother about the encryption decryption
process. This feature is only available in Enterprise Edition. Backups of these
databases are also encrypted.</span><o:p></o:p></span></div>
<div class="MsoListParagraphCxSpLast" style="margin-left: 72pt; text-align: left;">
<br /></div>
<div class="MsoNormal" style="text-align: left;">
<span style="line-height: 115%;"><span style="font-family: Georgia, Times New Roman, serif;">In the
continued blogs we learn how to encrypt data using each of these techniques.<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="line-height: 115%;"><span style="font-family: Georgia, Times New Roman, serif;"><br /></span></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="line-height: 115%;"><span style="font-family: Georgia, Times New Roman, serif;">Windows
DPAPI<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><a href="https://msdn.microsoft.com/en-gb/library/ms995355.aspx"><span style="line-height: 115%;">https://msdn.microsoft.com/en-gb/library/ms995355.aspx</span></a><span style="line-height: 115%;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><a href="http://www.overclock.net/t/1293731/windows-data-protection-api-c-and-c"><span style="line-height: 115%;">http://www.overclock.net/t/1293731/windows-data-protection-api-c-and-c</span></a><span style="line-height: 115%;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="line-height: 115%;"><span style="font-family: Georgia, Times New Roman, serif;"><br /></span></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="line-height: 115%;"><span style="font-family: Georgia, Times New Roman, serif;">Encryption Hierarchy<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: left;">
<a href="https://msdn.microsoft.com/en-us/library/ms189586(v=sql.130).aspx" style="font-family: Georgia, 'Times New Roman', serif;"><span style="line-height: 115%;">https://msdn.microsoft.com/en-us/library/ms189586(v=sql.130).aspx</span></a></div>
<div class="MsoNormal" style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><a href="https://msdn.microsoft.com/en-us/library/ms189586(SQL.90).aspx"><span style="line-height: 115%;">https://msdn.microsoft.com/en-us/library/ms189586(SQL.90).aspx</span></a><span style="line-height: 115%;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="line-height: 115%;"><span style="font-family: Georgia, Times New Roman, serif;"><br /></span></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="line-height: 115%;"><span style="font-family: Georgia, Times New Roman, serif;">Choosing and
algorithm <o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><a href="https://msdn.microsoft.com/en-us/library/ms345262.aspx"><span style="line-height: 115%;">https://msdn.microsoft.com/en-us/library/ms345262.aspx</span></a><span style="line-height: 115%;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="line-height: 115%;"><span style="font-family: Georgia, Times New Roman, serif;"><br /></span></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="line-height: 115%;"><span style="font-family: Georgia, Times New Roman, serif;">Encryption
types<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><a href="http://sqlmag.com/database-security/sql-server-encryption"><span style="line-height: 115%;">http://sqlmag.com/database-security/sql-server-encryption</span></a><span style="line-height: 115%;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><a href="http://sqlmag.com/database-security/sql-server-encryption-options"><span style="line-height: 115%;">http://sqlmag.com/database-security/sql-server-encryption-options</span></a><span style="line-height: 115%;"><o:p></o:p></span></span></div>
<div style="text-align: left;">
</div>
<div class="MsoNormal" style="text-align: left;">
<span style="line-height: 115%;"><span style="font-family: Georgia, Times New Roman, serif;"><br /></span></span></div>
<div class="MsoNormal" style="text-align: left;">
<br /></div>
</div>
</div>
Krutihttp://www.blogger.com/profile/13385897521211871375noreply@blogger.com3tag:blogger.com,1999:blog-8195522014866487394.post-78684886192368281162015-09-28T17:44:00.001-07:002016-01-05T05:32:20.628-08:00Fixing MSI errors during patching<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="line-height: 115%;">Patching
is an activity that is frequently performed by DBAâs. It is the responsibility of a DBA to keep the SQL servers up and running all times and ensure the </span>Cumulative Updates, Service Packs, out of band hot-fixes are applied to the instances.Itâs hardly a 30 min task if it involves a cluster.
Procedure is simple download the patch, extract the files and run it on the nodes
(passive first) and bounce the services back to active node. </span></div>
<div style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">However every once
in a while itâs good to come across some errors and get in the tight spot of
now what? Take a look at the below error.</span></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPL1d6SFZ2zxoJMluO3DLIfFG0ZMBGPtR13uPW-RDQsgPhvzPimu6nR3_kyCkm1cYtNpypu1k3dmoQuCekjgrKnGwvnnLc-hRe02RE_9QWBcyXXwBZZKK7uaDPdrFLF7dtAK-0y7xap64/s1600/PatchError.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="273" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPL1d6SFZ2zxoJMluO3DLIfFG0ZMBGPtR13uPW-RDQsgPhvzPimu6nR3_kyCkm1cYtNpypu1k3dmoQuCekjgrKnGwvnnLc-hRe02RE_9QWBcyXXwBZZKK7uaDPdrFLF7dtAK-0y7xap64/s640/PatchError.jpg" width="640" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">As the error states a possible Windows Installer database
file (.msi) or the Windows Installer patch file (.msp) is missing from the
Windows Installer cache. This normally occurs when the setup is stopped mid-way
or due to file corruptions. Below is an amazing support link by Microsoft which
explains the cause and resolution for the above error. It also provides a vb
script FindSQLInstalls.vbs that helps find the missing .msi and .msp files. </span><o:p></o:p></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><b><i style="background-color: cyan;">Step 1: Follow the <span style="line-height: 115%;">Microsoft support link</span></i></b></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><b><i style="background-color: cyan;"><span style="line-height: 115%;"><br /></span></i></b></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><a href="https://support.microsoft.com/en-gb/kb/969052#/en-gb/kb/969052">https://support.microsoft.com/en-gb/kb/969052#/en-gb/kb/969052</a></span><o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="text-align: left;">
<span style="line-height: 115%;"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">When
the script is run with admin privileges the log generated directs from where to
copy the missing files (SourceFolder) and where to place them (Destination Folder). The <RootDrive> is location
from where the setup was run or the patch files exists. They could be on
different drives as well. If you observe carefully the folder <SQL Server
**** DO_NO_DELETE> gets created on new installation to the respective drive.</span></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="line-height: 115%;"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="line-height: 115%;"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Most of the times the source folder will look as follows</span></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="line-height: 115%;"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></span></div>
<h3 style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif; font-size: small;"><i>Source Folder :(RootDrive)\x64\setup\</i></span></h3>
<div>
<span style="font-family: Georgia, Times New Roman, serif; font-size: small;"><i><br /></i></span></div>
<h3 style="text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiS03y24o_gCz6fGHRToz4apQLAiBd34shLp9KWbXBXtBYZCZ2srCWC3BuPiKzfLSlnuLTmIibTJtoftLV1BvSwozh5k0Yk7UUtV1StRQ1lvQMKwC8PtF3WA6ZFnM4mRj71w37yfwKbroA/s1600/x64_setup.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiS03y24o_gCz6fGHRToz4apQLAiBd34shLp9KWbXBXtBYZCZ2srCWC3BuPiKzfLSlnuLTmIibTJtoftLV1BvSwozh5k0Yk7UUtV1StRQ1lvQMKwC8PtF3WA6ZFnM4mRj71w37yfwKbroA/s1600/x64_setup.jpg" /></a></h3>
<div>
</div>
<div style="text-align: left;">
<i style="font-family: Georgia, 'Times New Roman', serif; font-size: medium;"><b>Source Folder :(RootDrive)\1033_ENU_LP\x64\setup\</b></i></div>
<div>
<i style="font-family: Georgia, 'Times New Roman', serif; font-size: medium;"><br /></i></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTZighEW6-ZFxro5AllKEe4bI1ZLIS9w6X1anJ0Hu0asf1JgXhQ2hvc-B2YqjcvYauKhN_JC0ewMwsA9_6NMeLy457TrQKM1seP0JTbzoHHfSRkgTKQcyc3JlWD99HU5Fd5yNoXVTkmeM/s1600/1033_x64_setup.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTZighEW6-ZFxro5AllKEe4bI1ZLIS9w6X1anJ0Hu0asf1JgXhQ2hvc-B2YqjcvYauKhN_JC0ewMwsA9_6NMeLy457TrQKM1seP0JTbzoHHfSRkgTKQcyc3JlWD99HU5Fd5yNoXVTkmeM/s1600/1033_x64_setup.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h3 style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif; font-size: small;"><i>Destination
folder - C:\Windows\Installer</i></span></h3>
<h3 style="text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmWqqoYN03iKR0FR95q2zFEZ1HR9p2t9Pb-UXar-wvMeURkY6zmhGOduQboQUYqHb4SusTZ_zCL24uG5iyPVg42Z2tHR3DOYmkF24S28ZgSxwoHrWn2JoVC3bXHGRjSZmvR8WtdjAkVp8/s1600/Destination.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmWqqoYN03iKR0FR95q2zFEZ1HR9p2t9Pb-UXar-wvMeURkY6zmhGOduQboQUYqHb4SusTZ_zCL24uG5iyPVg42Z2tHR3DOYmkF24S28ZgSxwoHrWn2JoVC3bXHGRjSZmvR8WtdjAkVp8/s1600/Destination.jpg" /></a></h3>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;">In the scenario that was encountered the files were missing even at the path mentioned by the log generated with FindSQLInstalls.vbs for source locations. So what next ?<br /><br /><b><i style="background-color: cyan;">Step 2: Try uninstall âre-install</i></b></span></span><br />
<div class="MsoNormal" style="text-align: left;">
<span style="font-family: Georgia, 'Times New Roman', serif;"><span style="color: #444444;"><br /></span></span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Well now that we donât have the files mentioned at the
source location we look through search option. After searching for the files on the
local machine on all other drives as well we fail to find them. So now we are stuck. Next option
at hand is uninstall-re-install. Obviously take the mandate backups of databases
system as well as users. Take backups of reporting servers if configured. Back up any other files which will be cleared during uninstall. When trying to uninstall
SQL server we get the below error.</span><o:p></o:p></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGuChbrALRhom3dlOmOrE9xagsgMh60Ss3QyA8tEOjfik366L9AbhJxPCYuDvJKhvGJjbZd9utsGNKiKq_V89Kw1pbz73dgf3xF8ufnwffLlVFYldTUkO67RZpfQL7IYdc99nBR_Hpvz4/s1600/uninstall+error.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGuChbrALRhom3dlOmOrE9xagsgMh60Ss3QyA8tEOjfik366L9AbhJxPCYuDvJKhvGJjbZd9utsGNKiKq_V89Kw1pbz73dgf3xF8ufnwffLlVFYldTUkO67RZpfQL7IYdc99nBR_Hpvz4/s1600/uninstall+error.jpg" /></a></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="background-color: cyan; line-height: 115%;"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><b><i>Step
3: Uninstall each SQL components from add or remove programs under control
panel.</i></b></span></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="background-color: cyan; line-height: 115%;"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><b><i><br /></i></b></span></span></div>
<div class="MsoNormal" style="text-align: left;">
W<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">ell it doesnât get easy does it? But have to fix it so we
try this and again we get an error.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixkMsV2wmG_Uti__czbSAVBu6jX3WflPtvYPaow172olDsbvajtZTQW4L_5Cx40YecDZRTdfihcEqT2ri99mE5Cc2Phtkzo5hiSq3_Ap7W0Gska6AVCgLJKw4EfYCDxOAwGtVqrNza3XA/s1600/browselocation.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixkMsV2wmG_Uti__czbSAVBu6jX3WflPtvYPaow172olDsbvajtZTQW4L_5Cx40YecDZRTdfihcEqT2ri99mE5Cc2Phtkzo5hiSq3_Ap7W0Gska6AVCgLJKw4EfYCDxOAwGtVqrNza3XA/s1600/browselocation.jpg" /></a></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">At this point of time we created a new folder with a clean copy of setup files and point the browser to the new location with the new setup files it still would not take the path.</span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitC_rbF8sf-ng9o8e8BEuxIYXkhazvZs1A6fqOAYoEUIu8AryHIiVBvY5ku3k_Ul6j07i1UUaASx5fWsIwQbeP5WREbvv9gJdSXM6Gvg06tVRH7yQAYwjFZySAruB3EpikgwVW4R6pvYY/s1600/newlocation.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitC_rbF8sf-ng9o8e8BEuxIYXkhazvZs1A6fqOAYoEUIu8AryHIiVBvY5ku3k_Ul6j07i1UUaASx5fWsIwQbeP5WREbvv9gJdSXM6Gvg06tVRH7yQAYwjFZySAruB3EpikgwVW4R6pvYY/s1600/newlocation.jpg" /></a></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<o:p></o:p></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><i><b><span style="background-color: #e06666;">Step 4: Do not panic and do not try this on production
servers.</span></b></i><span style="color: #444444;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Almost about to give up after this error when we do what we
are not supposed to do. If you have read above Microsoft link carefully it clearly
states missing files cannot be copied between computers, because they are
unique. We still proceeded with trying to cheat the computer and copied those
files from a different server. </span></div>
<h4 style="text-align: left;">
<span style="color: red;"><span style="font-family: Georgia, Times New Roman, serif;"><br /></span></span></h4>
<h4 style="text-align: left;">
<span style="color: red;"><span style="font-family: Georgia, Times New Roman, serif;">Warning: Never try this on production servers. Be prepared
for an instance crash as well.</span></span></h4>
<h4 style="text-align: left;">
<span style="color: red;"><span style="font-family: Georgia, Times New Roman, serif;">End result: Corruption of files under C:\windows\installer
directory.</span></span></h4>
<div>
<span style="color: red;"><span style="font-family: Georgia, Times New Roman, serif;"><br /></span></span></div>
<div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><b><i style="background-color: cyan;">Step 5: Undo step 4</i></b><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><b><i style="background-color: cyan;"><br /></i></b></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Thankfully we had made a note of which files were copied & where the files
were copied from one computer to another and deleted them. Not knowing that the system was smart enough to understand we tried to cheat it. It had also
created some files of its own under C:\Windows\Installer directory.</span><o:p></o:p></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4W83s9PKJIU5Rpwqhv2zz0quqzJ8vBLH0kg_4GLHjk_Id5gSJjFHEn7Q_4A9gtBP0V92tzsDYe-F4mala7z-j6IwDyk-xuWvra1sFDU3IWtSpwZSB44dxn7hezN6GjYuoZqAdAh3mmzo/s1600/Corrupted+files.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjblrMa8UAKw-E8UlYMGDRTmYXoJxwYJF4YjVpHGH2Zca7xIadES8Jdc23wZvh_2-kNKRC9hLdei7dUeU9To5lEnoS17MKfWsYQTszxYZrAuPHBy1e8sFb-uOpfqQ8zfkb6i9BAejxbgSk/s1600/Corrupted+files.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjblrMa8UAKw-E8UlYMGDRTmYXoJxwYJF4YjVpHGH2Zca7xIadES8Jdc23wZvh_2-kNKRC9hLdei7dUeU9To5lEnoS17MKfWsYQTszxYZrAuPHBy1e8sFb-uOpfqQ8zfkb6i9BAejxbgSk/s1600/Corrupted+files.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">So now we are back at step 3 with even more corruption.</span></div>
<div style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><i><b style="background-color: cyan;">Step 6: Look up registry commands</b></i></span><o:p></o:p></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><i><b style="background-color: cyan;"><br /></b></i></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Desparate to fix this I try to uninstall the instance again. Get the below error</span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyGgzl4z7wDBu_uSQ2l7y6yFAQGp4bwNlTLp_oUZIwHEK3cAA7NT7Tyb9VQAn8ObD7-P0XYMmGiJOZC1FDjOn1xWZIj6dqTGxtwFF55xk4XnWNXiWpqvYqQbhLMn4rtEDkiNSY1v-DwnA/s1600/Summary+logs.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyGgzl4z7wDBu_uSQ2l7y6yFAQGp4bwNlTLp_oUZIwHEK3cAA7NT7Tyb9VQAn8ObD7-P0XYMmGiJOZC1FDjOn1xWZIj6dqTGxtwFF55xk4XnWNXiWpqvYqQbhLMn4rtEDkiNSY1v-DwnA/s1600/Summary+logs.jpg" /></a></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Since we corrupted the files this time it did not tell us which files were skipped or missed the setup just shut down with the above message. At this point of time I </span><span style="color: #444444; font-family: Georgia, 'Times New Roman', serif;">was able to look up Aaron Bertrands blogs for
uninstallation instruction for SQL server evaluation edition.</span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><a href="http://sqlblog.com/blogs/aaron_bertrand/archive/2010/10/25/fun-with-software-uninstalling-sql-server-2008-r2-evaluation-edition.aspx">http://sqlblog.com/blogs/aaron_bertrand/archive/2010/10/25/fun-with-software-uninstalling-sql-server-2008-r2-evaluation-edition.aspx</a><o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
</div>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Prior to executing any of the below step I recommend one to go through these links as well</span></div>
<div>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><a href="https://support.microsoft.com/en-us/kb/314481#/en-us/kb/314481">https://support.microsoft.com/en-us/kb/314481#/en-us/kb/314481</a></span></div>
<div>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><a href="https://msdn.microsoft.com/en-us/library/aa372105(v=vs.85).aspx">https://msdn.microsoft.com/en-us/library/aa372105(v=vs.85).aspx</a></span></div>
<div>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><a href="https://msdn.microsoft.com/en-us/library/ms954376.aspx">https://msdn.microsoft.com/en-us/library/ms954376.aspx</a></span></div>
<div>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Now we proceed to lookup the registry mentioned in Aaron's blog to locate all of the SQL server -related GUIDs </span></div>
<div style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><br /><span style="background-color: yellow; line-height: 115%;">HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\</span></span></div>
<div>
<div class="MsoNormal" style="text-align: left;">
<span style="line-height: 115%;"><span style="font-family: Georgia, Times New Roman, serif;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><b><i style="background-color: cyan;"><br /></i></b></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2ZqVgn0_TVBKwbPP_C6YS9xphvp-2kl-sU-2RE1jX9CxLOu_ZwPml0-Gt58O8y097zWq9UnF65js0l3kXmIvJLFZVulV7qFUIgwCaeMyhkLyD0Bxhnng5WhSXSY8dFzeVBIvGGzhZHto/s1600/registrycheck.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="280" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2ZqVgn0_TVBKwbPP_C6YS9xphvp-2kl-sU-2RE1jX9CxLOu_ZwPml0-Gt58O8y097zWq9UnF65js0l3kXmIvJLFZVulV7qFUIgwCaeMyhkLyD0Bxhnng5WhSXSY8dFzeVBIvGGzhZHto/s640/registrycheck.jpg" width="640" /></a></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><b><i style="background-color: cyan;"><br /></i></b></span></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">We go through each folder, note
down the display name and uninstall string msiexec.exe command for all SQL related GUID's.</span></div>
<div style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><b><i style="background-color: cyan;">Step 7: Fix the components with registry</i></b><o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">In Aaron blogs he wanted to uninstall the instance. We on
the other hand are just trying to patch the existing one which we managed to corrupt
further. So letâs fix what we broke. We have already copied the clean setup files in the root drive. </span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDqOZRZVFfYU9FRambTUq1I22_TLmRPqJAo_XKuj0nTo2buZxKPrXi_X4QNbRdp5u4S_26RBdPNeqqwxbX6rc5tyWHF0Xdlq6UzM-g-shSrYv9mc4AIJwnra1hMIBWH2GWFxYnIFKr4pw/s1600/newlocation.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDqOZRZVFfYU9FRambTUq1I22_TLmRPqJAo_XKuj0nTo2buZxKPrXi_X4QNbRdp5u4S_26RBdPNeqqwxbX6rc5tyWHF0Xdlq6UzM-g-shSrYv9mc4AIJwnra1hMIBWH2GWFxYnIFKr4pw/s1600/newlocation.jpg" /></a></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">We do not run the setup just extract all the files. Next we run the misexec.exe
command for each component. Again it throws me the windows installer error.</span><o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5pZdHTpbaTGbyejo-0eUPcWh3pakjeb4zhfnTjLNr5y4yrdFEKobok4m2g-PMmxZyutNI4dPUH2xMy67Pi5GiwQg4M-uAzjFjxFq9Sc0zsO4b-sBTlZy_JxwWeQj4HgDARvG95Q8xt_g/s1600/browselocation.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5pZdHTpbaTGbyejo-0eUPcWh3pakjeb4zhfnTjLNr5y4yrdFEKobok4m2g-PMmxZyutNI4dPUH2xMy67Pi5GiwQg4M-uAzjFjxFq9Sc0zsO4b-sBTlZy_JxwWeQj4HgDARvG95Q8xt_g/s1600/browselocation.jpg" /></a></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">We click on OK to see which file its asking for ? Next we go to
the new setup files location where we have our setup files extracted. This time it agrees to take the path and we hit OK.</span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZq3_YmsNULwbSiuTUE4s6_HXzVrPTarSTopHOv3COYc1Vx9BgciXWCRL9l8HaegFomctd6sFplzZKDBLP1fOWfwjTa2gi5Zq_HFjsJd0siRHuh1AOjy0Lya6bmQkHnw2VBJ4iuwLxL5I/s1600/Feature+Installation.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZq3_YmsNULwbSiuTUE4s6_HXzVrPTarSTopHOv3COYc1Vx9BgciXWCRL9l8HaegFomctd6sFplzZKDBLP1fOWfwjTa2gi5Zq_HFjsJd0siRHuh1AOjy0Lya6bmQkHnw2VBJ4iuwLxL5I/s1600/Feature+Installation.jpg" /></a></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><i><b style="background-color: cyan;"><br /></b></i></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><i><b style="background-color: cyan;"><br /></b></i></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><i><b style="background-color: cyan;"><br /></b></i></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><i><b style="background-color: cyan;"><br /></b></i></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><i><b style="background-color: cyan;"><br /></b></i></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><i><b style="background-color: cyan;"><br /></b></i></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><i><b style="background-color: cyan;"><br /></b></i></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><i><b style="background-color: cyan;"><br /></b></i></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><i><b style="background-color: cyan;"><br /></b></i></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><i><b style="background-color: cyan;"><br /></b></i></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><i><b style="background-color: cyan;"><br /></b></i></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><i><b style="background-color: cyan;"><br /></b></i></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><i><b style="background-color: cyan;"><br /></b></i></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><i><b style="background-color: cyan;"><br /></b></i></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><i><b style="background-color: cyan;"><br /></b></i></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><i><b style="background-color: cyan;"><br /></b></i></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><i><b style="background-color: cyan;"><br /></b></i></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><i><b style="background-color: cyan;"><br /></b></i></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><i><b style="background-color: cyan;"><br /></b></i></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><i><b style="background-color: cyan;"><br /></b></i></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><i><b style="background-color: cyan;"><br /></b></i></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><i><b style="background-color: cyan;"><br /></b></i></span></div>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /><br /><br /><br /><br />This time it installs the feature successfully and creates the GUID files under C:\Windows\Installer as well.</span><br />
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><i><b style="background-color: cyan;"><br /></b></i></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><i><b style="background-color: cyan;">Step 8 : Try to run the patch again.</b></i></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Now that we have fixed all the individual components we have
all the files required by windows installer for upgrade.Hence we proceed with
running the patch once again. This time we are able to do it successfully.</span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtbwU6uNbsZ8oNn2cn5VKnuJGvIgcNUcI23wmY7rL0R0i8wVBUPdaTABotdEtOX822a4yp6gPvsFngJ4hFJ3FEQUf-JdzKc1uk6HZJJiQJD72I1_c_Q0ZMZ2qpR2G3Dw1DMFMxXeBSUQ4/s1600/completion+message.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtbwU6uNbsZ8oNn2cn5VKnuJGvIgcNUcI23wmY7rL0R0i8wVBUPdaTABotdEtOX822a4yp6gPvsFngJ4hFJ3FEQUf-JdzKc1uk6HZJJiQJD72I1_c_Q0ZMZ2qpR2G3Dw1DMFMxXeBSUQ4/s640/completion+message.jpg" width="640" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtbwU6uNbsZ8oNn2cn5VKnuJGvIgcNUcI23wmY7rL0R0i8wVBUPdaTABotdEtOX822a4yp6gPvsFngJ4hFJ3FEQUf-JdzKc1uk6HZJJiQJD72I1_c_Q0ZMZ2qpR2G3Dw1DMFMxXeBSUQ4/s1600/completion+message.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtbwU6uNbsZ8oNn2cn5VKnuJGvIgcNUcI23wmY7rL0R0i8wVBUPdaTABotdEtOX822a4yp6gPvsFngJ4hFJ3FEQUf-JdzKc1uk6HZJJiQJD72I1_c_Q0ZMZ2qpR2G3Dw1DMFMxXeBSUQ4/s1600/completion+message.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtbwU6uNbsZ8oNn2cn5VKnuJGvIgcNUcI23wmY7rL0R0i8wVBUPdaTABotdEtOX822a4yp6gPvsFngJ4hFJ3FEQUf-JdzKc1uk6HZJJiQJD72I1_c_Q0ZMZ2qpR2G3Dw1DMFMxXeBSUQ4/s1600/completion+message.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtbwU6uNbsZ8oNn2cn5VKnuJGvIgcNUcI23wmY7rL0R0i8wVBUPdaTABotdEtOX822a4yp6gPvsFngJ4hFJ3FEQUf-JdzKc1uk6HZJJiQJD72I1_c_Q0ZMZ2qpR2G3Dw1DMFMxXeBSUQ4/s1600/completion+message.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtbwU6uNbsZ8oNn2cn5VKnuJGvIgcNUcI23wmY7rL0R0i8wVBUPdaTABotdEtOX822a4yp6gPvsFngJ4hFJ3FEQUf-JdzKc1uk6HZJJiQJD72I1_c_Q0ZMZ2qpR2G3Dw1DMFMxXeBSUQ4/s1600/completion+message.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtbwU6uNbsZ8oNn2cn5VKnuJGvIgcNUcI23wmY7rL0R0i8wVBUPdaTABotdEtOX822a4yp6gPvsFngJ4hFJ3FEQUf-JdzKc1uk6HZJJiQJD72I1_c_Q0ZMZ2qpR2G3Dw1DMFMxXeBSUQ4/s1600/completion+message.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtbwU6uNbsZ8oNn2cn5VKnuJGvIgcNUcI23wmY7rL0R0i8wVBUPdaTABotdEtOX822a4yp6gPvsFngJ4hFJ3FEQUf-JdzKc1uk6HZJJiQJD72I1_c_Q0ZMZ2qpR2G3Dw1DMFMxXeBSUQ4/s1600/completion+message.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtbwU6uNbsZ8oNn2cn5VKnuJGvIgcNUcI23wmY7rL0R0i8wVBUPdaTABotdEtOX822a4yp6gPvsFngJ4hFJ3FEQUf-JdzKc1uk6HZJJiQJD72I1_c_Q0ZMZ2qpR2G3Dw1DMFMxXeBSUQ4/s1600/completion+message.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtbwU6uNbsZ8oNn2cn5VKnuJGvIgcNUcI23wmY7rL0R0i8wVBUPdaTABotdEtOX822a4yp6gPvsFngJ4hFJ3FEQUf-JdzKc1uk6HZJJiQJD72I1_c_Q0ZMZ2qpR2G3Dw1DMFMxXeBSUQ4/s1600/completion+message.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtbwU6uNbsZ8oNn2cn5VKnuJGvIgcNUcI23wmY7rL0R0i8wVBUPdaTABotdEtOX822a4yp6gPvsFngJ4hFJ3FEQUf-JdzKc1uk6HZJJiQJD72I1_c_Q0ZMZ2qpR2G3Dw1DMFMxXeBSUQ4/s1600/completion+message.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtbwU6uNbsZ8oNn2cn5VKnuJGvIgcNUcI23wmY7rL0R0i8wVBUPdaTABotdEtOX822a4yp6gPvsFngJ4hFJ3FEQUf-JdzKc1uk6HZJJiQJD72I1_c_Q0ZMZ2qpR2G3Dw1DMFMxXeBSUQ4/s1600/completion+message.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtbwU6uNbsZ8oNn2cn5VKnuJGvIgcNUcI23wmY7rL0R0i8wVBUPdaTABotdEtOX822a4yp6gPvsFngJ4hFJ3FEQUf-JdzKc1uk6HZJJiQJD72I1_c_Q0ZMZ2qpR2G3Dw1DMFMxXeBSUQ4/s1600/completion+message.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtbwU6uNbsZ8oNn2cn5VKnuJGvIgcNUcI23wmY7rL0R0i8wVBUPdaTABotdEtOX822a4yp6gPvsFngJ4hFJ3FEQUf-JdzKc1uk6HZJJiQJD72I1_c_Q0ZMZ2qpR2G3Dw1DMFMxXeBSUQ4/s1600/completion+message.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtbwU6uNbsZ8oNn2cn5VKnuJGvIgcNUcI23wmY7rL0R0i8wVBUPdaTABotdEtOX822a4yp6gPvsFngJ4hFJ3FEQUf-JdzKc1uk6HZJJiQJD72I1_c_Q0ZMZ2qpR2G3Dw1DMFMxXeBSUQ4/s1600/completion+message.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a></span></div>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><o:p></o:p></span><br />
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, 'Times New Roman', serif;">Mission accomplished & a lesson well learnt ........ </span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
</div>
<div class="MsoNormal" style="text-align: left;">
</div>
<div class="MsoNormal" style="text-align: left;">
<o:p></o:p></div>
</div>
<div class="MsoNormal">
<o:p></o:p></div>
</div>
Krutihttp://www.blogger.com/profile/13385897521211871375noreply@blogger.com1tag:blogger.com,1999:blog-8195522014866487394.post-15945002584646102382015-09-27T18:35:00.004-07:002016-01-05T05:30:54.593-08:00Table partitioning<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal">
<h3 style="text-align: left;">
<b><i><span style="font-family: Georgia, Times New Roman, serif; line-height: 115%;">What is partitioning.</span></i></b></h3>
</div>
<div style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;">To start with partition is the feature provided by SQL server in which very large tables are split between multiple files and file-groups for ease of access and faster retrieval/ update purposes.</span><span style="font-family: Georgia, Times New Roman, serif;"><br /></span><span style="font-family: Georgia, Times New Roman, serif;">Consider a table which consists of millions of records. When we insert all the records in one table, in one file; retrieval or update time for any of the record even if it involves index seek is considerably high. A better option would be to split the table based on certain column values. Let the data be spread across multiple file-groups.<br /> </span><span style="font-family: Georgia, Times New Roman, serif;"><br /></span><span style="font-family: Georgia, Times New Roman, serif;">When a search condition is encountered comprising on that column value SQL server will now have to look at smaller chunks of data of any one of those multiple files, thus resulting faster retrieval and execution time.</span></div>
<div class="MsoNormal" style="text-align: left;">
<b><i><u><span style="font-family: Georgia, Times New Roman, serif; line-height: 115%;"><br /></span></u></i></b></div>
<div class="MsoNormal" style="text-align: left;">
<h3 style="text-align: left;">
<b><i><span style="font-family: Georgia, Times New Roman, serif; line-height: 115%;">How to create partitions</span></i></b></h3>
<div>
<b><i><span style="font-family: Georgia, Times New Roman, serif; line-height: 115%;"><br /></span></i></b></div>
</div>
<div class="MsoNormal" style="text-align: left;">
<div style="text-align: left;">
<span style="background-color: cyan; color: #444444; font-family: Georgia, Times New Roman, serif; line-height: 115%;"><b><i>Step 1: Create File Groups</i></b></span></div>
</div>
<div class="MsoNormal" style="text-align: left;">
<b><i><span style="color: #444444; font-family: Georgia, Times New Roman, serif; line-height: 115%;"><br /></span></i></b></div>
<div class="MsoNormal" style="text-align: left;">
</div>
<div class="MsoNormal">
<div style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><span style="font-family: Georgia, Times New Roman, serif;">Obviously we shall
first begin with creating different file groups and allocating files to each
group. This can be done from the management studio as follows under the
Database Property-> Filegroups Sectio</span>n </span></div>
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"></span></div>
<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/AVvXsEh_GXi0KVSMrUDLxSQ54KThSLa67eyx1Hh8aUYr8EICXcX3wq_j1Yf5evriaeQHwkByvu5PF9kpwI4-mdmSe-Ab-y9JeJ3MYfXBh9zrWHJ3nGcDWxQC39vSDN5DasrmgPgGogrLZbnDkKY/s1600/FileGroups.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_GXi0KVSMrUDLxSQ54KThSLa67eyx1Hh8aUYr8EICXcX3wq_j1Yf5evriaeQHwkByvu5PF9kpwI4-mdmSe-Ab-y9JeJ3MYfXBh9zrWHJ3nGcDWxQC39vSDN5DasrmgPgGogrLZbnDkKY/s400/FileGroups.jpg" width="400" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<div class="MsoNormal">
<b><i><span style="font-family: Georgia, serif; font-size: 10pt; line-height: 115%;"><br /></span></i></b></div>
<div class="MsoNormal" style="text-align: left;">
<b><i><span style="color: #444444; font-family: Georgia, Times New Roman, serif; line-height: 115%;"><br /></span></i></b></div>
<div class="MsoNormal" style="text-align: left;">
<b><i><span style="color: #444444; font-family: Georgia, Times New Roman, serif; line-height: 115%;"><span style="background-color: cyan;">Step 2: Assign files to these groups</span><o:p></o:p></span></i></b></div>
<div class="MsoNormal" style="text-align: left;">
<b><i><span style="color: #444444; font-family: Georgia, Times New Roman, serif; line-height: 115%;"><br /></span></i></b></div>
<div style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">Next step is creating files and assigning them to these groups.</span> </span><span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">We may assign multiple files to one file group. SQL server will use proportional fill algorithm when data is
inserted into these files.Below image depicts one file assigned to each groups.</span></span></div>
<div style="text-align: left;">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg97u03neRZuaHNkCC3kQsP5SIWkkWW9DZU3OtmlKENaQzGqgpo4cmrYR95EBOx_MFd0v_tkjC6-iNLlBlFcSiRC-2mK92th-AY07nSRZ5IKsZjjKq9AnN11unB2536IxTLcG8w9B97VmA/s1600/FinalFilesandgroups.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="341" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg97u03neRZuaHNkCC3kQsP5SIWkkWW9DZU3OtmlKENaQzGqgpo4cmrYR95EBOx_MFd0v_tkjC6-iNLlBlFcSiRC-2mK92th-AY07nSRZ5IKsZjjKq9AnN11unB2536IxTLcG8w9B97VmA/s400/FinalFilesandgroups.jpg" width="400" /></a></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<div style="text-align: left;">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">If you love coding
below is the T-SQL for the same</span><o:p></o:p></span></div>
</div>
<div class="MsoNormal">
<br /></div>
<div style="border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 1.0pt 4.0pt 1.0pt 4.0pt;">
<div class="MsoNormal" style="border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<span style="color: blue; font-family: Consolas;">USE</span><span style="font-family: Consolas;"> [master]<o:p></o:p></span></div>
<div class="MsoNormal" style="border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<span style="color: blue; font-family: Consolas;">GO</span><span style="font-family: Consolas;"><o:p></o:p></span></div>
<div class="MsoNormal" style="border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<span style="color: blue; font-family: Consolas;">ALTER</span><span style="font-family: Consolas;"> <span style="color: blue;">DATABASE</span>
[test] <span style="color: blue;">ADD</span> <span style="color: blue;">FILEGROUP</span>
[F1]<o:p></o:p></span></div>
<div class="MsoNormal" style="border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<span style="color: blue; font-family: Consolas;">GO</span><span style="font-family: Consolas;"><o:p></o:p></span></div>
<div class="MsoNormal" style="border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<span style="color: blue; font-family: Consolas;">ALTER</span><span style="font-family: Consolas;"> <span style="color: blue;">DATABASE</span>
[test] <span style="color: blue;">ADD</span> <span style="color: blue;">FILE </span><span style="color: grey;">(</span> NAME <span style="color: grey;">=</span> <span style="color: red;">N'Test1'</span><span style="color: grey;">,</span> <span style="color: blue;">FILENAME</span> <span style="color: grey;">=</span> <span style="color: red;">N'c:\Program Files\Microsoft SQL
Server\MSSQL11.SQL\MSSQL\DATA\Test1.ndf'</span> <span style="color: grey;">,</span>
SIZE <span style="color: grey;">=</span> 5120KB <span style="color: grey;">,</span>
FILEGROWTH <span style="color: grey;">=</span> 10<span style="color: grey;">%)</span>
<span style="color: blue;">TO</span> <span style="color: blue;">FILEGROUP</span>
[F1]<o:p></o:p></span></div>
<div class="MsoNormal" style="border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<span style="color: blue; font-family: Consolas;">GO</span><span style="font-family: Consolas;"><o:p></o:p></span></div>
<div class="MsoNormal" style="border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<span style="color: blue; font-family: Consolas;">ALTER</span><span style="font-family: Consolas;"> <span style="color: blue;">DATABASE</span>
[test] <span style="color: blue;">ADD</span> <span style="color: blue;">FILEGROUP</span>
[F2]<o:p></o:p></span></div>
<div class="MsoNormal" style="border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<span style="color: blue; font-family: Consolas;">GO</span><span style="font-family: Consolas;"><o:p></o:p></span></div>
<div class="MsoNormal" style="border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<span style="color: blue; font-family: Consolas;">ALTER</span><span style="font-family: Consolas;"> <span style="color: blue;">DATABASE</span>
[test] <span style="color: blue;">ADD</span> <span style="color: blue;">FILE </span><span style="color: grey;">(</span> NAME <span style="color: grey;">=</span> <span style="color: red;">N'Test2'</span><span style="color: grey;">,</span> <span style="color: blue;">FILENAME</span> <span style="color: grey;">=</span> <span style="color: red;">N'c:\Program Files\Microsoft SQL
Server\MSSQL11.SQL\MSSQL\DATA\Test2.ndf'</span> <span style="color: grey;">,</span>
SIZE <span style="color: grey;">=</span> 5120KB <span style="color: grey;">,</span>
FILEGROWTH <span style="color: grey;">=</span> 10<span style="color: grey;">%)</span>
<span style="color: blue;">TO</span> <span style="color: blue;">FILEGROUP</span>
[F2]<o:p></o:p></span></div>
<div class="MsoNormal" style="border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<span style="color: blue; font-family: Consolas;">GO</span><span style="font-family: Consolas;"><o:p></o:p></span></div>
<div class="MsoNormal" style="border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<span style="color: blue; font-family: Consolas;">ALTER</span><span style="font-family: Consolas;"> <span style="color: blue;">DATABASE</span>
[test] <span style="color: blue;">ADD</span> <span style="color: blue;">FILEGROUP</span>
[F3]<o:p></o:p></span></div>
<div class="MsoNormal" style="border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<span style="color: blue; font-family: Consolas;">GO</span><span style="font-family: Consolas;"><o:p></o:p></span></div>
<div class="MsoNormal" style="border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<span style="color: blue; font-family: Consolas;">ALTER</span><span style="font-family: Consolas;"> <span style="color: blue;">DATABASE</span>
[test] <span style="color: blue;">ADD</span> <span style="color: blue;">FILE </span><span style="color: grey;">(</span> NAME <span style="color: grey;">=</span> <span style="color: red;">N'Test3'</span><span style="color: grey;">,</span> <span style="color: blue;">FILENAME</span> <span style="color: grey;">=</span> <span style="color: red;">N'c:\Program Files\Microsoft SQL Server\MSSQL11.SQL\MSSQL\DATA\Test3.ndf'</span>
<span style="color: grey;">,</span> SIZE <span style="color: grey;">=</span> 5120KB
<span style="color: grey;">,</span> FILEGROWTH <span style="color: grey;">=</span>
10<span style="color: grey;">%)</span> <span style="color: blue;">TO</span> <span style="color: blue;">FILEGROUP</span> [F3]<o:p></o:p></span></div>
<div class="MsoNormal" style="border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<span style="color: blue; font-family: Consolas;">GO</span><span style="font-family: Consolas;"><o:p></o:p></span></div>
<div class="MsoNormal" style="border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<span style="color: blue; font-family: Consolas;">ALTER</span><span style="font-family: Consolas;"> <span style="color: blue;">DATABASE</span>
[test] <span style="color: blue;">ADD</span> <span style="color: blue;">FILEGROUP</span>
[F4]<o:p></o:p></span></div>
<div class="MsoNormal" style="border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<span style="color: blue; font-family: Consolas;">GO</span><span style="font-family: Consolas;"><o:p></o:p></span></div>
<div class="MsoNormal" style="border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<span style="color: blue; font-family: Consolas;">ALTER</span><span style="font-family: Consolas;"> <span style="color: blue;">DATABASE</span>
[test] <span style="color: blue;">ADD</span> <span style="color: blue;">FILE </span><span style="color: grey;">(</span> NAME <span style="color: grey;">=</span> <span style="color: red;">N'Test4'</span><span style="color: grey;">,</span> <span style="color: blue;">FILENAME</span> <span style="color: grey;">=</span> <span style="color: red;">N'c:\Program Files\Microsoft SQL Server\MSSQL11.SQL\MSSQL\DATA\Test4.ndf'</span>
<span style="color: grey;">,</span> SIZE <span style="color: grey;">=</span> 5120KB
<span style="color: grey;">,</span> FILEGROWTH <span style="color: grey;">=</span>
10<span style="color: grey;">%)</span> <span style="color: blue;">TO</span> <span style="color: blue;">FILEGROUP</span> [F4]<o:p></o:p></span></div>
<div class="MsoNormal" style="border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<span style="color: blue; font-family: Consolas;">GO</span><span style="font-family: Consolas;"><o:p></o:p></span></div>
<div class="MsoNormal" style="border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<br /></div>
</div>
<div class="MsoNormal">
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: cyan; color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<b><i><span style="color: #444444; font-family: Georgia, Times New Roman, serif; line-height: 115%;"><span style="background-color: cyan;">Step 3: Deciding the column for
partition</span><o:p></o:p></span></i></b></div>
<div class="MsoNormal">
<b><i><span style="color: #444444; font-family: Georgia, Times New Roman, serif; line-height: 115%;"><br /></span></i></b></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
</div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Next step is for us
to decide the criteria on which data will be partitioned. Ideally tables that
contain historic data are partitioned. In our example we will be implementing
this for similar OrderDetail Table. Data will be partitioned based on OrderDate.
Structure is as follows.</span><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_lg_ZtU_4b3bI9vNDkV6Psi28HOhLqJrowM9g1npAFiBq27_fX6tlJ-fy3kfQgLXocJGVZfiKf10i-FUqedqkoksyWqDwHNc7CjYDuJqwQIefcTVBYnVJXahSgA0Vb0xcrY1RFTaSiyA/s1600/OrderDetailStructure.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="105" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_lg_ZtU_4b3bI9vNDkV6Psi28HOhLqJrowM9g1npAFiBq27_fX6tlJ-fy3kfQgLXocJGVZfiKf10i-FUqedqkoksyWqDwHNc7CjYDuJqwQIefcTVBYnVJXahSgA0Vb0xcrY1RFTaSiyA/s400/OrderDetailStructure.jpg" width="400" /></a></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<b style="color: #444444; font-family: Georgia, serif;"><i style="background-color: cyan;">Step 4: Creating Partition Function</i></b></div>
<div class="MsoNoSpacing">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;">First we shall create decide the ranges which is defined by the partition function<br />In our case the function will be as below</span></span><br />
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;"><br /></span></span>
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;"><br /></span></span><span style="color: blue;"><span style="font-family: Consolas;">CREATE</span></span><span style="font-family: Consolas;"> <span style="color: blue;">PARTITION</span>
<span style="color: blue;">FUNCTION</span> [OrderDatesMonthly]<span style="color: blue;"> </span><span style="color: grey;">(</span><span style="color: blue;">datetime</span><span style="color: grey;">)</span></span></div>
<div style="border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 1.0pt 0cm 1.0pt 4.0pt;">
<div class="MsoNormal" style="border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<span style="color: blue; font-family: Consolas;">AS</span><span style="font-family: Consolas;"> <span style="color: blue;">RANGE</span>
<span style="color: grey;">LEFT</span> <span style="color: blue;">FOR</span> <span style="color: blue;">VALUES </span><span style="color: grey;">(</span><span style="color: red;">'20150401'</span><span style="color: grey;">,</span><span style="color: red;">'20150701'</span><span style="color: grey;">,</span><span style="color: red;">'20151001'</span><span style="color: grey;">);</span></span></div>
<div class="MsoNormal" style="border: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 0cm 1.0pt 4.0pt; padding: 0cm;">
<br /></div>
</div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Since we have specified 11 values our total number of partitions will be 3+1 =4.</span><br />
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<table border="0" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; margin-left: 4.65pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-yfti-tbllook: 1184; width: 400px;">
<tbody>
<tr style="height: 15.0pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0;">
<td nowrap="" style="border: solid windowtext 1.0pt; height: 15.0pt; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 51.0pt;" width="68"><div align="center" class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center;">
<b><i><u><span style="color: #444444;">Partition<o:p></o:p></span></u></i></b></div>
</td>
<td nowrap="" style="border-left: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 119.0pt;" width="159"><div align="center" class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center;">
<b><i><u><span style="color: #444444;">Values<o:p></o:p></span></u></i></b></div>
</td>
<td nowrap="" style="border-left: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 130.0pt;" width="173"><div align="center" class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center;">
<span style="color: #444444;"><br /></span></div>
</td>
</tr>
<tr style="height: 15.0pt; mso-yfti-irow: 1;">
<td nowrap="" style="border-top: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 51.0pt;" width="68"><div align="center" class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center;">
<span style="color: #444444;">1<o:p></o:p></span></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 119.0pt;" width="159"><div align="center" class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center;">
<span style="color: #444444;">date<=20150401<o:p></o:p></span></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 130.0pt;" width="173"><div align="center" class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center;">
<span style="color: #444444;"><=
1st April 2015<o:p></o:p></span></div>
</td>
</tr>
<tr style="height: 15.0pt; mso-yfti-irow: 2;">
<td nowrap="" style="border-top: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 51.0pt;" width="68"><div align="center" class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center;">
<span style="color: #444444;">2<o:p></o:p></span></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 119.0pt;" width="159"><div align="center" class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center;">
<span style="color: #444444;">date<=20150701<o:p></o:p></span></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 130.0pt;" width="173"><div align="center" class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center;">
<span style="color: #444444;"><= 1st July 2015<o:p></o:p></span></div>
</td>
</tr>
<tr style="height: 15.0pt; mso-yfti-irow: 3;">
<td nowrap="" style="border-top: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 51.0pt;" width="68"><div align="center" class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center;">
<span style="color: #444444;">3<o:p></o:p></span></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 119.0pt;" width="159"><div align="center" class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center;">
<span style="color: #444444;">date<=20151001<o:p></o:p></span></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 130.0pt;" width="173"><div align="center" class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center;">
<span style="color: #444444;"><=
1st October 2015<o:p></o:p></span></div>
</td>
</tr>
<tr style="height: 15.0pt; mso-yfti-irow: 4; mso-yfti-lastrow: yes;">
<td nowrap="" style="background: yellow; border-top: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 51.0pt;" width="68"><div align="center" class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center;">
<span style="color: #444444;">4<o:p></o:p></span></div>
</td>
<td nowrap="" style="background: yellow; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 119.0pt;" width="159"><div align="center" class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center;">
<span style="color: #444444;">date>20151201<o:p></o:p></span></div>
</td>
<td nowrap="" style="background: yellow; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 130.0pt;" width="173"><div align="center" class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center;">
<span style="color: #444444;">>
1st October 2015</span><o:p></o:p></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">Iâve used the</span>
<span style="line-height: 115%;">RANGE</span><span style="line-height: 115%;"> <span style="color: grey;">LEFT </span></span><span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">option
here. One may also choose to opt for</span> <span style="line-height: 115%;">RANGE</span><span style="line-height: 115%;"> <span style="color: grey;">RIGHT. </span></span><span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">For
example</span></span><o:p></o:p><br />
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div style="border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 1.0pt 4.0pt 1.0pt 4.0pt;">
<div class="MsoNormal" style="border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<span style="color: blue; font-family: Consolas;">CREATE</span><span style="font-family: Consolas;"> <span style="color: blue;">PARTITION</span>
<span style="color: blue;">FUNCTION</span> [OrderDatesMonthly]<span style="color: blue;"> </span><span style="color: grey;">(</span><span style="color: blue;">datetime</span><span style="color: grey;">)</span><o:p></o:p></span></div>
<div class="MsoNormal" style="border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<span style="color: blue; font-family: Consolas;">AS</span><span style="font-family: Consolas;"> <span style="color: blue;">RANGE</span>
<span style="color: grey;">RIGHT</span> <span style="color: blue;">FOR</span> <span style="color: blue;">VALUES </span><span style="color: grey;">(</span><span style="color: red;">'20150330'</span><span style="color: grey;">,</span><span style="color: red;">'20150630'</span><span style="color: grey;">,</span><span style="color: red;">'20150930'</span><span style="color: grey;">);</span></span></div>
<div class="MsoNormal" style="border: none; margin-bottom: 0.0001pt; padding: 0cm; text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
</div>
<div class="MsoNoSpacing" style="text-align: left;">
<span style="background-color: cyan; color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNoSpacing" style="text-align: left;">
<b><i><span style="background-color: cyan; color: #444444; font-family: Georgia, Times New Roman, serif;">Step 5 : Creating Partition Scheme</span></i></b></div>
<div class="MsoNoSpacing" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNoSpacing" style="text-align: left;">
<div style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">Now that weâve split the range lets
map it to different filegroups. Ranges are split with functions. </span>Split ranges are mapped with schemes.
In our case the scheme will be</span><br />
<br />
<div style="border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 1.0pt 4.0pt 1.0pt 4.0pt;">
<div class="MsoNormal" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<div style="margin: 0px;">
<span style="color: blue; font-family: Consolas;">CREATE</span><span style="font-family: Consolas;"><span style="color: blue;"> PARTITION SCHEME</span> [OrderDatesMonthlyScheme]<span style="color: blue;"> </span><o:p></o:p></span></div>
</div>
<div class="MsoNormal" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<div style="margin: 0px;">
<span style="color: blue; font-family: Consolas;">AS</span><span style="font-family: Consolas;"><span style="color: blue;"> PARTITION</span> [OrderDatesMonthly]<span style="color: blue;"> TO</span><span style="color: blue;"> </span><span style="color: grey;">(F1, F2, F3, F4</span><span style="color: grey;">);</span></span></div>
</div>
<div class="MsoNormal" style="border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: none; color: black; margin-bottom: 0.0001pt; padding: 0cm; text-align: left;">
<div style="margin: 0px;">
<br /></div>
</div>
</div>
</div>
</div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; line-height: 115%;"><b><i style="background-color: cyan;">Step 6: Breaking the table</i></b></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Our range is set
our file-groups are mapped so now letâs break our tables into smaller
manageable chunks.</span></span><br />
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><span style="font-family: Consolas;"> </span></span></div>
<div style="border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 1.0pt 4.0pt 1.0pt 4.0pt;">
<div class="MsoNormal" style="border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<span style="font-family: Consolas;"><span style="color: blue;">CREATE TABLE</span> dbo.[OrderTable](</span><br />
<span style="font-family: Consolas;">[OrderId]
[nchar]<span style="color: grey;">(</span>10<span style="color: grey;">)</span> <span style="color: grey;">NOT</span> <span style="color: grey;">NULL,</span><o:p></o:p></span></div>
<div class="MsoNormal" style="border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<span style="font-family: Consolas;">[OrderDate]
[smalldatetime] <span style="color: grey;">NOT</span> <span style="color: grey;">NULL,</span><o:p></o:p></span></div>
<div class="MsoNormal" style="border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<span style="font-family: Consolas;"> <span style="color: blue;">CONSTRAINT</span>
[PK_OrderTable] <span style="color: blue;">PRIMARY</span> <span style="color: blue;">KEY</span> <span style="color: blue;">CLUSTERED</span> <o:p></o:p></span></div>
<div class="MsoNormal" style="border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<span style="color: grey; font-family: Consolas; font-size: 9.5pt;">(</span><span style="font-family: Consolas;"><o:p></o:p></span></div>
<div class="MsoNormal" style="border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<span style="font-family: Consolas;"> [OrderId]
<span style="color: blue;">ASC</span><o:p></o:p></span></div>
<div class="MsoNormal" style="border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<span style="color: grey; font-family: Consolas; font-size: 9.5pt;">)</span><span style="font-family: Consolas;"><o:p></o:p></span></div>
<div class="MsoNormal" style="border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<span style="color: grey; font-family: Consolas; font-size: 9.5pt;">)</span><span style="font-family: Consolas;"> <span style="color: blue;">ON</span>
OrderDatesMonthlyScheme<span style="color: grey;">(</span>OrderDate<span style="color: grey;">)</span><o:p></o:p></span></div>
<div class="MsoNormal" style="border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<br /></div>
<div class="MsoNormal" style="border: none; margin-bottom: 0.0001pt; padding: 0cm;">
<span style="color: blue; font-family: Consolas;">GO</span><br />
<span style="color: blue; font-family: Consolas;"><br /></span>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">I</span><span style="color: #444444; font-family: Georgia, 'Times New Roman', serif;">n just 6 steps we saw how too break large tables into partition tables.</span><br />
<span style="color: #444444; font-family: Georgia, 'Times New Roman', serif;">In the coming blogs we will learn how to move data between such tables.</span><br />
<span style="color: #444444; font-family: Georgia, 'Times New Roman', serif;"><br /></span></div>
</div>
<div class="MsoNormal">
<span style="color: #444444; font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"><o:p></o:p></span></div>
</div>
Krutihttp://www.blogger.com/profile/13385897521211871375noreply@blogger.com1tag:blogger.com,1999:blog-8195522014866487394.post-32754930067846542015-09-12T00:13:00.000-07:002016-01-05T05:31:04.316-08:00MOVING SYSTEM DATABASES<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
Below document provides information that can be used for moving system database. However this is not recommended for database installation its ideal for troubleshooting & disaster recovery purposes alone.</div>
<div class="MsoNormal">
<h2>
<i style="font-family: Georgia, 'Times New Roman', serif; font-size: medium;">A: Moving System Database Files (Model, msdb, Tempdb) </i></h2>
<div>
<i style="font-family: Georgia, 'Times New Roman', serif; font-size: medium;"><br /></i></div>
<div>
<i style="font-family: Georgia, 'Times New Roman', serif; font-size: medium;"><br /></i></div>
</div>
<div class="MsoNormal">
<div>
<span style="background-color: cyan; font-family: Georgia, 'Times New Roman', serif;"><span style="color: #444444;">Step 1: Run the following in a new query window</span></span></div>
<div class="MsoNormal">
<b><span style="font-size: 10pt; line-height: 15.3333px;"><span style="font-family: Georgia, Times New Roman, serif;"><br /></span></span></b></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue; font-size: 10pt;">USE</span><span style="font-size: 10pt;"> master<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-size: 10pt;"><span style="font-family: Georgia, Times New Roman, serif;">Go<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue; font-size: 10pt;">ALTER DATABASE</span><span style="font-size: 10pt;"> model<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: 10pt;"><span style="font-family: Georgia, Times New Roman, serif;"> <span style="color: blue;">MODIFY FILE</span> ( NAME = <span style="color: red;">'modeldev'</span> , <span style="color: blue;">FILENAME</span> =<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: red; font-size: 10pt;">'<span style="background: red; mso-highlight: red;">F:\MSSQL\Data</span>\model.mdf'</span><span style="font-size: 10pt;"> );<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue; font-size: 10pt;">Go</span><span style="font-size: 10pt;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue; font-size: 10pt;">ALTER DATABASE</span><span style="font-size: 10pt;"> model<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: 10pt;"><span style="font-family: Georgia, Times New Roman, serif;"> <span style="color: blue;">MODIFY FILE</span> ( NAME = <span style="color: red;">'modellog'</span> , <span style="color: blue;">FILENAME</span> = <span style="background: red; color: red; mso-highlight: red;">'F:\MSSQL\Data</span><span style="color: red;">\modellog.ldf'</span> );<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue; font-size: 10pt;">Go</span><span style="font-size: 10pt;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue; font-size: 10pt;">ALTER DATABASE</span><span style="font-size: 10pt;"> msdb<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: 10pt;"><span style="font-family: Georgia, Times New Roman, serif;"> <span style="color: blue;">MODIFY FILE</span> ( NAME = <span style="color: red;">'MSDBData'</span> , <span style="color: blue;">FILENAME</span> = <span style="background: red; color: red; mso-highlight: red;">'F:\MSSQL\Data</span><span style="color: red;">\MSDBData.mdf'</span> );<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue; font-size: 10pt;">Go</span><span style="font-size: 10pt;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue; font-size: 10pt;">ALTER DATABASE</span><span style="font-size: 10pt;"> msdb<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: 10pt;"><span style="font-family: Georgia, Times New Roman, serif;"> <span style="color: blue;">MODIFY FILE</span> ( NAME = <span style="color: red;">'MSDBLog'</span> , <span style="color: blue;">FILENAME</span> =<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: 10pt;"><span style="font-family: Georgia, Times New Roman, serif;"> <span style="color: red;">'<span style="background: red; mso-highlight: red;">F:\MSSQL\Data</span>\MSDBLog.ldf'</span> );<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-size: 10pt;"><span style="font-family: Georgia, Times New Roman, serif;">Go<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue; font-size: 10pt;">ALTER DATABASE </span><span style="font-size: 10pt;">tempdb<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue; font-size: 10pt;"> MODIFY FILE</span><span style="font-size: 10pt;"> ( NAME = <span style="color: red;">'tempdev'</span> , <span style="color: blue;">FILENAME</span> = <span style="color: red;">'<span style="background: red; mso-highlight: red;">F:\MSSQL\Data</span>\tempdb.ldf'</span> );<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-size: 10pt;"><span style="font-family: Georgia, Times New Roman, serif;">Go<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue; font-size: 10pt;">ALTER DATABASE </span><span style="font-size: 10pt;">tempdb<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: blue; font-size: 10pt;"> MODIFY FILE</span><span style="font-size: 10pt;"> ( NAME = <span style="color: red;">'templog'</span> , <span style="color: blue;">FILENAME</span> = <span style="color: red;">'<span style="background: red; mso-highlight: red;">F:\MSSQL\Data</span>\templog.ldf'</span> );<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-size: 10pt;"><span style="font-family: Georgia, Times New Roman, serif;">Go<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<br />
<br />
<span style="background-color: cyan;"><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Step 2: Stop the SQL server instance. Now move the files to the location specified</span></span><br />
<span style="color: #444444;"><span style="font-family: Georgia, Times New Roman, serif;"><br /></span><span style="background-color: cyan;"><span style="font-family: Georgia, Times New Roman, serif;"> Step 3: Restart the SQL server instance</span></span></span><br />
<br />
<h2 style="text-align: left;">
<i style="font-family: Georgia, 'Times New Roman', serif; font-size: medium;">B: Moving master database </i></h2>
<div>
<i style="font-family: Georgia, 'Times New Roman', serif; font-size: medium;"><br /></i></div>
<h2 style="text-align: left;">
<div class="MsoNormal">
<div style="text-align: left;">
<span style="color: #444444; font-size: small;"><span style="line-height: 15.3333px;"><span style="font-family: Georgia, Times New Roman, serif;"><span style="background-color: cyan; font-weight: normal;">Step 1:</span> </span></span><span style="font-family: 'Times New Roman', serif; font-weight: normal; text-indent: -18pt;"><span style="font-family: 'Times New Roman'; font-stretch: normal;"> </span></span><span style="font-family: Georgia, serif; text-indent: -18pt;"><span style="font-weight: normal;">On the Start menu, point to </span></span></span><span style="background-color: cyan; color: #444444; font-family: Georgia, Times New Roman, serif; font-size: small; font-weight: normal;">All Programs | Microsoft SQL Server 2008 R2 | Configuration Tools | SQL Server Configuration Manager.</span></div>
</div>
</h2>
<div style="text-align: left;">
<span style="color: #444444; font-size: small;"><span style="line-height: 15.3333px;"><span style="font-family: Georgia, Times New Roman, serif;"><span style="background-color: cyan; font-weight: normal;">Step 2 </span>:</span></span><span style="font-family: 'Times New Roman', serif; font-weight: normal; text-indent: -18pt;"><span style="font-family: 'Times New Roman'; font-stretch: normal;"> </span></span><span style="font-family: Georgia, serif; text-indent: -18pt;"><span style="font-weight: normal;">In the SQL Server Services node, right-click the instance of SQL Server (for example, ) and <span style="background-color: cyan;">choose </span></span><span style="background-color: cyan;">Properties.</span></span></span></div>
<div style="text-align: left;">
<span style="color: #444444; font-size: small;"><span style="font-family: Georgia, serif; text-indent: -18pt;"><span style="background-color: cyan;"><br /></span></span></span></div>
<span style="color: #444444; font-size: small;"><span style="font-weight: normal;"><span style="line-height: 15.3333px;"><span style="font-family: Georgia, Times New Roman, serif;"><span style="background-color: cyan;">Step 3 </span>:</span></span></span><span style="font-family: 'Times New Roman', serif; font-weight: normal; text-indent: -18pt;"><span style="font-family: 'Times New Roman'; font-stretch: normal;"> </span></span><span style="font-family: Georgia, serif; text-indent: -18pt;"><span style="font-weight: normal;">In the SQL Server (</span><i style="font-weight: normal;">instance_name</i><span style="font-weight: normal;">) Properties dialog box, <span style="background-color: cyan;">click the </span></span><span style="background-color: cyan;">Advanced tab</span>.</span></span><br />
<span style="color: #444444; font-size: small;"><span style="background-color: cyan; font-weight: normal;"><span style="line-height: 15.3333px;"><span style="font-family: Georgia, Times New Roman, serif;">Step 4:</span></span></span><span style="font-family: 'Times New Roman', serif; font-weight: normal; text-indent: -18pt;"><span style="font-family: 'Times New Roman'; font-stretch: normal;"> </span></span><span style="font-family: Georgia, serif; text-indent: -18pt;"><span style="font-weight: normal;">Edit the </span><span style="background-color: cyan;">Startup Parameters</span><span style="font-weight: normal;"><span style="background-color: cyan;"> values</span> to point to the planned location for the master database data and log files, and click OK. Moving the error log file is optional.</span></span></span><br />
<br />
<div style="text-align: left;">
<span style="color: #444444; font-family: Georgia, serif; text-indent: -18pt;"><br /></span></div>
<div style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">The parameter value for the data file must follow the -d parameter and the value for the log file must follow the -l parameter. The following example shows the parameter values for the default location of the master data and log files.</span></div>
<h2 style="text-align: left;">
<table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="margin-left: 36pt; width: 543px;"><tbody>
<tr style="height: 75.45pt;"><td style="height: 75.45pt; padding: 0cm;"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: black;"><span style="color: yellow;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-family: Georgia, serif; font-size: 10pt;"><br />-dC:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\master.mdf;</span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: black;"><span style="color: yellow;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-family: Georgia, serif; font-size: 10pt;">-eC:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\LOG\ERRORLOG;</span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-attachment: initial; background-clip: initial; background-color: black; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: yellow; font-family: Georgia, serif; font-size: 10pt;">-lC:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\mastlog.ldf</span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></div>
</td></tr>
</tbody></table>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: small;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<div style="text-align: left;">
<span style="color: #444444; font-family: Georgia, serif; font-size: small; font-weight: normal;"> If the planned relocation for the master data and log file is F:\MSSQL\Data, the parameter values would be changed as follows:<o:p></o:p></span></div>
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="margin-left: 36pt; width: 568px;"><tbody>
<tr style="height: 57.75pt;"><td style="height: 57.75pt; padding: 0cm;"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: black;"><span style="color: yellow;"><span style="font-family: Georgia, serif; font-size: 10pt;"><br /><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;">-dF:\MSSQL\Data\master.mdf;</span></span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: black;"><span style="color: yellow;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-family: Georgia, serif; font-size: 10pt;">-eC:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\LOG\ERRORLOG;</span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-attachment: initial; background-clip: initial; background-color: black; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: yellow; font-family: Georgia, serif; font-size: 10pt;">-lF:\MSSQL\Data\mastlog.ldf</span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></div>
</td></tr>
</tbody></table>
<br /><span style="background-color: cyan; font-weight: normal;"><span style="color: #444444; font-size: small;"><span style="line-height: 15.3333px;"><span style="font-family: Georgia, Times New Roman, serif;">Step 5: </span></span><span style="font-family: Georgia, serif; text-indent: -18pt;">Stop the instance of SQL Server.</span></span></span><br />
</h2>
<h2 style="text-align: left;">
<div class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;">
<span style="font-weight: normal;"><span style="font-family: Georgia, serif; font-size: 10pt;"><br /></span></span></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="margin-left: 36pt;"><tbody>
<tr><td style="padding: 0cm;"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: black; color: yellow;"><span style="font-family: Georgia, serif; font-size: 10pt;"><br />[SQLPROD1] C:\> <b>net stop SQLSERVERAGENT</b></span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: black; color: yellow; font-family: Georgia, serif; font-size: 10pt;">[SQLPROD1] C:\> <b>net stop MSSQLSERVER</b></span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></div>
</td></tr>
</tbody></table>
<br />
</h2>
<div style="text-align: left;">
<div style="text-align: left;">
<span style="background-color: cyan; color: #444444;"><span style="font-weight: normal;"><span style="line-height: 15.3333px;"><span style="font-family: Georgia, Times New Roman, serif;">Step 6:</span></span><span style="font-family: 'Times New Roman', serif; text-indent: -18pt;"> </span></span><span style="font-family: Georgia, serif; text-indent: -18pt;"><span style="font-weight: normal;">Move the master.mdf and mastlog.ldf files to the new location</span><span style="font-size: 10pt;">.</span></span></span></div>
<div style="text-align: left;">
<span style="background-color: cyan; color: #444444;"><span style="font-family: Georgia, serif; text-indent: -18pt;"><span style="font-size: 10pt;"><br /></span></span></span></div>
</div>
<div style="text-align: left;">
<table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="margin-left: 36pt; width: 512px;"><tbody>
<tr style="height: 94.75pt;"><td style="height: 94.75pt; padding: 0cm;"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: black; color: yellow;"><span style="font-family: Georgia, serif; font-size: 10pt;"><br />[SQLPROD1] C:\> <span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;">move "C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\master.mdf" F:\MSSQL\Data\</span></span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: black; color: yellow;"><span style="font-family: Georgia, serif; font-size: 10pt;"> 1 file(s) moved.</span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: black; color: yellow;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: black; color: yellow;"><span style="font-family: Georgia, serif; font-size: 10pt;">[SQLPROD1] C:\><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"> move "C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\mastlog.ldf" F:\MSSQL\Data\</span></span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: black; color: yellow; font-family: Georgia, serif; font-size: 10pt;"> 1 file(s) moved.</span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></div>
</td></tr>
</tbody></table>
<span style="background-color: cyan; color: #444444; font-family: Georgia, Times New Roman, serif; font-size: small; font-weight: normal;"><span style="line-height: 15.3333px;"><br /></span></span></div>
<div style="text-align: left;">
<span style="background-color: cyan; color: #444444; font-family: Georgia, Times New Roman, serif; font-size: small; font-weight: normal;"><span style="line-height: 15.3333px;"><br /></span></span></div>
<div style="text-align: left;">
<span style="background-color: cyan; color: #444444; font-family: Georgia, Times New Roman, serif; font-size: small; font-weight: normal;"><span style="line-height: 15.3333px;">Step 7: </span><span style="text-indent: -18pt;">Restart the instance of SQL Server.</span></span></div>
<h2>
<div style="text-align: left;">
<table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="margin-left: 36pt;"><tbody>
<tr><td style="padding: 0cm;"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: black; color: yellow;"><span style="font-family: Georgia, serif; font-size: 10pt;"><br />[SQLPROD1] C:\> <span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;">net start MSSQLSERVER</span></span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: black; color: yellow; font-family: Georgia, serif; font-size: 10pt;">[SQLPROD1] C:\> <span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;">net start SQLSERVERAGENT</span></span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></div>
</td></tr>
</tbody></table>
<br />
<span style="background-color: cyan; font-weight: normal;"><span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: small;"><span style="line-height: 15.3333px;">Step 8: </span><span style="text-indent: -18pt;">Verify the file change for the master database by running the following query.</span></span></span></div>
<div class="MsoNormal">
<b style="font-size: medium;"><span style="font-size: 10pt; line-height: 15.3333px;"><span style="font-family: Georgia, Times New Roman, serif;"><br /></span></span></b>
<span style="background-color: cyan; font-weight: normal;"><span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: small;"><span style="text-indent: -18pt;"><br /></span></span></span></div>
</h2>
<h2>
<table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="margin-left: 36pt;"><tbody>
<tr><td style="padding: 0cm;"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, serif; font-size: 10pt;"><br /><span style="color: blue;">USE</span> master</span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: Georgia, serif; font-size: 10pt;">Go</span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: Georgia, serif; font-size: 10pt;">SELECT</span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, serif; font-size: 10pt;"> name <span style="color: blue;">AS</span> "Logical File Name"</span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, serif; font-size: 10pt;"> , physical_name <span style="color: blue;">AS</span> "Physical File Location"</span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, serif; font-size: 10pt;"> , state_desc <span style="color: blue;">AS</span> "State"</span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: Georgia, serif; font-size: 10pt;">FROM</span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, serif; font-size: 10pt;"> <span style="color: green;">sys.master_files</span></span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: Georgia, serif; font-size: 10pt;">WHERE</span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, serif; font-size: 10pt;"> database_id = <span style="color: magenta;">DB_ID</span>(<span style="color: red;">N'master'</span>);</span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: Georgia, serif; font-size: 10pt;">Go</span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, serif; font-size: 10pt;">Logical File Name Physical File Location State</span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, serif; font-size: 10pt;">------------------- --------------------------------- --------</span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, serif; font-size: 10pt;">master F:\MSSQL\Data\master.mdf ONLINE</span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, serif; font-size: 10pt;">mastlog F:\MSSQL\Data\mastlog.ldf ONLINE</span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></div>
</td></tr>
</tbody></table>
<br />
</h2>
<div>
<h3 style="text-align: left;">
<i style="font-family: Georgia, 'Times New Roman', serif;">C: Moving Resource Database </i></h3>
</div>
<div>
<i style="font-family: Georgia, 'Times New Roman', serif;"><br /></i></div>
<div style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif; font-size: small; font-weight: normal;">Starting SQL server 2005 Resource Database was instroduced as a read-only database that contained all the system objects that are included within SQL Server. It does not contain user data or user meta data.</span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, 'Times New Roman', serif;">Ideally it is found in the below directory for default installation of SQL server on C:\ drive</span><br />
<span style="background-color: cyan; color: #444444; font-family: Georgia, 'Times New Roman', serif; font-size: 13.3333px;">C:\Program Files (x86)\Microsoft SQL Server\MSSQL10.<instance name>\MSSQL\Binn</span><br />
<div style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
</div>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">The filenames would be <b>mssqlsystemresource.mdf</b> and <b>mssqlsystemresource.ldf</b> respectively.</span><br />
<span style="color: #444444; font-family: Georgia, 'Times New Roman', serif;">In SQL Server 2008 and higher, the Resource database resides under the following directory and cannot be changed:</span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="font-size: 10pt;"><span style="font-family: Georgia, Times New Roman, serif;"><br /></span></span></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="background: #EEF3F7; border-collapse: collapse; border: none; mso-border-alt: outset #C4D1E6 .75pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-yfti-tbllook: 1184; width: 95%px;"><tbody>
<tr><td style="border: inset #C4D1E6 1.0pt; mso-border-alt: inset #C4D1E6 .75pt; padding: 3.0pt 3.0pt 3.0pt 3.0pt;"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: 10pt;"><span style="background-color: black; color: yellow; font-family: Georgia, Times New Roman, serif;"><br />SQL Server 2008<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: 10pt;"><span style="background-color: black; color: yellow; font-family: Georgia, Times New Roman, serif;"><drive>:\Program Files(x86)\Microsoft SQL Server\MSSQL10.<instance_name>\MSSQL\Binn\<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: black; color: yellow;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: black; color: yellow; font-family: Georgia, Times New Roman, serif;"><span style="font-size: 10pt;">SQL Server 2008 R2</span><span style="font-size: 10pt;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: 10pt;"><span style="background-color: black; color: yellow; font-family: Georgia, Times New Roman, serif;"><drive>:\Program Files(x86)\Microsoft SQL Server\MSSQL10_50.<instance_name>\MSSQL\Binn\<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: black; color: yellow;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: black; color: yellow; font-family: Georgia, Times New Roman, serif;"><span style="font-size: 10pt;">SQL Server 2012</span><span style="font-size: 10pt;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: 10pt;"><span style="font-family: Georgia, Times New Roman, serif;"><span style="background-color: black; color: yellow;"><drive>:\Program Files(x86)\Microsoft SQL Server\MSSQL11.<instance_name>\MSSQL\Binn\</span><o:p></o:p></span></span></div>
</td></tr>
</tbody></table>
<div class="MsoNormal" style="text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span>
<br />
<span style="color: #444444; font-family: Georgia, 'Times New Roman', serif;">The location of these files are dependent on which version of SQL Server you are running (as explained in this section). Each instance of SQL Server will have its own resource database mdf and ldf files.</span><br />
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br />
Msdb, tempdb, model & master are moved. Now we shall move the resource database. </span><br />
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">For this we will need to know a few trace flags</span><br />
<br />
<span style="color: #444444; font-family: Georgia, 'Times New Roman', serif;">The resource database is used by the engine to collect information of system objects during an upgrade.</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">In SQL Server 2005, if you moved the master database, you had to also move the Resource database to the same location as the master data file. In SQL Server 2008 and higher, the location of the Resource database cannot be moved from its default location.<span style="display: none; mso-hide: all;"><o:p></o:p></span></span><br />
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
<div style="text-align: left;">
<br /></div>
<table border="1" cellpadding="0" class="MsoNormalTable"><tbody>
<tr><td style="padding: 0cm;"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, serif; font-size: 10pt;">Option</span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></div>
</td><td style="padding: 0cm;"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, serif; font-size: 10pt;">Impact</span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></div>
</td></tr>
<tr><td style="padding: 0cm;"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="color: blue; font-family: Georgia, serif; font-size: 10pt;">Trace Flag 3607</span></b><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></div>
</td><td style="padding: 0cm;"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, serif; font-size: 10pt;">Starts SQL Server without recovering any databases. Skips automatic recovery (at startup) for all databases.</span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></div>
</td></tr>
<tr><td style="padding: 0cm;"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="background: white; color: blue; font-family: Georgia, serif; font-size: 10pt;">Trace Flag 3608</span></b><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></div>
</td><td style="padding: 0cm;"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, serif; font-size: 10pt;">Starts SQL Server, recovering master only. Skips automatic recovery (at startup) for all databases except the master database.</span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></div>
</td></tr>
<tr><td style="padding: 0cm;"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="color: blue; font-family: Georgia, serif; font-size: 10pt;">Trace Flag 3609</span></b><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></div>
</td><td style="padding: 0cm;"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, serif; font-size: 10pt;">Skips the creation of the tempdb database at startup. Use this trace flag if the tempdb database is problematic or problems exist in the model database.</span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></div>
</td></tr>
<tr><td style="padding: 0cm;"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="color: blue; font-family: Georgia, serif; font-size: 10pt;">User Database Status -32768</span></b><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></div>
</td><td style="padding: 0cm;"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, serif; font-size: 10pt;">Starts SQL Server without recovering the user database</span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"><o:p></o:p></span></div>
</td></tr>
</tbody></table>
</div>
<div style="text-align: left;">
<span style="color: #444444; font-family: Georgia, serif; font-weight: normal;"><br /></span></div>
<div style="text-align: left;">
<span style="color: #444444; font-family: Georgia, serif; font-weight: normal;">When SQL server starts it goes through the recovery phase for each of its database. Reads the error logs and perform the redo and undo actions based on the LSN. First the master database is opened and recovered. Next the model database. Depending on model the tempdb database is created and then the rest of the databases are started and recovered.</span></div>
<div style="text-align: left;">
<span style="color: #444444; font-family: Georgia, serif; font-weight: normal;"><br /></span></div>
<div style="text-align: left;">
<span style="color: #444444; font-family: Georgia, serif; font-weight: normal;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhxBKnktgGg8ra4N5DHYnu9NcLDNOU1zbFuKDqW-EZel0r0OMVnLCiVsgw1Pw84VxJKnf66hMM1philzCmcDSOLhPHnT6wIEl8OwVa3-hK25Mhf6FOsO01V6iq8RfQVMkQRt1vV6-UEQo/s1600/errorlog.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhxBKnktgGg8ra4N5DHYnu9NcLDNOU1zbFuKDqW-EZel0r0OMVnLCiVsgw1Pw84VxJKnf66hMM1philzCmcDSOLhPHnT6wIEl8OwVa3-hK25Mhf6FOsO01V6iq8RfQVMkQRt1vV6-UEQo/s640/errorlog.jpg" width="625" /></a></div>
<div>
<span style="font-family: Georgia, serif; font-size: 10pt; font-weight: normal;"><br /></span></div>
<h2>
<span style="font-family: Georgia, serif; font-size: 10pt; font-weight: normal;"> </span></h2>
<h2>
<span style="color: #444444; font-size: small;"><span style="font-family: Georgia, serif; font-weight: normal;"><br /></span></span></h2>
<h2>
<span style="color: #444444; font-size: small;"><span style="font-family: Georgia, serif; font-weight: normal;"><br /></span></span></h2>
<h2>
</h2>
<div>
<br /></div>
<h2>
</h2>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<h2>
</h2>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<h2>
<span style="color: #444444; font-family: Georgia, serif; font-size: small; font-weight: normal;"><br /></span></h2>
<h2>
<span style="color: #444444; font-family: Georgia, serif; font-size: small; font-weight: normal;"><br /></span></h2>
<h2>
<span style="color: #444444; font-family: Georgia, serif; font-size: small; font-weight: normal;"><br /></span></h2>
<h2>
<span style="color: #444444; font-family: Georgia, serif; font-size: small; font-weight: normal;"><br /></span></h2>
<h2>
<span style="color: #444444; font-family: Georgia, serif; font-size: small; font-weight: normal;"><br /></span></h2>
<div style="text-align: left;">
<span style="color: #444444; font-family: Georgia, serif; font-size: small; font-weight: normal;">Hence when we are moving the resource database we will make use of trace flag 3608.</span><span style="color: #444444; font-family: Georgia, serif; font-size: small; font-weight: normal;">I have also used trace flag 3607 however itâs not mandate to do the same.</span><span style="color: #444444; font-family: Georgia, serif; font-size: small; font-weight: normal;">Put the SQL server in single user mode & connect with the sysadmin account with the startup options -c, -m</span></div>
</div>
<div>
<br /></div>
<div>
<div style="text-align: left;">
<span style="line-height: 15.3333px;"><span style="background-color: cyan; color: #444444; font-family: Georgia, Times New Roman, serif; font-size: small;">Step 1:</span></span></div>
<div style="text-align: left;">
<b><span style="line-height: 15.3333px;"><span style="background-color: cyan; color: #444444; font-family: Georgia, Times New Roman, serif; font-size: small;"><br /></span></span></b></div>
</div>
<div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="margin-left: 36pt; text-align: justify; width: 533px;"><tbody>
<tr style="height: 21.05pt;"><td style="height: 21.05pt; padding: 0cm;"><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 12.75pt; margin-bottom: 0.0001pt; word-break: break-all;">
<span style="font-family: Georgia, serif; font-size: 10pt;"><span style="background-color: white;"> </span><span style="background-color: black; color: yellow;">Command: </span></span><b><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="background-color: black; color: yellow;">SQLCMD âU <username> -P <password> -c âm ât3607 ât3608.</span><span style="background-color: cyan;"><o:p></o:p></span></span></b></div>
</td></tr>
</tbody></table>
</div>
<h2>
<span style="line-height: 15.3333px;"><span style="background-color: cyan; color: #444444; font-family: Georgia, Times New Roman, serif; font-size: small; font-weight: normal;">Step 2:</span></span></h2>
<div>
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Then we issue the below command to move resource database</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div style="margin: 0cm 0cm 0.0001pt;">
<span style="color: blue; font-family: Georgia, serif; font-size: 10pt;">USE</span><span class="apple-converted-space"><span style="font-family: Georgia, serif; font-size: 10pt;"> </span></span><span style="font-family: Georgia, serif; font-size: 10pt;">master</span><span style="font-size: 13.5pt;"><o:p></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt;">
<span style="color: blue; font-family: Georgia, serif; font-size: 10pt;">GO</span><span style="font-size: 13.5pt;"><o:p></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; line-height: 12.75pt; margin-bottom: 0.0001pt; word-break: break-all;">
<span style="color: blue; font-family: Georgia, serif; font-size: 10pt;">ALTER DATABASE</span><span class="apple-converted-space"><span style="font-family: Georgia, serif; font-size: 10pt;"> </span></span><span style="font-size: 10.5pt;"> mssqlsystemresource</span><span style="font-family: Consolas; font-size: 10.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: 12.75pt; margin-bottom: 0.0001pt; word-break: break-all;">
<span style="color: blue; font-family: Georgia, serif; font-size: 10pt;">MODIFY FILE</span><span class="apple-converted-space"><span style="font-family: Georgia, serif; font-size: 10pt;"> </span></span><span style="font-size: 10.5pt;"> (NAME = </span><span style="color: red; font-family: Georgia, serif; font-size: 10pt;">data</span><span style="font-size: 10.5pt;">, </span><span style="color: blue; font-family: Georgia, serif; font-size: 10pt;">FILENAME</span><span class="apple-converted-space"><span style="font-family: Georgia, serif; font-size: 10pt;"> </span></span><span style="font-family: Georgia, serif; font-size: 10pt;">=<u1:p></u1:p> </span><span style="color: red; font-family: Georgia, serif; font-size: 10pt;">N' F:\MSSQL\Log\mssqlsystemresource.mdf' </span><span style="font-size: 10.5pt;">);<o:p></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt;">
<span style="color: blue; font-family: Georgia, serif; font-size: 10pt;">GO</span><span style="font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: 12.75pt; margin-bottom: 0.0001pt; word-break: break-all;">
<br /></div>
<div class="MsoNormal" style="background: white; line-height: 12.75pt; margin-bottom: 0.0001pt; word-break: break-all;">
<span style="color: blue; font-family: Georgia, serif; font-size: 10pt;">ALTER DATABASE</span><span class="apple-converted-space"><span style="font-family: Georgia, serif; font-size: 10pt;"> </span></span><span style="font-size: 10.5pt;"> mssqlsystemresource</span><span style="font-family: Consolas; font-size: 10.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: 12.75pt; margin-bottom: 0.0001pt; word-break: break-all;">
<span style="color: blue; font-family: Georgia, serif; font-size: 10pt;">MODIFY FILE</span><span class="apple-converted-space"><span style="font-family: Georgia, serif; font-size: 10pt;"> </span></span><span style="font-size: 10.5pt;"> (NAME = </span><span style="color: red; font-family: Georgia, serif; font-size: 10pt;">log,</span><span style="color: blue; font-family: Georgia, serif; font-size: 10pt;"> FILENAME</span><span class="apple-converted-space"><span style="font-family: Georgia, serif; font-size: 10pt;"> </span></span><span style="font-size: 10.5pt;"> = </span><span style="color: red; font-family: Georgia, serif; font-size: 10pt;">N' F:\MSSQL\Data</span><span style="color: red;"><span style="font-family: Georgia, serif; font-size: 10pt;">\</span> mssqlsystemresource.ldf'</span> <span style="font-size: 10.5pt;">);</span><span style="font-family: Consolas; font-size: 10.5pt;"><o:p></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt;">
<span style="background-color: #eeeeee;"><span style="color: blue; font-family: Georgia, serif; font-size: 10pt;">G</span><span style="font-size: 10.5pt;">O</span></span></div>
<div style="margin: 0cm 0cm 0.0001pt;">
<span style="background-color: #eeeeee;"><span style="font-size: 10.5pt;"><br /></span></span></div>
<h2 style="text-align: left;">
<div>
<span style="line-height: 15.3333px;"><span style="background-color: cyan; color: #444444; font-family: Georgia, Times New Roman, serif; font-size: small; font-weight: normal;">Step 3: Stop the SQL server instance. Now move the files to the location specified<o:p></o:p></span></span></div>
</h2>
<div style="text-align: left;">
<span style="background-color: cyan; color: #444444;"><span style="line-height: 15.3333px;"><span style="font-family: Georgia, Times New Roman, serif;">Step 4:</span></span><span style="line-height: 15.3333px;"><span style="font-family: Georgia, Times New Roman, serif;"> Restart the SQL server instance.</span></span></span><br />
<span style="background-color: cyan; color: #444444;"><span style="line-height: 15.3333px;"><span style="font-family: Georgia, Times New Roman, serif;"><br /></span></span></span>
<span style="background-color: cyan; color: #444444;"><span style="line-height: 15.3333px;"><span style="font-family: Georgia, Times New Roman, serif;"><br /></span></span></span>
<span style="background-color: cyan; color: #444444;"><span style="line-height: 15.3333px;"><span style="font-family: Georgia, Times New Roman, serif;"><br /></span></span></span></div>
<div style="text-align: left;">
<span style="font-family: Georgia, 'Times New Roman', serif; font-size: large;"><b><i>D: The database information mapping between SQL Server 2000 and 2005</i></b></span></div>
<h1>
<span style="font-family: Georgia, Times New Roman, serif;"><o:p></o:p></span></h1>
<div class="MsoNormal">
<br /></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="mso-cellspacing: 0cm; mso-padding-alt: 2.25pt 2.25pt 2.25pt 2.25pt; mso-yfti-tbllook: 1184; width: 90%px;"><tbody>
<tr><td style="padding: 2.25pt;"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><b><span style="font-size: 10pt;">ID</span></b><span style="font-size: 10pt;"><o:p></o:p></span></span></div>
</td><td style="padding: 2.25pt; width: 173.25pt;" width="231"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><b><span style="font-size: 10pt;">Information</span></b><span style="font-size: 10pt;"><o:p></o:p></span></span></div>
</td><td style="padding: 2.25pt; width: 199.5pt;" width="266"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><b><span style="font-size: 10pt;">SQL Server 2000</span></b><span style="font-size: 10pt;"><o:p></o:p></span></span></div>
</td><td style="padding: 2.25pt; width: 204pt;" width="272"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><b><span style="font-size: 10pt;">SQL Server 2005</span></b><span style="font-size: 10pt;"><o:p></o:p></span></span></div>
</td></tr>
<tr><td style="padding: 2.25pt;"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="font-size: 10pt;">1</span><o:p></o:p></span></div>
</td><td style="padding: 2.25pt; width: 173.25pt;" width="231"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Database system table\view - Source for all databases on the SQL Server to include the name, owner, creation date, etc.<o:p></o:p></span></div>
</td><td style="padding: 2.25pt; width: 199.5pt;" width="266"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">SELECT *</span><br />
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">FROM master.dbo.sysdatabases</span><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">GO</span></div>
</td><td style="padding: 2.25pt; width: 204pt;" width="272"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">SELECT *</span><br />
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">FROM sys.databases;</span><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">GO</span></div>
</td></tr>
<tr><td style="padding: 2.25pt;"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">2<o:p></o:p></span></div>
</td><td style="padding: 2.25pt; width: 173.25pt;" width="231"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Database files system table\view - Source for the currently connected database's file names, size, location, type (database or log), etc.<o:p></o:p></span></div>
</td><td style="padding: 2.25pt; width: 199.5pt;" width="266"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">SELECT *</span><br />
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">FROM dbo.sysfiles</span><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">GO</span></div>
</td><td style="padding: 2.25pt; width: 204pt;" width="272"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">SELECT *</span><br />
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">FROM sys.database_files;</span><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">GO</span></div>
</td></tr>
<tr><td style="padding: 2.25pt;"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">3<o:p></o:p></span></div>
</td><td style="padding: 2.25pt; width: 173.25pt;" width="231"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Database files system table\view - Source for all database's file related information<o:p></o:p></span></div>
</td><td style="padding: 2.25pt; width: 199.5pt;" width="266"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">SELECT *</span><br />
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">FROM master.dbo.sysaltfiles</span><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">GO</span></div>
</td><td style="padding: 2.25pt; width: 204pt;" width="272"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">SELECT *</span><br />
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">FROM sys.master_files;</span><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">GO</span></div>
</td></tr>
<tr><td style="padding: 2.25pt;"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">4<o:p></o:p></span></div>
</td><td style="padding: 2.25pt; width: 173.25pt;" width="231"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">IO statistics on database files - Returns the usage statistics on a per file basis<o:p></o:p></span></div>
</td><td style="padding: 2.25pt; width: 199.5pt;" width="266"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">-- Single database file</span><br />
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">SELECT *</span><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">FROM :: fn_virtualfilestats(1, 1)</span><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">GO</span></div>
</td><td style="padding: 2.25pt; width: 204pt;" width="272"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">-- All database files</span><br />
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">SELECT *</span><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">FROM sys.dm_io_virtual_file_stats(NULL, NULL);</span><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">GO</span></div>
</td></tr>
<tr><td style="padding: 2.25pt;"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">5<o:p></o:p></span></div>
</td><td style="padding: 2.25pt; width: 173.25pt;" width="231"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Database meta data - Returns the pertinent database name, size and remarks<o:p></o:p></span></div>
</td><td style="padding: 2.25pt; width: 199.5pt;" width="266"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">EXEC master.dbo.sp_databases</span><br />
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">GO</span></div>
</td><td style="padding: 2.25pt; width: 204pt;" width="272"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">EXEC master.dbo.sp_databases;</span><br />
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">GO</span></div>
</td></tr>
<tr><td style="padding: 2.25pt;"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">6<o:p></o:p></span></div>
</td><td style="padding: 2.25pt; width: 173.25pt;" width="231"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Database meta data - Fairly complete set of pertinent database information that can return data for all databases or 1 database<o:p></o:p></span></div>
</td><td style="padding: 2.25pt; width: 199.5pt;" width="266"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">-- All databases</span><br />
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">EXEC master.dbo.sp_helpdb</span><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">GO</span><span style="color: #444444; font-family: Georgia, Times New Roman, serif;"><br /></span><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">-- Single database</span><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">EXEC master.dbo.sp_helpdb 'Northwind'</span><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">GO</span></div>
</td><td style="padding: 2.25pt; width: 204pt;" width="272"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">-- All databases</span><br />
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">EXEC master.dbo.sp_helpdb;</span><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">GO</span><br />
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">EXEC master.dbo.sp_helpdb 'AdventureWorks';</span><br />
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">GO</span></div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">-- Single database</span></div>
</td></tr>
<tr><td style="padding: 2.25pt;"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">7<o:p></o:p></span></div>
</td><td style="padding: 2.25pt; width: 173.25pt;" width="231"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Change database ownership - System stored procedure to change the database owner<o:p></o:p></span></div>
</td><td style="padding: 2.25pt; width: 199.5pt;" width="266"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">EXEC sp_changedbowner sa</span><br />
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">GO</span></div>
</td><td style="padding: 2.25pt; width: 204pt;" width="272"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">EXEC sp_changedbowner sa;</span><br />
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">GO</span></div>
</td></tr>
<tr><td style="padding: 2.25pt;"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">8<o:p></o:p></span></div>
</td><td style="padding: 2.25pt; width: 173.25pt;" width="231"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Database ID to name translation - System function that will provide the database name when passed the database ID from the database system table<o:p></o:p></span></div>
</td><td style="padding: 2.25pt; width: 199.5pt;" width="266"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">-- Returns the master database</span><br />
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">SELECT DB_NAME(1)</span><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">GO</span></div>
</td><td style="padding: 2.25pt; width: 204pt;" width="272"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">-- Returns the master database</span><br />
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">SELECT DB_NAME(1);</span><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">GO</span></div>
</td></tr>
<tr><td style="padding: 2.25pt;"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">9<o:p></o:p></span></div>
</td><td style="padding: 2.25pt; width: 173.25pt;" width="231"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Database name to ID translation - System function that will provide the database ID when passed the database name from the database system table<o:p></o:p></span></div>
</td><td style="padding: 2.25pt; width: 199.5pt;" width="266"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">-- Returns 1</span><br />
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">SELECT DB_ID('master')</span><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">GO</span></div>
</td><td style="padding: 2.25pt; width: 204pt;" width="272"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">-- Returns 1</span><br />
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">SELECT DB_ID('master');</span><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">GO</span></div>
</td></tr>
<tr><td style="padding: 2.25pt;"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">10<o:p></o:p></span></div>
</td><td style="padding: 2.25pt; width: 173.25pt;" width="231"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">Database status - System function that will return the value for 1 of ~25 database specific values<o:p></o:p></span></div>
</td><td style="padding: 2.25pt; width: 199.5pt;" width="266"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">SELECT DATABASEPROPERTYEX('master', 'Status')</span><br />
<span style="color: #444444; font-family: Georgia, Times New Roman, serif;">GO</span></div>
</td><td style="padding: 2.25pt; width: 204pt;" width="272"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #444444;">SELECT DATABASEPROPERTYEX('master', 'Status');</span></span><br />
<span style="font-family: Georgia, Times New Roman, serif;">GO</span></div>
</td></tr>
</tbody></table>
<br />
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<o:p><span style="font-family: Georgia, Times New Roman, serif;"><br /></span></o:p></div>
<div class="MsoNormal">
<o:p><span style="color: #444444; font-family: Georgia, Times New Roman, serif;">References were taken from below sources</span></o:p></div>
<div class="MsoNormal">
</div>
<div>
</div>
<br />
<a href="https://msdn.microsoft.com/en-us/library/ms345408(v=sql.105).aspx">https://msdn.microsoft.com/en-us/library/ms345408(v=sql.105).aspx</a><br />
<a href="http://www.madeiradata.com/moving-system-databases/">http://www.madeiradata.com/moving-system-databases/</a><br />
<a href="http://www.sqlservercentral.com/articles/Administration/movingsystemdatabasesachecklist/1608/">http://www.sqlservercentral.com/articles/Administration/movingsystemdatabasesachecklist/1608/</a><br />
<u1:p></u1:p><br />
<div class="MsoNormal">
</div>
<br />
<div style="-webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;">
<br /></div>
</div>
</div>
Krutihttp://www.blogger.com/profile/13385897521211871375noreply@blogger.com1