<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Backup &amp; Recovery on Andy M Mallon - AM²</title><link>https://am2.co/tag/backup-recovery/</link><description>Recent content in Backup &amp; Recovery on Andy M Mallon - AM²</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Fri, 22 Apr 2022 01:10:13 -0400</lastBuildDate><atom:link href="https://am2.co/tag/backup-recovery/index.xml" rel="self" type="application/rss+xml"/><item><title>How do I generate the private key needed to restore the encrypted backup?</title><link>https://am2.co/2022/04/22/how-do-i-generate-the-private-key-needed-to-restore-the-encrypted-backup/</link><pubDate>Fri, 22 Apr 2022 01:10:13 -0400</pubDate><guid>https://am2.co/2022/04/22/how-do-i-generate-the-private-key-needed-to-restore-the-encrypted-backup/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/311218/52344"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;I'm simulating the situation where I take a backup from instance &lt;strong&gt;A&lt;/strong&gt; and restore it on instance &lt;strong&gt;B&lt;/strong&gt;. I followed the doc to &lt;a href="https://learn.microsoft.com/en-us/sql/relational-databases/backup-restore/create-an-encrypted-backup?view=sql-server-ver15#backup-to-disk-with-encryption" rel="nofollow noreferrer"&gt;Backup to Disk with Encryption&lt;/a&gt;. Since I'm using only my desktop to simulate the whole process, after taking the backup of the database I took a backup of the certificate that was used as follows:&lt;/p&gt;</description></item><item><title>How to await the execution of the rds_backup_database stored procedure?</title><link>https://am2.co/2022/03/03/how-to-await-the-execution-of-the-rds_backup_database-stored-procedure/</link><pubDate>Thu, 03 Mar 2022 13:40:49 -0500</pubDate><guid>https://am2.co/2022/03/03/how-to-await-the-execution-of-the-rds_backup_database-stored-procedure/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/308227/52344"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;Our team is migrating one of our databases to Amazon RDS MS SQL Server. As part of that, we have to rewrite some of our stored procedures.&lt;/p&gt;&#10;&lt;p&gt;We have a stored procedure that performs a database backup to a network storage.&lt;/p&gt;</description></item><item><title>Is it possible to do a partial transaction log backup with SQL Server 2017? I don't have enough disk space to do a full backup</title><link>https://am2.co/2021/10/15/is-it-possible-to-do-a-partial-transaction-log-backup-with-sql-server-2017-i-dont-have-enough-disk-space-to-do-a-full-backup/</link><pubDate>Fri, 15 Oct 2021 18:12:37 -0400</pubDate><guid>https://am2.co/2021/10/15/is-it-possible-to-do-a-partial-transaction-log-backup-with-sql-server-2017-i-dont-have-enough-disk-space-to-do-a-full-backup/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/301199/52344"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;Inherited a database server to maintain and found that the transaction log is 92 GB. My plan is to do the backup of that and get it brought back down to a regular size, then fix it. The problem is I don't have enough disk space on the machine to do the backup locally, then offload. Is there a way I can run the backup for a specified size or time period so I can do it in stages?&lt;/p&gt;</description></item><item><title>Always backup database with encryption</title><link>https://am2.co/2021/09/12/always-backup-database-with-encryption/</link><pubDate>Sun, 12 Sep 2021 12:36:06 -0400</pubDate><guid>https://am2.co/2021/09/12/always-backup-database-with-encryption/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/299456/52344"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;Is there a way to force all database and log backups run on the server to be encrypted?&lt;/p&gt;&#10;&lt;p&gt;If encryption is not specified, the query will be terminated.&lt;/p&gt;&#10;&lt;p class="qa-attribution qa-attribution-asked"&gt;&lt;span class="qa-attribution-label"&gt;Asked&lt;/span&gt;&lt;span class="qa-attribution-date"&gt;&lt;a href="https://dba.stackexchange.com/q/299456/52344" rel="noopener" target="_blank"&gt;2021-09-12&lt;/a&gt;&lt;/span&gt;&lt;span class="qa-attribution-by"&gt;by&lt;/span&gt;&lt;span class="qa-attribution-user"&gt;&lt;a href="https://dba.stackexchange.com/users/176952" rel="noopener" target="_blank"&gt;Avi&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&#10;&lt;hr&gt;&#10;&lt;h2 id="answer"&gt;Answer&lt;/h2&gt;&#10;&lt;h2 id="not-in-sql-server"&gt;Not in SQL Server&lt;/h2&gt;&#10;&lt;p&gt;There is no option to force &lt;code&gt;BACKUP DATABASE&lt;/code&gt; &amp;amp; &lt;code&gt;BACKUP LOG&lt;/code&gt; to specify &lt;code&gt;WITH ENCRYPTION...&lt;/code&gt; as part of backup commands in SQL Server.&lt;/p&gt;</description></item><item><title>SQL Server 2019 Database stuck In Recovery state after restart</title><link>https://am2.co/2020/09/23/sql-server-2019-database-stuck-in-recovery-state-after-restart/</link><pubDate>Wed, 23 Sep 2020 07:44:23 -0400</pubDate><guid>https://am2.co/2020/09/23/sql-server-2019-database-stuck-in-recovery-state-after-restart/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/275934/52344"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;SQL Server was restarted by mistake, when it came online, database came back in &amp;quot;In Recovery&amp;quot; mode.&lt;/p&gt;&#10;&lt;p&gt;Check from error it says &amp;quot;Recovery of database 'DB1' (5) is 8% complete (approximately 27146 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.&lt;/p&gt;</description></item><item><title>How to see restore history of a deleted database?</title><link>https://am2.co/2019/11/23/how-to-see-restore-history-of-a-deleted-database/</link><pubDate>Sat, 23 Nov 2019 21:33:37 -0500</pubDate><guid>https://am2.co/2019/11/23/how-to-see-restore-history-of-a-deleted-database/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/253996/52344"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;For example, I had a database and I want to see which physical backup file was used to restore into it. The problem is that the database was deleted. How can I see the record?&lt;/p&gt;&#10;&lt;p class="qa-attribution qa-attribution-asked"&gt;&lt;span class="qa-attribution-label"&gt;Asked&lt;/span&gt;&lt;span class="qa-attribution-date"&gt;&lt;a href="https://dba.stackexchange.com/q/253996/52344" rel="noopener" target="_blank"&gt;2019-11-23&lt;/a&gt;&lt;/span&gt;&lt;span class="qa-attribution-by"&gt;by&lt;/span&gt;&lt;span class="qa-attribution-user"&gt;&lt;a href="https://dba.stackexchange.com/users/174155" rel="noopener" target="_blank"&gt;sql-noob&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&#10;&lt;hr&gt;&#10;&lt;h2 id="answer"&gt;Answer&lt;/h2&gt;&#10;&lt;p&gt;Depending on how the database was dropped, your luck will vary considerably.&lt;/p&gt;</description></item><item><title>Why can't I restore encrypted backup through front end?</title><link>https://am2.co/2019/10/30/restore-encrypted-backup/</link><pubDate>Wed, 30 Oct 2019 12:41:23 -0400</pubDate><guid>https://am2.co/2019/10/30/restore-encrypted-backup/</guid><description>&lt;p&gt;&lt;a href="https://serverfault.com/q/989930/299354"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;I&amp;rsquo;m just starting to experiment with encrypting backups, I think I now understand it and have got the process working, but something strange is happening with restoring.&lt;/p&gt;&#10;&lt;p&gt;On &lt;strong&gt;Server A&lt;/strong&gt; (SQL 2014 Standard) I have created a new master key and certificate and successfully produced an encrypted bak file and have also exported the key and cert files.&lt;/p&gt;</description></item><item><title>How does a database RESTORE affect plan cache?</title><link>https://am2.co/2019/10/24/how-does-a-database-restore-affect-plan-cache/</link><pubDate>Thu, 24 Oct 2019 10:12:48 -0400</pubDate><guid>https://am2.co/2019/10/24/how-does-a-database-restore-affect-plan-cache/</guid><description>&lt;p&gt;If you restore a database, what does that do to the plan cache? Well, let&amp;rsquo;s start by looking at &lt;a href="https://web.archive.org/web/20190906084812/https://docs.microsoft.com/en-us/sql/t-sql/statements/restore-statements-transact-sql?view=sql-server-2017#general-remarks" rel="noopener noreferrer" target="_blank"&gt;the documentation for RESTORE&lt;/a&gt;. (Emphasis mine)&lt;/p&gt;&#10;&lt;blockquote&gt;&lt;strong&gt;Restoring a database clears the plan cache for the instance of SQL Server.&lt;/strong&gt; Clearing the plan cache causes a recompilation of all subsequent execution plans and can cause a sudden, temporary decrease in query performance. For each cleared cachestore in the plan cache, the SQL Server error log contains the following informational message: " SQL Server has encountered %d occurrence(s) of cachestore flush for the '%s' cachestore (part of plan cache) due to some database maintenance or reconfigure operations". This message is logged every five minutes as long as the cache is flushed within that time interval.&lt;/blockquote&gt;&#10;&lt;figure class="wp-caption alignright" style="max-width:512px"&gt;&lt;a href="https://www.youtube.com/watch?v=RuW1f6FI18g" rel="noopener noreferrer" target="_blank"&gt;&lt;img src="https://am2.co/wp-content/uploads/joshua-naidoo-J954SeqDitQ-unsplash.jpg" alt="" width="512" height="342" class="size-large wp-image-2248" /&gt;&lt;/a&gt; This beautifully restored Mini would clear some cash from my bank account.&lt;/figure&gt;&#10;&lt;p&gt;Yikes. That first sentence sounds like it is going to clear the cache for &lt;strong&gt;the entire instance&lt;/strong&gt;. That seems excessive. If I restore a new database (ie, I am creating a new database from backup), that shouldn&amp;rsquo;t affect the plan cache at all. And if I restore over top an existing database, I would only expect the cache for that one database to be affected. I can&amp;rsquo;t think of a scenario where I would want to &amp;ldquo;clear the plan cache for the instance&amp;rdquo; when doing a restore.&lt;/p&gt;</description></item><item><title>What the heck is Accelerated Database Recovery?</title><link>https://am2.co/2019/10/21/what-the-heck-is-accelerated-database-recovery/</link><pubDate>Mon, 21 Oct 2019 10:00:15 -0400</pubDate><guid>https://am2.co/2019/10/21/what-the-heck-is-accelerated-database-recovery/</guid><description>&lt;figure class="wp-caption alignright" style="max-width:512px"&gt;&lt;a href="https://www.youtube.com/watch?v=54I5RU-RNhQ"&gt;&lt;img src="https://am2.co/wp-content/uploads/eggy-febryano-de_A1VmNapQ-unsplash-1024x768.jpg" alt="" width="512" height="384" class="size-large wp-image-2229" /&gt;&lt;/a&gt; The intersection of Crash Recovery Boulevard and Version Store Avenue is now known as ADR Square.&lt;/figure&gt;&#10;Last week, I wrote about the &lt;a href="https://am2.co/2019/10/15/what-the-heck-is-the-sql-server-version-store/" rel="noopener noreferrer" target="_blank"&gt;SQL Server Version Store&lt;/a&gt;. The week before, I looked at &lt;a href="https://am2.co/2019/10/12/recovery-of-database-is-0-complete-approximately-1000000-seconds-remain/" rel="noopener noreferrer" target="_blank"&gt;crash recovery&lt;/a&gt;. Let's look next at a new feature in SQL Server 2019, where these two features intersect: Accelerated Database Recovery.&#10;&lt;h2 id="what-is-it"&gt;What is it?&lt;/h2&gt;&#10;&lt;p&gt;Accelerated Database Recovery(ADR) is a new feature intended to speed up the recovery process, which could be very slow, particularly when there are long-running, large transactions. ADR is not just for recovery after a crash, but also helps in other scenarios where the transaction log needs to be recovered&amp;ndash;including Availability Group secondary redo and Failover Cluster Instance failovers.&lt;/p&gt;</description></item><item><title>Recovery of database is 0% complete (approximately 1000000 seconds remain)</title><link>https://am2.co/2019/10/12/recovery-of-database-is-0-complete-approximately-1000000-seconds-remain/</link><pubDate>Sat, 12 Oct 2019 10:52:29 -0400</pubDate><guid>https://am2.co/2019/10/12/recovery-of-database-is-0-complete-approximately-1000000-seconds-remain/</guid><description>&lt;div&gt;&lt;figure class="wp-caption alignright" style="max-width:450px"&gt;&lt;a href="https://www.youtube.com/watch?v=eTeg1txDv8w" rel="noopener noreferrer" target="_blank"&gt;&lt;img src="https://am2.co/wp-content/uploads/simon-english-NvSGP844aA4-unsplash.jpg" alt="" width="450" height="300" class="size-medium wp-image-2217" /&gt;&lt;/a&gt; recovering from this crash is going to be pretty difficult&lt;/figure&gt;&lt;/div&gt;&#10;If you've ever had a server reboot unexpectedly, you've probably seen SQL Server start up, with some databases "stuck" in recovery status, then eventually they come online. Or maybe you thought "this session is stuck in rollback. It'll be quicker if I just reboot the server than wait for it to roll back!" ...only to find out that after restart, the database went into recovery, and you were left waiting impatiently for the database to come online.&#10;&lt;p&gt;In both of these scenarios, the database is going through the &amp;ldquo;crash recovery&amp;rdquo; status.&lt;/p&gt;</description></item><item><title>SQL database stuck in recovery</title><link>https://am2.co/2019/10/12/sql-database-stuck-in-recovery/</link><pubDate>Sat, 12 Oct 2019 00:11:33 -0400</pubDate><guid>https://am2.co/2019/10/12/sql-database-stuck-in-recovery/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/250903/52344"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;I have SQL server 2017. I have one 3 TB size database there. Somehow due to long running transaction the database got stuck 'IN Recovery' mode after SQL server Restarted. When I checked the sql error logs it says 2 189 255 seconds remaining (Phase 2 of 3) completed which is almost 25 days. My goal is to bring the database online even if I lose some data.&lt;/p&gt;</description></item><item><title>Can't overwrite an existing Azure SQL Managed Instance database during restore</title><link>https://am2.co/2018/10/12/cant-overwrite-an-existing-azure-sql-managed-instance-database-during-restore/</link><pubDate>Fri, 12 Oct 2018 01:07:27 -0400</pubDate><guid>https://am2.co/2018/10/12/cant-overwrite-an-existing-azure-sql-managed-instance-database-during-restore/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/219916/52344"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;We're working on migrating some SQL Server VMs to Azure SQL Managed Instances. We did an initial backup/restore without a problem:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sql" data-lang="sql"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;RESTORE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;DATABASE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;xxx&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;URL&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;https://&amp;lt;account-name&amp;gt;.blob.core.windows.net/&amp;lt;container-name&amp;gt;/&amp;lt;filename&amp;gt;.bak&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;After doing testing, we now need to do a fresh restore from our SQL VMs. We started doing the same process we initially did but when restoring, we got an error:&lt;/p&gt;</description></item><item><title>Under what conditions could restore of a huge database get delayed, in SQL server 2016, hosted on VM?</title><link>https://am2.co/2018/10/05/under-what-conditions-could-restore-of-a-huge-database-get-delayed-in-sql-server-2016-hosted-on-vm/</link><pubDate>Fri, 05 Oct 2018 11:14:09 -0400</pubDate><guid>https://am2.co/2018/10/05/under-what-conditions-could-restore-of-a-huge-database-get-delayed-in-sql-server-2016-hosted-on-vm/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/219348/52344"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;I have system where my database gets restored every night, and off late the restore is taking a lot longer from past few days. &lt;/p&gt;&#10;&lt;p&gt;Here is server config:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;ES 2637 XEON @ 3.5 Ghz&lt;/li&gt;&#10;&lt;li&gt;Windows virtual server 2012 R2 hosted in a Hyper V environment&lt;/li&gt;&#10;&lt;li&gt;RAM: 128 GB&lt;/li&gt;&#10;&lt;li&gt;8 CPUs&lt;/li&gt;&#10;&lt;li&gt;Ethernet: 500 Kps Throughput &lt;/li&gt;&#10;&lt;li&gt;Virtual Memory&#10;&lt;ul&gt;&#10;&lt;li&gt;Max Size:132,096 MB&lt;/li&gt;&#10;&lt;li&gt;Available: 39,395 MB&lt;/li&gt;&#10;&lt;li&gt;In Use: 92,701 MB&lt;/li&gt;&#10;&lt;/ul&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Version:&lt;/p&gt;</description></item><item><title>How to take SQL Server databases backup using .bat script file with time stamp</title><link>https://am2.co/2017/04/17/how-to-take-sql-server-databases-backup-using-bat-script-file-with-time-stamp/</link><pubDate>Mon, 17 Apr 2017 13:24:49 -0400</pubDate><guid>https://am2.co/2017/04/17/how-to-take-sql-server-databases-backup-using-bat-script-file-with-time-stamp/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/171196/52344"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;I am using SQL Server Express edition, so there is no features for backup plan, I want to take databases backup using bat script, and create a scheduler to be run everyday. I have created .bat file but need to place a time stamp at the end of backup file like test_13_April_2017.&lt;/p&gt;</description></item><item><title>Transaction log growth during BACKUP</title><link>https://am2.co/2017/04/10/transaction-log-growth-backup/</link><pubDate>Mon, 10 Apr 2017 08:06:37 -0400</pubDate><guid>https://am2.co/2017/04/10/transaction-log-growth-backup/</guid><description>&lt;p&gt;Over on Stack Exchange, &lt;a href="http://dba.stackexchange.com/questions/169174/sql-server-2014-transaction-log-is-growing-very-fast" target="_blank"&gt;someone asked&lt;/a&gt; why their transaction log was growing very fast during a full backup. An interesting tidbit to this question is that the database is in &lt;code&gt;SIMPLE&lt;/code&gt; recovery &amp;ndash; so the log should stay tiny, right?&lt;/p&gt;&#10;&lt;p&gt;Wrong. While taking a full backup of the database, SQL Server is unable to reuse the transaction log for the duration of the backup, &lt;em&gt;even if the database is in &lt;code&gt;SIMPLE&lt;/code&gt; recovery&lt;/em&gt;. If your database is very busy, or backups take a long period of time, this can require a large transaction log, &lt;em&gt;even if the database is in &lt;code&gt;SIMPLE&lt;/code&gt; recovery&lt;/em&gt;.&lt;/p&gt;</description></item><item><title>Why do I have to backup a transaction log twice for it to shrink?</title><link>https://am2.co/2017/04/07/why-do-i-have-to-backup-a-transaction-log-twice-for-it-to-shrink/</link><pubDate>Fri, 07 Apr 2017 06:42:17 -0400</pubDate><guid>https://am2.co/2017/04/07/why-do-i-have-to-backup-a-transaction-log-twice-for-it-to-shrink/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/169408/52344"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;This question was attempted twice on experts-exchange with no real answer.&lt;/p&gt;&#10;&lt;p&gt;I know that I should not shrink the log file - that is not the question.&lt;/p&gt;&#10;&lt;p&gt;If you feel like answering that one should not do it- that has been confirmed many times yes and it is not the goal of this question.&lt;/p&gt;</description></item><item><title>Cannot restore azure database to local due to missing master key</title><link>https://am2.co/2017/01/04/cannot-restore-azure-database-to-local-due-to-missing-master-key/</link><pubDate>Wed, 04 Jan 2017 09:26:09 -0500</pubDate><guid>https://am2.co/2017/01/04/cannot-restore-azure-database-to-local-due-to-missing-master-key/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/160007/52344"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;I create a bacpac from azure and restore to my local on-prem server. However, it throws an error like “Please create a master key in the database or open the master key in the session before performing this operation”. The reason is one of the column in the table is encrypted. I don’t know how to restore the database from azure with master key and certificate etc. Do you know what I could do?&lt;/p&gt;</description></item><item><title>TSQL Tuesday #85: Backup + Recovery + ☁️</title><link>https://am2.co/2016/12/13/tsql-tuesday-85-backup-recovery/</link><pubDate>Tue, 13 Dec 2016 22:11:48 -0500</pubDate><guid>https://am2.co/2016/12/13/tsql-tuesday-85-backup-recovery/</guid><description>&lt;blockquote&gt;&lt;a href="https://sqlstudies.com/2016/12/06/4169/"&gt;&lt;img class="alignright wp-image-532 size-full" src="https://am2.co/wp-content/uploads/TSQL2SDAY-300x300.png" alt="TSQL2SDAY" width="300" height="300" /&gt;&lt;/a&gt;It’s T-SQL Tuesday,  the blog party that SQL Server expert &lt;strong&gt;Adam Machanic&lt;/strong&gt; (&lt;a href="http://dataeducation.com/blog/" target="_blank" rel="noopener"&gt;blog&lt;/a&gt;|t&lt;a href="http://twitter.com/adammachanic" target="_blank" rel="noopener"&gt;witter&lt;/a&gt;) started. This month’s episode is hosted by &lt;strong&gt;Kenneth Fisher&lt;/strong&gt; (&lt;a href="https://sqlstudies.com/" target="_blank" rel="noopener"&gt;blog&lt;/a&gt;| &lt;a href="https://twitter.com/sqlstudent144" target="_blank" rel="noopener"&gt;twitter&lt;/a&gt;). The topic: &lt;strong&gt;&lt;a href="https://sqlstudies.com/2016/12/06/4169/" target="_blank" rel="noopener"&gt;Backup &amp;amp; Recovery&lt;/a&gt;&lt;/strong&gt;&lt;/blockquote&gt;&#10;## Your backups are my bread &amp;amp; butter&#10;Backup &amp;amp; recovery are a DBA's &lt;a href="https://en.wikipedia.org/wiki/Glossary_of_baseball_(B)#bread_and_butter" target="_blank" rel="noopener"&gt;bread &amp;amp; butter&lt;/a&gt;. I always tell people that if you can't restore from backup in an emergency, you should at least make sure your resume is up to date--you'll need it. Part of my approach to making sure I have foolproof backups is making sure my setup is scripted and fool-proof to configure. Traditionally, this has been as simple as some T-SQL scripts that create the &lt;a href="https://ola.hallengren.com/sql-server-backup.html"&gt;backup stored procedure&lt;/a&gt;, and create a few SQL Agent jobs.&#10;&lt;p&gt;The SQL Agent jobs would write to the NAS, use the company standard retention, and everything was set. No muss, no fuss.&lt;/p&gt;</description></item><item><title>UnShrunk SQL Server database restore which is larger than available disk space</title><link>https://am2.co/2016/03/22/unshrunk-sql-server-database-restore-which-is-larger-than-available-disk-space/</link><pubDate>Tue, 22 Mar 2016 19:17:25 -0400</pubDate><guid>https://am2.co/2016/03/22/unshrunk-sql-server-database-restore-which-is-larger-than-available-disk-space/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/133819/52344"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;I cannot restore a Microsoft SQL Server database due to lack of hard drive space. The original database was 1.6TB and approximately &lt;strong&gt;1.4TB&lt;/strong&gt; was deleted from it and a backup was taken without shrinking the database.&lt;/p&gt;&#10;&lt;p&gt;The backup file is only 168GB and was sent to me on a hard drive through a courier. When I try to restore the 168GB backup file it tries to create the original 1.6TB &lt;code&gt;.mdf&lt;/code&gt; data file and errors because all my available servers have less than 1TB of available disk space.&lt;/p&gt;</description></item><item><title>Will Transaction Log backup to Nul break Always On Availability Group configuration?</title><link>https://am2.co/2015/08/31/will-transaction-log-backup-to-nul-break-always-on-availability-group-configuration/</link><pubDate>Mon, 31 Aug 2015 23:08:35 -0400</pubDate><guid>https://am2.co/2015/08/31/will-transaction-log-backup-to-nul-break-always-on-availability-group-configuration/</guid><description>&lt;p&gt;&lt;a href="https://stackoverflow.com/q/32321245/1948808"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;Imagine we have two nodes participating in SQL 2012 AO. This is a test instance. During one of the index rebuild operation the log was grown up really big (250 GB). We are unable to back it up due to space constraint. What if we backup the Tlog to Nul (just to shrink it down) – will that break Always On?&lt;/p&gt;</description></item><item><title>Error 3203 restoring SQL Server backup: The data is invalid</title><link>https://am2.co/2015/04/17/error-3203-restoring-sql-server-backup-the-data-is-invalid/</link><pubDate>Fri, 17 Apr 2015 14:26:17 -0400</pubDate><guid>https://am2.co/2015/04/17/error-3203-restoring-sql-server-backup-the-data-is-invalid/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/98153/52344"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;I am trying to restore a .bak file (backup taken on SQL Server 2008 R2, compatibility level 100). I am restoring the backup on SQL Server 2012 edition. I get the below error. Unfortunately the original DB from where the DB was backed up is no longer available. I am new on this project. I was given the bak file on a thumb drive.&lt;/p&gt;</description></item><item><title>SQL Server 2012 always-on backup, full vs copy-only</title><link>https://am2.co/2014/04/25/sql-server-2012-always-on-backup-full-vs-copy-only/</link><pubDate>Fri, 25 Apr 2014 19:19:45 -0400</pubDate><guid>https://am2.co/2014/04/25/sql-server-2012-always-on-backup-full-vs-copy-only/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/63946/52344"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;I need a quick clarification on copy-only backup vs full backup as it pertains to transaction log numbering and restore if required.&lt;/p&gt;&#10;&lt;p&gt;I have SQL Server 2012 setup with always on for multiple databases. The availability groups are setup with preferred backup on replica.&lt;/p&gt;</description></item></channel></rss>