-2

How can a retention period be configured to delete SQL backup blobs older than some custom duration, such as 180 days?

The existing command only permits a max of 30 days:

use msdb;
GO
EXEC smart_admin.sp_set_db_backup 
                @database_name='TestDB' 
                ,@enable_backup=1
                ,@retention_days = 30
                ,@credential_name ='MyCredential'
                ,@encryption_algorithm ='AES_256'
                ,@encryptor_type= 'Certificate'
                ,@encryptor_name='MyBackupCert'
4

It is fully documented :

-- Enable and Configure SQL Server Managed Backup to Windows Azure for a Database

Use msdb;
GO
EXEC smart_admin.sp_set_db_backup 
                @database_name='TestDB' 
                ,@enable_backup=1
                ,@retention_days =30  --->>>>>>>>>> this is your RETENTION e.g. 30 Days
                ,@credential_name ='MyCredential'
                ,@encryption_algorithm ='AES_256'
                ,@encryptor_type= 'Certificate'
                ,@encryptor_name='MyBackupCert'
GO 

EDIT:

The retention period is specified in days and can range from 1 to 30. The retention period determines the recoverability time frame for the database.

  • I am aware of this command, thanks, but 30 is the max permitted by it. What if I want 180 days? – Guessed Mar 30 '16 at 15:00
  • @Guessed 1 through 30 is the max. You cannot have 180 days as retention. – Kin Shah Mar 30 '16 at 15:13
  • What if corporate policy is 730 days retention? How would I restore an 8 month old blob backup if requested? – Guessed Mar 30 '16 at 15:59
  • I assume you have to find a method to transfer the backups to your defined storage or on prem. I am not sure as to how you can increase the retention period - you can open a case with MS and the Azure team is quiet welcoming to address your issue. – Kin Shah Mar 30 '16 at 16:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.