{"id":6073,"date":"2022-08-31T10:20:53","date_gmt":"2022-08-31T10:20:53","guid":{"rendered":"https:\/\/pariswells.com\/blog\/?p=6073"},"modified":"2022-08-31T10:20:53","modified_gmt":"2022-08-31T10:20:53","slug":"sql-best-practice","status":"publish","type":"post","link":"https:\/\/pariswells.com\/blog\/research\/sql-best-practice","title":{"rendered":"SQL Best Practice"},"content":{"rendered":"<ol><li>Create 4 Drives\u00a0<ol><li>Data for SQL DB F:\\<\/li><li>Logs E:\\<\/li><li>TempDB G:\\<\/li><li>Backups H:\\<\/li><\/ol><\/li><\/ol><p>Install DB to F:\\MSSQLSERVER\\<\/p><p id=\"cpgIQVU\"><img loading=\"lazy\" decoding=\"async\" width=\"940\" height=\"642\" class=\"alignnone size-full wp-image-6074  img-responsive\" src=\"http:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f33358edfa.png\" alt=\"\" srcset=\"https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f33358edfa.png 940w, https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f33358edfa-300x205.png 300w, https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f33358edfa-768x525.png 768w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><\/p><p>Install Client Tools by Defaults and Anything else you might need<\/p><p id=\"rcaiMmv\"><img loading=\"lazy\" decoding=\"async\" width=\"940\" height=\"645\" class=\"alignnone size-full wp-image-6075  img-responsive\" src=\"http:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f333d69df3.png\" alt=\"\" srcset=\"https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f333d69df3.png 940w, https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f333d69df3-300x206.png 300w, https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f333d69df3-768x527.png 768w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><\/p><p>&nbsp;<\/p><p><strong>Setup GMSA service accounts for SQL Service and Agent<\/strong><\/p><p>[pastacode lang=&#8221;powershell&#8221; manual=&#8221;New-ADServiceAccount%20gmsa_sql02%20-DNSHostName%20gmsa_sqlinstance.domain.local%20-PrincipalsAllowedToRetrieveManagedPassword%20sqlservername%24%0A%0ANew-ADServiceAccount%20gmsa_sql02agent%20-DNSHostName%20gmsa_sql02agent.domain.local%20-PrincipalsAllowedToRetrieveManagedPassword%20sqlservername%24&#8243; message=&#8221;&#8221; highlight=&#8221;&#8221; provider=&#8221;manual&#8221;\/]<\/p><p>You might need to create RootKeys<\/p><p>[pastacode lang=&#8221;powershell&#8221; manual=&#8221;Add-KdsRootKey%20%E2%80%93EffectiveTime%20((get-date).addhours(-10))&#8221; message=&#8221;&#8221; highlight=&#8221;&#8221; provider=&#8221;manual&#8221;\/]<\/p><p>Setup Service to this :<\/p><p id=\"mdZRstu\"><img loading=\"lazy\" decoding=\"async\" width=\"940\" height=\"531\" class=\"alignnone size-full wp-image-6076  img-responsive\" src=\"http:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f334fa4246.png\" alt=\"\" srcset=\"https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f334fa4246.png 940w, https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f334fa4246-300x169.png 300w, https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f334fa4246-768x434.png 768w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><\/p><p>&nbsp;<\/p><p id=\"xRlrSLP\"><img loading=\"lazy\" decoding=\"async\" width=\"940\" height=\"659\" class=\"alignnone size-full wp-image-6077  img-responsive\" src=\"http:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f33556fec9.png\" alt=\"\" srcset=\"https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f33556fec9.png 940w, https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f33556fec9-300x210.png 300w, https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f33556fec9-768x538.png 768w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><\/p><p>&nbsp;<\/p><p id=\"TuyZWDw\"><img loading=\"lazy\" decoding=\"async\" width=\"940\" height=\"637\" class=\"alignnone size-full wp-image-6078  img-responsive\" src=\"http:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f335cb0d17.png\" alt=\"\" srcset=\"https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f335cb0d17.png 940w, https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f335cb0d17-300x203.png 300w, https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f335cb0d17-768x520.png 768w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><\/p><p id=\"KjYrcZy\"><img loading=\"lazy\" decoding=\"async\" width=\"940\" height=\"647\" class=\"alignnone size-full wp-image-6079  img-responsive\" src=\"http:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f336309149.png\" alt=\"\" srcset=\"https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f336309149.png 940w, https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f336309149-300x206.png 300w, https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f336309149-768x529.png 768w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><\/p><p><img loading=\"lazy\" decoding=\"async\" width=\"940\" height=\"773\" class=\"alignnone size-full wp-image-6080  img-responsive\" src=\"http:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f336eb0b38.png\" alt=\"\" srcset=\"https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f336eb0b38.png 940w, https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f336eb0b38-300x247.png 300w, https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f336eb0b38-768x632.png 768w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><\/p><p><img loading=\"lazy\" decoding=\"async\" width=\"940\" height=\"823\" class=\"alignnone size-full wp-image-6081  img-responsive\" src=\"http:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f33782587d.png\" alt=\"\" srcset=\"https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f33782587d.png 940w, https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f33782587d-300x263.png 300w, https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f33782587d-768x672.png 768w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><\/p><p>Create New\u00a0New DB called <strong>DBA<\/strong><\/p><p>Run this SQL query against DBA <a href=\"https:\/\/ola.hallengren.com\/\">SQL Server Backup, Integrity Check, Index and Statistics Maintenance (hallengren.com)<\/a> Schedule everything apart from DB Backups , weekly<\/p><p>Run this SQL query against DBA <a href=\"http:\/\/whoisactive.com\/\">http:\/\/whoisactive.com\/<\/a><\/p><p>Run this SQL query against DBA <a href=\"https:\/\/www.brentozar.com\/blitz\/\">https:\/\/www.brentozar.com\/blitz\/<\/a><\/p><p>&nbsp;<\/p><p><strong>Run These Queries<\/strong><\/p><p>[pastacode lang=&#8221;sql&#8221; manual=&#8221;exec%20sp_configure%20&#8217;show%20advanced%20options&#8217;%2C%201%0A%0Areconfigure%0A%0Aexec%20sp_configure%0A%0A%0A%0A%0Aexec%20sp_configure%20&#8217;remote%20admin%20connections&#8217;%2C%201%0A%0Areconfigure%0A%0Aexec%20sp_configure%0A%0A%0A%0A%0Aexec%20sp_configure%20&#8217;show%20advanced%20options&#8217;%2C%200%0A%0Areconfigure%0A%0Aexec%20sp_configure&#8221; message=&#8221;&#8221; highlight=&#8221;&#8221; provider=&#8221;manual&#8221;\/]<\/p><p><strong>Enable Trace Flags on Startup<\/strong><\/p><p><blockquote class=\"wp-embedded-content\" data-secret=\"qqW9uI7oUL\"><a href=\"https:\/\/www.sqlservercentral.com\/articles\/sql-server-trace-flags-complete-list-3\">SQL Server Trace Flags &#8211; Complete list<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;SQL Server Trace Flags - Complete list&#8221; &#8212; SQLServerCentral\" src=\"https:\/\/www.sqlservercentral.com\/articles\/sql-server-trace-flags-complete-list-3\/embed#?secret=ZO3WqNl9lF#?secret=qqW9uI7oUL\" data-secret=\"qqW9uI7oUL\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p><p id=\"mQXJjZC\"><img loading=\"lazy\" decoding=\"async\" width=\"940\" height=\"605\" class=\"alignnone size-full wp-image-6082  img-responsive\" src=\"http:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f3387ceed2.png\" alt=\"\" srcset=\"https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f3387ceed2.png 940w, https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f3387ceed2-300x193.png 300w, https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2022\/08\/img_630f3387ceed2-768x494.png 768w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><\/p><p>&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<p>Create 4 Drives\u00a0Data for SQL DB F:\\Logs E:\\TempDB G:\\Backups H:\\Install DB to F:\\MSSQLSERVER\\Install Client Tools by Defaults and Anything else you might need&nbsp;Setup GMSA service accounts for [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3937,3938,591],"class_list":["post-6073","post","type-post","status-publish","format-standard","hentry","category-research","tag-best","tag-practice","tag-sql"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/6073","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/comments?post=6073"}],"version-history":[{"count":1,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/6073\/revisions"}],"predecessor-version":[{"id":6083,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/6073\/revisions\/6083"}],"wp:attachment":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/media?parent=6073"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/categories?post=6073"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/tags?post=6073"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}