Lesson Learned #335: BACKUP WITH COPY_ONLY cannot be performed until after the next automatic BACKUP

This post has been republished via RSS; it originally appeared at: Azure Database Support Blog articles.

Today, we worked on a service request that our customer got the following error message: BACKUP WITH COPY_ONLY cannot be performed until after the next automatic BACKUP LOG operation [SQLSTATE 42000] (Error 41937) BACKUP DATABASE is terminating abnormally. [SQLSTATE 42000] (Error 3013), running a manual backup.

 

This error occurs when, for example, our customer changed encryption method or CMK/SMK. Database logs the change in encryption only affects new records so it is by design that there can be older parts of the log which are encrypted with the old encryption key.

 

So, in order to take a COPY_ONLY backup after the change in encryption parts of the log which are encrypted with the old key need to be truncated and one of the conditions for log truncation is that a log backup must be taken. 

 

Retry the operation after 10-15 minutes will be enough to overcome this error message.

 

Enjoy!

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.