{"id":569,"date":"2016-11-28T21:01:07","date_gmt":"2016-11-28T21:01:07","guid":{"rendered":"https:\/\/www.sharepoint13.org\/?p=569"},"modified":"2016-11-28T21:08:35","modified_gmt":"2016-11-28T21:08:35","slug":"ola-hallengrens-sql-maintenance-sollution","status":"publish","type":"post","link":"https:\/\/www.sharepoint13.org\/?p=569","title":{"rendered":"Ola Hallengren&rsquo;s SQL Maintenance Solution"},"content":{"rendered":"<p>Here is a a 1-2-3 guide to implement his solution \u2013a solution used by Citi Bank, Well Fargo, Target, several Universities and a whole bunch of other companies and organizations. More info on the web page <a href=\"http:\/\/ola.hallengren.com\">http:\/\/ola.hallengren.com<\/a> <\/p>\n<p><strong>Step 1.<\/strong> Download <a href=\"https:\/\/ola.hallengren.com\/scripts\/MaintenanceSolution.sql\">MaintenanceSolution.sql<\/a>. This script creates all the objects and jobs that you need.<\/p>\n<p><strong>Step 2<\/strong>. Create a new database \u201cDBAUtility\u201c    <br \/><a href=\"https:\/\/www.sharepoint13.org\/wp-content\/uploads\/2016\/11\/pic1.png\"><img loading=\"lazy\" decoding=\"async\" title=\"pic1\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"pic1\" src=\"https:\/\/www.sharepoint13.org\/wp-content\/uploads\/2016\/11\/pic1_thumb.png\" width=\"244\" height=\"220\" \/><\/a><\/p>\n<p><strong>Step 3.<\/strong> Open query window in SSMS and Paste the MaintenanceSolution.sql script. Modify the script to Use [DBAUtility] (Default is Master). Set @BackupDirectory to your root directory (a folder with servername + db\u2019s name is created at fisrt run). Set @CleanupTime in hours, after wich backupfiles will be deleted \u2013no data here and backupfiles stays in Backupdirectory for ever \u2013 in the picture I use 23 hrs.<\/p>\n<p>&#160;<a href=\"https:\/\/www.sharepoint13.org\/wp-content\/uploads\/2016\/11\/image-1.png\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/www.sharepoint13.org\/wp-content\/uploads\/2016\/11\/image_thumb-1.png\" width=\"443\" height=\"390\" \/><\/a>     <br \/>Execute the query and the script will create several stored procedures and a Command log table.<\/p>\n<p><strong>Step 4.<\/strong> Schedule the jobs according to you\u2019r backup strategy, a best practice is to run Integrity Check before a full backup. <\/p>\n<p><a href=\"https:\/\/www.sharepoint13.org\/wp-content\/uploads\/2016\/11\/image-2.png\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/www.sharepoint13.org\/wp-content\/uploads\/2016\/11\/image_thumb-2.png\" width=\"491\" height=\"91\" \/><\/a><\/p>\n<p>Good Luck!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is a a 1-2-3 guide to implement his solution \u2013a solution used by Citi Bank, Well Fargo, Target, several Universities and a whole bunch of other companies and organizations. More info on the web<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24],"tags":[42],"class_list":["post-569","post","type-post","status-publish","format-standard","hentry","category-sql","tag-sql"],"_links":{"self":[{"href":"https:\/\/www.sharepoint13.org\/index.php?rest_route=\/wp\/v2\/posts\/569","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sharepoint13.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sharepoint13.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sharepoint13.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sharepoint13.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=569"}],"version-history":[{"count":4,"href":"https:\/\/www.sharepoint13.org\/index.php?rest_route=\/wp\/v2\/posts\/569\/revisions"}],"predecessor-version":[{"id":575,"href":"https:\/\/www.sharepoint13.org\/index.php?rest_route=\/wp\/v2\/posts\/569\/revisions\/575"}],"wp:attachment":[{"href":"https:\/\/www.sharepoint13.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=569"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sharepoint13.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=569"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sharepoint13.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=569"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}