{"id":546,"date":"2016-03-23T10:47:55","date_gmt":"2016-03-23T15:47:55","guid":{"rendered":"http:\/\/www.sqlfreelancer.com\/blog\/?p=546"},"modified":"2016-04-15T09:03:44","modified_gmt":"2016-04-15T14:03:44","slug":"creating-a-backup-plan-on-sql-express-using-ola-hallengrens-scripts","status":"publish","type":"post","link":"https:\/\/www.sqlfreelancer.com\/blog\/creating-a-backup-plan-on-sql-express-using-ola-hallengrens-scripts\/","title":{"rendered":"Creating a Backup plan on SQL Express using Ola Hallengren&#8217;s scripts"},"content":{"rendered":"<p>SQL Express doesn\u2019t have the SQL Server Agent so we can\u2019t schedule jobs like normal. Follow this post to create a backup plan that will back up all the databases using Windows Task Scheduler.<\/p>\n<ul>\n<li>\nDownload CommandExecute &#8211; https:\/\/ola.hallengren.com\/scripts\/CommandExecute.sql<\/li>\n<li>Download DatabaseBackup &#8211; https:\/\/ola.hallengren.com\/scripts\/DatabaseBackup.sql<\/li>\n<li>Execute both of these stored procedures against the target server\n<\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2016\/03\/Backups-with-Ola-1.png\" rel=\"attachment wp-att-547\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-547\" src=\"https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2016\/03\/Backups-with-Ola-1.png\" alt=\"Backups with Ola 1\" width=\"331\" height=\"273\" srcset=\"https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2016\/03\/Backups-with-Ola-1.png 331w, https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2016\/03\/Backups-with-Ola-1-300x247.png 300w\" sizes=\"auto, (max-width: 331px) 100vw, 331px\" \/><br \/>\n<\/a><\/p>\n<ul>\n<li>Open Notepad on the target server and copy the following code changing the path to where the backups will be stored and the cleanup time. The cleanup time is specified in hours :<\/li>\n<\/ul>\n<pre>EXECUTE dbo.DatabaseBackup\r\n@Databases = 'USER_DATABASES',\r\n@Directory = 'C:\\Backups',\r\n@BackupType = 'FULL',\r\n@Compress = 'Y', \r\n@CleanupTime = 48\r\n<\/pre>\n<ul>\n<li>Save the file with a .sql extension<\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2016\/03\/Backups-with-Ola-2.png\" rel=\"attachment wp-att-549\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-549\" src=\"https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2016\/03\/Backups-with-Ola-2.png\" alt=\"Backups with Ola 2\" width=\"624\" height=\"437\" srcset=\"https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2016\/03\/Backups-with-Ola-2.png 624w, https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2016\/03\/Backups-with-Ola-2-300x210.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/a><\/p>\n<ul>\n<li>Start the Task Scheduler by clicking on StartMenu\/All Programs\/Accessories\/System Tools\/Task Schedule<\/li>\n<li>Click Create Basic Task to start the Scheduled Task Wizard<\/li>\n<li>Type a name for the Task<\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2016\/03\/Backups-with-Ola-3.png\" rel=\"attachment wp-att-550\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-550\" src=\"https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2016\/03\/Backups-with-Ola-3.png\" alt=\"Backups with Ola 3\" width=\"624\" height=\"431\" srcset=\"https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2016\/03\/Backups-with-Ola-3.png 624w, https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2016\/03\/Backups-with-Ola-3-300x207.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/a><\/p>\n<ul>\n<li>Choose Daily from the scheduling options<\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2016\/03\/Backups-with-Ola-4.png\" rel=\"attachment wp-att-553\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-553\" src=\"https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2016\/03\/Backups-with-Ola-4.png\" alt=\"Backups with Ola 4\" width=\"624\" height=\"434\" srcset=\"https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2016\/03\/Backups-with-Ola-4.png 624w, https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2016\/03\/Backups-with-Ola-4-300x209.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/a><\/p>\n<ul>\n<li>Click Next, specify the information about the time to run the task. Set Start Time to an appropriate value when the load on the server is low. Set the recur every option to 1 day and click Next<\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2016\/03\/Backups-with-Ola-5.png\" rel=\"attachment wp-att-554\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-554\" src=\"https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2016\/03\/Backups-with-Ola-5.png\" alt=\"Backups with Ola 5\" width=\"624\" height=\"433\" srcset=\"https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2016\/03\/Backups-with-Ola-5.png 624w, https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2016\/03\/Backups-with-Ola-5-300x208.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/a><\/p>\n<ul>\n<li>Click Browse. Browse to SQLCMD.exe (C:\\Program Files\\Microsoft SQL Server\\Client SDK\\ODBC\\110\\Tools\\Binn\\SQLCMD.EXE) and then click Open<\/li>\n<li>Type the following content to the Add arguments text box and then click Next\n<ul>\n<li>\u2013S <em>ServerName<\/em> \u2013i \u201cc:\\SQLScripts\\SQLBackups.sql\u201d<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2016\/03\/Backups-with-Ola-7.png\" rel=\"attachment wp-att-555\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-555\" src=\"https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2016\/03\/Backups-with-Ola-7.png\" alt=\"Backups with Ola 7\" width=\"624\" height=\"432\" srcset=\"https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2016\/03\/Backups-with-Ola-7.png 624w, https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2016\/03\/Backups-with-Ola-7-300x208.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/a><\/p>\n<ul>\n<li>Select the checkbox to Open the Advanced Properties for this task and click Finish<\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2016\/03\/Backups-with-Ola-8.png\" rel=\"attachment wp-att-556\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-556\" src=\"https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2016\/03\/Backups-with-Ola-8.png\" alt=\"Backups with Ola 8\" width=\"624\" height=\"431\" srcset=\"https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2016\/03\/Backups-with-Ola-8.png 624w, https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2016\/03\/Backups-with-Ola-8-300x207.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/a><\/p>\n<ul>\n<li>Check Run whether user is logged in or not and Run with highest privileges under Security Options then click OK.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2016\/03\/Backups-with-Ola-9.png\" rel=\"attachment wp-att-557\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-557\" src=\"https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2016\/03\/Backups-with-Ola-9.png\" alt=\"Backups with Ola 9\" width=\"624\" height=\"467\" srcset=\"https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2016\/03\/Backups-with-Ola-9.png 624w, https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2016\/03\/Backups-with-Ola-9-300x225.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/a><\/p>\n<p>**Note**<\/p>\n<p>You may have to run this in the command prompt until it succeeds and copy exactly from CMD into the arguments section<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SQL Express doesn\u2019t have the SQL Server Agent so we can\u2019t schedule jobs like normal. Follow this post to create a backup plan that will back up all the databases using Windows Task Scheduler. Download CommandExecute &#8211; https:\/\/ola.hallengren.com\/scripts\/CommandExecute.sql Download DatabaseBackup &#8211; https:\/\/ola.hallengren.com\/scripts\/DatabaseBackup.sql Execute both of these stored procedures against the target server Open Notepad on [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[104,91],"tags":[116,14],"class_list":["post-546","post","type-post","status-publish","format-standard","hentry","category-backuprestore","category-maintenance","tag-automation","tag-backuprestore"],"_links":{"self":[{"href":"https:\/\/www.sqlfreelancer.com\/blog\/wp-json\/wp\/v2\/posts\/546","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlfreelancer.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlfreelancer.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlfreelancer.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlfreelancer.com\/blog\/wp-json\/wp\/v2\/comments?post=546"}],"version-history":[{"count":7,"href":"https:\/\/www.sqlfreelancer.com\/blog\/wp-json\/wp\/v2\/posts\/546\/revisions"}],"predecessor-version":[{"id":562,"href":"https:\/\/www.sqlfreelancer.com\/blog\/wp-json\/wp\/v2\/posts\/546\/revisions\/562"}],"wp:attachment":[{"href":"https:\/\/www.sqlfreelancer.com\/blog\/wp-json\/wp\/v2\/media?parent=546"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlfreelancer.com\/blog\/wp-json\/wp\/v2\/categories?post=546"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlfreelancer.com\/blog\/wp-json\/wp\/v2\/tags?post=546"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}