<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>SQL Server Backup Recovery on SQL Server Scripts</title><link>https://www.sqlserver70.com/series/sql-server-backup-recovery/</link><description>Recent content in SQL Server Backup Recovery on SQL Server Scripts</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>SQLServer70.com</copyright><lastBuildDate>Mon, 20 Apr 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://www.sqlserver70.com/series/sql-server-backup-recovery/index.xml" rel="self" type="application/rss+xml"/><item><title>SQL Server Copy-Only Backup Script for Dev Restore</title><link>https://www.sqlserver70.com/post/sql-server-copy-only-backup-script-dev-restore/</link><pubDate>Mon, 20 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.sqlserver70.com/post/sql-server-copy-only-backup-script-dev-restore/</guid><description>
&lt;p&gt;A copy-only backup is a special SQL Server backup that is independent of the normal backup sequence. It does not reset the differential base or interrupt the transaction log backup chain, making it the correct choice when you need an ad-hoc backup for a development or test environment restore without affecting production recovery options.&lt;/p&gt;
&lt;h2 id="purpose-and-overview"&gt;Purpose and Overview&lt;/h2&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="8593449130"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;p&gt;In a standard SQL Server backup strategy, full backups establish a new differential base and log backups form a continuous chain. If you take an unplanned full backup mid-schedule, the next differential backup becomes larger than expected because the base changed. If you take an unplanned log backup, you may break an automated restore chain that depends on log sequence numbers.&lt;/p&gt;</description></item><item><title>SQL Server: Find Databases With No Recent Backup</title><link>https://www.sqlserver70.com/post/sql-server-find-databases-no-recent-backup/</link><pubDate>Sun, 19 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.sqlserver70.com/post/sql-server-find-databases-no-recent-backup/</guid><description>
&lt;p&gt;Finding databases that have not been backed up recently is one of the most important checks a DBA can run. A database that grows unnoticed without a backup is a data loss event waiting to happen. This script queries &lt;code&gt;msdb.dbo.backupset&lt;/code&gt; against &lt;code&gt;sys.databases&lt;/code&gt; to surface any online user database with no full backup in the last 24 hours, or that has never been backed up at all.&lt;/p&gt;
&lt;h2 id="purpose-and-overview"&gt;Purpose and Overview&lt;/h2&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="8593449130"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;p&gt;SQL Server does not alert you by default when a database backup is overdue. If a scheduled backup job fails silently or a new database is created without being added to the backup plan, that database will accumulate changes with no recovery point. The only way to detect this proactively is to query the backup history in &lt;code&gt;msdb&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>SQL Server Backup Compression: Enable and Verify</title><link>https://www.sqlserver70.com/post/sql-server-backup-compression-enable-verify-script/</link><pubDate>Fri, 17 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.sqlserver70.com/post/sql-server-backup-compression-enable-verify-script/</guid><description>
&lt;p&gt;Backup compression reduces the on-disk size of SQL Server backup files and can significantly shorten backup duration by reducing the amount of data written to disk. This post shows how to enable compression at the server level, verify the setting is active, and confirm compression ratios from backup history using the msdb catalog.&lt;/p&gt;
&lt;h2 id="purpose-and-overview"&gt;Purpose and Overview&lt;/h2&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="8593449130"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;p&gt;SQL Server backup compression has been available since SQL Server 2008, but it was initially limited to Enterprise and Developer editions. From SQL Server 2016 SP1 onward it is available in all editions including Standard and Express. Despite this, many instances still run with compression disabled because the default setting is off.&lt;/p&gt;</description></item><item><title>SQL Server Backup History: Duration and Size Report</title><link>https://www.sqlserver70.com/post/sql-server-backup-history-duration-size-report/</link><pubDate>Mon, 13 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.sqlserver70.com/post/sql-server-backup-history-duration-size-report/</guid><description>
&lt;h2 id="query-backup-duration-and-file-size-from-sql-server-history"&gt;Query Backup Duration and File Size from SQL Server History&lt;/h2&gt;
&lt;p&gt;This script queries SQL Server's msdb backup history to report the backup type, start and finish time, duration in minutes, and file size in both megabytes and gigabytes for every backup across all user databases on the server.&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="8593449130"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="purpose-and-overview"&gt;Purpose and Overview&lt;/h2&gt;
&lt;p&gt;Knowing that a backup completed is only part of the picture. DBAs also need to understand how long each backup took and how large the resulting files are. A backup that used to finish in ten minutes now taking an hour is worth investigating. A backup file that is half its usual size may indicate a failed or partial operation. This script, adapted from the DBA-Scripts collection by Bulent Gucuk, joins &lt;code&gt;sys.databases&lt;/code&gt; with &lt;code&gt;msdb.dbo.backupset&lt;/code&gt; and &lt;code&gt;msdb.dbo.backupmediafamily&lt;/code&gt; to surface both duration and size in a single result set. Running it regularly gives you a baseline so that anomalies are easy to spot.&lt;/p&gt;</description></item><item><title>SQL Server Backup Status Report: All Databases</title><link>https://www.sqlserver70.com/post/sql-server-backup-status-report-last-backup-all-databases/</link><pubDate>Fri, 10 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.sqlserver70.com/post/sql-server-backup-status-report-last-backup-all-databases/</guid><description>
&lt;h2 id="check-sql-server-backup-age-across-all-databases"&gt;Check SQL Server Backup Age Across All Databases&lt;/h2&gt;
&lt;p&gt;This script queries the SQL Server backup history catalog to report the most recent full, differential, and transaction log backup for every database, including how many hours and minutes ago each backup completed.&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="8593449130"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="purpose-and-overview"&gt;Purpose and Overview&lt;/h2&gt;
&lt;p&gt;Database backups are your last line of defense against data loss. Knowing exactly when each database was last backed up — and how old that backup is right now — is a fundamental DBA responsibility. This script, originally written by Tim Ford, joins &lt;code&gt;master.sys.databases&lt;/code&gt; with the msdb backup history tables to produce a single report covering all backup types for all databases. It shows the backup finish time, the physical backup file path, and elapsed time in both hours and minutes, making it straightforward to spot any database that has missed a scheduled backup.&lt;/p&gt;</description></item><item><title>SQL Server Verify Backup Files: RESTORE VERIFYONLY</title><link>https://www.sqlserver70.com/post/sql-server-verify-backup-files-restore-verifyonly/</link><pubDate>Mon, 06 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.sqlserver70.com/post/sql-server-verify-backup-files-restore-verifyonly/</guid><description>
&lt;h2 id="verify-sql-server-backup-files-with-restore-verifyonly"&gt;Verify SQL Server Backup Files with RESTORE VERIFYONLY&lt;/h2&gt;
&lt;p&gt;Backup files that cannot be restored are worthless, and many DBAs discover problems only when they attempt an actual restore under pressure. The scripts in this article use &lt;code&gt;RESTORE VERIFYONLY&lt;/code&gt; to confirm that backup files are readable and internally consistent before a real disaster occurs.&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="8593449130"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="purpose-and-overview"&gt;Purpose and Overview&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;RESTORE VERIFYONLY&lt;/code&gt; reads a backup file and validates its structure without writing any data to a database. It checks that the backup set is complete, that all volumes are readable, and that header metadata is intact. It does not verify that every data page is logically consistent, but it catches the most common failure modes: truncated files, corrupted headers, and missing media families.&lt;/p&gt;</description></item><item><title>SQL Server Point-in-Time Restore with STOPAT</title><link>https://www.sqlserver70.com/post/sql-server-point-in-time-restore-script-stopat/</link><pubDate>Sun, 05 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.sqlserver70.com/post/sql-server-point-in-time-restore-script-stopat/</guid><description>
&lt;h2 id="recover-a-sql-server-database-to-a-specific-point-in-time"&gt;Recover a SQL Server Database to a Specific Point in Time&lt;/h2&gt;
&lt;p&gt;SQL Server's &lt;code&gt;RESTORE LOG ... WITH STOPAT&lt;/code&gt; lets you roll a database back to any exact moment covered by your backup chain. This guide walks through querying backup history in &lt;code&gt;msdb&lt;/code&gt;, executing the restore sequence, and verifying the result.&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="8593449130"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="purpose-and-overview"&gt;Purpose and Overview&lt;/h2&gt;
&lt;p&gt;Data loss incidents — accidental deletes, bad deployments, runaway updates — rarely happen at a convenient backup boundary. Point-in-time restore solves this by replaying transaction logs only up to a target timestamp, leaving the database in a consistent state as of that moment.&lt;/p&gt;</description></item></channel></rss>