{"id":1332,"date":"2018-02-05T15:42:20","date_gmt":"2018-02-05T23:42:20","guid":{"rendered":"http:\/\/3.209.169.194\/blogs\/glenn\/?p=1332"},"modified":"2018-02-05T15:42:20","modified_gmt":"2018-02-05T23:42:20","slug":"sqlskills-sql101-how-you-can-make-your-database-backups-more-reliable","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/glenn\/sqlskills-sql101-how-you-can-make-your-database-backups-more-reliable\/","title":{"rendered":"SQLskills SQL101: How You Can Make Your Database Backups More Reliable"},"content":{"rendered":"<p><font size=\"2\">SQLskills has an ongoing initiative to blog about basic topics, which we\u2019re calling SQL101. We\u2019re all blogging about things that we often see done incorrectly, technologies used the wrong way, or where there are many misunderstandings that lead to serious problems. If you want to find all of our <strong>SQLskills SQL101<\/strong> blog posts, check out <\/font><a href=\"https:\/\/www.sqlskills.com\/help\/SQL101\"><font size=\"2\">SQLskills.com\/help\/SQL101<\/font><\/a><font size=\"2\">.<\/font><\/p>\n<p><font size=\"2\">Since my colleague <a href=\"https:\/\/www.sqlskills.com\/blogs\/paul\/\">Paul Randal<\/a> wrote <a href=\"https:\/\/www.sqlskills.com\/blogs\/paul\/category\/checkdb-from-every-angle\/\">DBCC CHECKDB<\/a> while he was on the SQL Server Product team at Microsoft, he is <a href=\"https:\/\/www.pluralsight.com\/courses\/sqlserver-database-corruption\">an acknowledged expert<\/a> on SQL Server database corruption and repair techniques. Because of this well-earned reputation, we typically get multiple e-mails each week asking for Paul\u2019s <a href=\"https:\/\/www.sqlskills.com\/blogs\/paul\/sqlskills-sql101-dealing-with-sql-server-corruption\/\">advice<\/a> and assistance dealing with database corruption and repair issues.<\/font><\/p>\n<p><font size=\"2\">A typical pattern for these e-mails is that a production SQL Server database has become suspect, and running DBCC CHECKDB fails with some specific series of errors. Depending on exactly what errors are being returned from DBCC CHECKDB, it may be a situation where DBCC CHECKDB cannot do anything to resolve the corruption. In some cases, Paul can go in and do some manual repair work (<a href=\"https:\/\/www.sqlskills.com\/services\/\">at his regular consulting rate<\/a>) to help resolve the issue, but in some cases, even Paul cannot fix the corruption (or he is not immediately available to do any work).<\/font><\/p>\n<p><font size=\"2\">This leaves the last line of defense being restoring from your last set of known, good database backups. Unfortunately, in many cases, it turns out that there are no good database backups available that can actually be restored. If this happens, it is likely to be resume\/CV updating time for the DBA, and possibly even a catastrophic outcome for the existence of your entire organization. So what can you do to minimize the chance of this happening to you or your organization?<\/font><\/p>\n<p><font size=\"2\">Here are a few steps that you can take:<\/font><\/p>\n<p><font size=\"2\"><br \/><\/font><\/p>\n<p><font size=\"3\"><strong>Keep your main system BIOS and all storage-related firmware and drivers up to date<\/strong><\/font><\/p>\n<p><font size=\"2\">One of the leading causes of database corruption (and backup corruption) are problems with your storage subsystem. These are often caused by out of date versions of your main system BIOS, storage firmware, or storage drivers. The server and component vendors don\u2019t typically go to the trouble of issuing these types of updates unless they are correcting significant issues. <\/font><\/p>\n<p><font size=\"2\">When these type of updates are available, they are often labeled as critical or urgent updates. Reading the release notes for these updates can often give you more information about the issue and the fix for the issue. As a DBA, you want to make sure someone (perhaps you) is monitoring this situation for your database servers.<\/font><\/p>\n<p><font size=\"2\"><br \/><\/font><\/p>\n<p><font size=\"3\"><strong>Use SQL Server Agent Alerts to detect important errors on your SQL Server instance<\/strong><\/font><\/p>\n<p><font size=\"2\">Many novice DBAs have never even heard of <a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/ssms\/agent\/alerts\">SQL Server Agent Alerts<\/a>. In a nutshell, they can be used to more quickly detect and possibly react to some types of hardware and software issues and errors that may happen on a SQL Server instance (or its underlying hardware and storage). <\/font><\/p>\n<p><font size=\"2\">Normally, these types of errors will just get logged to the SQL Server Error Log, where they might not be noticed in a timely manner. <\/font><font size=\"2\">Fortunately, <a href=\"https:\/\/www.dropbox.com\/s\/xdxogn2qh57av86\/Add%20SQL%20Server%20Agent%20Alerts.sql?dl=0\">I have a T-SQL script that can create a set of SQL Server Agent Alerts<\/a> for many common issues. I also have a blog post <a href=\"https:\/\/www.sqlskills.com\/blogs\/glenn\/creating-sql-server-agent-alerts-for-critical-errors\/\">with more details here<\/a>.<\/font><\/p>\n<p><font size=\"2\"><br \/><\/font><\/p>\n<p><font size=\"3\"><strong>Make sure all of your databases are using CHECKSUM for their Page_Verify option<\/strong><\/font><\/p>\n<p><font size=\"2\">CHECKSUM is the default page_verify setting for new databases <a href=\"https:\/\/support.microsoft.com\/en-us\/help\/2078345\/-the-database-page-verify-checksum-option-can-help-detect-database-con\">since SQL Server 2005<\/a>, but you might have older databases that have been upgraded over the years where the page_verify setting was never changed. You also might have a situation where someone has purposely switched the page_verify setting to TORN_PAGE or NONE for some strange reason.<\/font><\/p>\n<p><font size=\"2\">When CHECKSUM is enabled for the PAGE_VERIFY database option, the SQL Server Database Engine calculates a checksum over the contents of the whole page, and stores the value in the page header when a page is written to disk. When the page is read from disk, the checksum is recomputed and compared to the checksum value that is stored in the page header. <\/font><font size=\"2\">I <a href=\"https:\/\/www.sqlskills.com\/blogs\/glenn\/setting-your-page-verify-database-option-to-checksum\/\">previously wrote about this issue here<\/a>.<\/font><\/p>\n<p><font size=\"2\"><br \/><\/font><\/p>\n<p><font size=\"3\"><strong>Make sure you are using the CHECKSUM option with your database backups<\/strong><\/font><\/p>\n<p><font size=\"2\">You can (and should) <a href=\"https:\/\/support.microsoft.com\/en-us\/help\/2656988\/how-to-enable-the-checksum-option-if-backup-utilities-do-not-expose-th\">add the CHECKSUM option<\/a> whenever you run any type of database backup. <a href=\"https:\/\/www.sqlskills.com\/blogs\/erin\/backup-checksum-default-option-in-sql-server-2014\/\">Since SQL Server 2014<\/a>, you have had the ability to set an instance-level setting (with sp_configure) to add this option to backup commands by default, just in case someone (or a 3rd party backup solution) does not add the option in the actual backup command. With older versions of SQL Server, you can also get the same effect by adding Trace Flag 3023 as a start-up trace flag You can also enable\/disable TF 3023 dynamically.<\/font><\/p>\n<p><font size=\"2\">Adding the CHECKSUM syntax to the backup command forces SQL Server to verify any existing page checksums as it reads pages for the backup, and it calculates a checksum over the entire backup. Adding the CHECKSUM option is not a replacement for actually restoring a database backup to see if it is good or not, but it is a good intermediate step in the process.<\/font><\/p>\n<p><font size=\"2\"><br \/><\/font><\/p>\n<p><font size=\"3\"><strong>Actually restore your database backups on a regular basis to verify that they are good<\/strong><\/font><\/p>\n<p><font size=\"2\">This is the only way to be absolutely sure that your database backups are good. These other steps will increase the chances that your database backups are good, but an actual database restore is the acid test. You should be doing this on a regular basis, in an automated fashion.<\/font><\/p>\n<p><font size=\"2\">Microsoft has some <a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/relational-databases\/backup-restore\/back-up-and-restore-of-sql-server-databases\">foundational guidance about backup and restore operations here<\/a>. Paul Randal has a Pluralsight course called <a href=\"https:\/\/www.pluralsight.com\/courses\/sqlserver-understanding-performing-backups\">SQL Server: Understanding and Performing Backups<\/a>.<\/font><\/p>\n<p><font size=\"2\"><br \/><\/font><\/p>\n<p><font size=\"2\">The whole subject of avoiding database corruption and having an effective database backup and restore strategy to meet your <a href=\"https:\/\/en.wikipedia.org\/wiki\/Recovery_point_objective\">RPO<\/a> and <a href=\"https:\/\/en.wikipedia.org\/wiki\/Recovery_time_objective\">RTO<\/a> goals is far more extensive than I want to cover in a single SQL101 blog post. Hopefully the information in this post has been a good starting point.<\/font><\/p>\n<p><font size=\"2\"><br \/><\/font><\/p>\n<p><font size=\"2\"><br \/><\/font><\/p>\n<p><font size=\"2\"><br \/><\/font><\/p>\n<p><font size=\"2\"><br \/><\/font><\/p>\n<p><font size=\"2\"><br \/><\/font><\/p>\n","protected":false},"excerpt":{"rendered":"<p>SQLskills has an ongoing initiative to blog about basic topics, which we\u2019re calling SQL101. We\u2019re all blogging about things that we often see done incorrectly, technologies used the wrong way, or where there are many misunderstandings that lead to serious problems. If you want to find all of our SQLskills SQL101 blog posts, check out [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[309],"tags":[369,371,370],"class_list":["post-1332","post","type-post","status-publish","format-standard","hentry","category-sql101","tag-backup","tag-corruption","tag-restore"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>SQLskills SQL101: How You Can Make Your Database Backups More Reliable - Glenn Berry<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlskills.com\/blogs\/glenn\/sqlskills-sql101-how-you-can-make-your-database-backups-more-reliable\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQLskills SQL101: How You Can Make Your Database Backups More Reliable - Glenn Berry\" \/>\n<meta property=\"og:description\" content=\"SQLskills has an ongoing initiative to blog about basic topics, which we\u2019re calling SQL101. We\u2019re all blogging about things that we often see done incorrectly, technologies used the wrong way, or where there are many misunderstandings that lead to serious problems. If you want to find all of our SQLskills SQL101 blog posts, check out [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/glenn\/sqlskills-sql101-how-you-can-make-your-database-backups-more-reliable\/\" \/>\n<meta property=\"og:site_name\" content=\"Glenn Berry\" \/>\n<meta property=\"article:published_time\" content=\"2018-02-05T23:42:20+00:00\" \/>\n<meta name=\"author\" content=\"Glenn Berry\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Glenn Berry\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/glenn\/sqlskills-sql101-how-you-can-make-your-database-backups-more-reliable\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/glenn\/sqlskills-sql101-how-you-can-make-your-database-backups-more-reliable\/\",\"name\":\"SQLskills SQL101: How You Can Make Your Database Backups More Reliable - Glenn Berry\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/glenn\/#website\"},\"datePublished\":\"2018-02-05T23:42:20+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/glenn\/#\/schema\/person\/57a8972435106bac7970692fcf5edfa7\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/glenn\/sqlskills-sql101-how-you-can-make-your-database-backups-more-reliable\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/glenn\/sqlskills-sql101-how-you-can-make-your-database-backups-more-reliable\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/glenn\/sqlskills-sql101-how-you-can-make-your-database-backups-more-reliable\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/glenn\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQLskills SQL101: How You Can Make Your Database Backups More Reliable\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/glenn\/#website\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/glenn\/\",\"name\":\"Glenn Berry\",\"description\":\"Semi-random musings about SQL Server performance\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqlskills.com\/blogs\/glenn\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/glenn\/#\/schema\/person\/57a8972435106bac7970692fcf5edfa7\",\"name\":\"Glenn Berry\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/glenn\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/64bdac8830f25f2f8cc780f8a1286c66ff1182218009271e7a953639596f7e25?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/64bdac8830f25f2f8cc780f8a1286c66ff1182218009271e7a953639596f7e25?s=96&d=mm&r=g\",\"caption\":\"Glenn Berry\"},\"sameAs\":[\"https:\/\/www.sqlskills.com\/blogs\/glenn\/\"],\"url\":\"https:\/\/www.sqlskills.com\/blogs\/glenn\/author\/glenn\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SQLskills SQL101: How You Can Make Your Database Backups More Reliable - Glenn Berry","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqlskills.com\/blogs\/glenn\/sqlskills-sql101-how-you-can-make-your-database-backups-more-reliable\/","og_locale":"en_US","og_type":"article","og_title":"SQLskills SQL101: How You Can Make Your Database Backups More Reliable - Glenn Berry","og_description":"SQLskills has an ongoing initiative to blog about basic topics, which we\u2019re calling SQL101. We\u2019re all blogging about things that we often see done incorrectly, technologies used the wrong way, or where there are many misunderstandings that lead to serious problems. If you want to find all of our SQLskills SQL101 blog posts, check out [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/glenn\/sqlskills-sql101-how-you-can-make-your-database-backups-more-reliable\/","og_site_name":"Glenn Berry","article_published_time":"2018-02-05T23:42:20+00:00","author":"Glenn Berry","twitter_misc":{"Written by":"Glenn Berry","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/glenn\/sqlskills-sql101-how-you-can-make-your-database-backups-more-reliable\/","url":"https:\/\/www.sqlskills.com\/blogs\/glenn\/sqlskills-sql101-how-you-can-make-your-database-backups-more-reliable\/","name":"SQLskills SQL101: How You Can Make Your Database Backups More Reliable - Glenn Berry","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/glenn\/#website"},"datePublished":"2018-02-05T23:42:20+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/glenn\/#\/schema\/person\/57a8972435106bac7970692fcf5edfa7"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/glenn\/sqlskills-sql101-how-you-can-make-your-database-backups-more-reliable\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/glenn\/sqlskills-sql101-how-you-can-make-your-database-backups-more-reliable\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/glenn\/sqlskills-sql101-how-you-can-make-your-database-backups-more-reliable\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/glenn\/"},{"@type":"ListItem","position":2,"name":"SQLskills SQL101: How You Can Make Your Database Backups More Reliable"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlskills.com\/blogs\/glenn\/#website","url":"https:\/\/www.sqlskills.com\/blogs\/glenn\/","name":"Glenn Berry","description":"Semi-random musings about SQL Server performance","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlskills.com\/blogs\/glenn\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.sqlskills.com\/blogs\/glenn\/#\/schema\/person\/57a8972435106bac7970692fcf5edfa7","name":"Glenn Berry","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlskills.com\/blogs\/glenn\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/64bdac8830f25f2f8cc780f8a1286c66ff1182218009271e7a953639596f7e25?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/64bdac8830f25f2f8cc780f8a1286c66ff1182218009271e7a953639596f7e25?s=96&d=mm&r=g","caption":"Glenn Berry"},"sameAs":["https:\/\/www.sqlskills.com\/blogs\/glenn\/"],"url":"https:\/\/www.sqlskills.com\/blogs\/glenn\/author\/glenn\/"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/glenn\/wp-json\/wp\/v2\/posts\/1332","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/glenn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/glenn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/glenn\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/glenn\/wp-json\/wp\/v2\/comments?post=1332"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/glenn\/wp-json\/wp\/v2\/posts\/1332\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/glenn\/wp-json\/wp\/v2\/media?parent=1332"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/glenn\/wp-json\/wp\/v2\/categories?post=1332"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/glenn\/wp-json\/wp\/v2\/tags?post=1332"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}