MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.24k stars 21.41k forks source link

PITR retention period > 1 day and < 7 days? #60362

Closed clement911 closed 4 years ago

clement911 commented 4 years ago

Is it not possible to configure a 3 days PITR retention period?


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

SadiqhAhmed-MSFT commented 4 years ago

@clement911 Thanks for the question. We are looking into this and get back to you shortly.

NavtejSaini-MSFT commented 4 years ago

@clement911 No It is not possible to have PITR period less than 7 days. Azure will keep backups of atleast 7 days. And the reason for the same is explained here - https://docs.microsoft.com/en-us/azure/azure-sql/database/automated-backups-overview?tabs=managed-instance#backup-storage-consumption

image

As explained above and general nature of SQL back ups, a full database back up is required for start of the restore or PITR. The Azure takes full back up every 7 days, hence all differential and Transactional DB backups have to kept to ensure PITR.

If the full DB back up frequency was 3 days or even less, your scenario would have been possible.

NavtejSaini-MSFT commented 4 years ago

@clement911 Do you need any further help regarding this.

clement911 commented 4 years ago

@NavtejSaini-MSFT it is definitely possible to set PITR to 1 day.

See https://docs.microsoft.com/en-us/azure/azure-sql/database/automated-backups-overview?tabs=single-database#change-the-pitr-backup-retention-period-by-using-the-azure-portal

image

https://azure.microsoft.com/en-us/updates/backup-storage-cost-savings-for-azure-sql-database-and-managed-instance/

NavtejSaini-MSFT commented 4 years ago

@clement911 I apologize for the confusion in me understanding the question.This is a difference between changes done through portal and programmatically. Our author @shkale-msft will elaborate more regarding this.

shkale-msft commented 4 years ago

@clement911 You can use PowerShell to set the retention to 3 or a desired value between 1 -35 days for Azure SQL DB (except Hyperscale). Currently, Azure Portal only supports the fixed values shown there. We are working on brining a change to Azure Portal, where we will support a slider, which will let you set the retention to any value between 1-35 (for MI this already works). However, that change is still a few months out. Is it possible for you to use PowerShell till then?

Thanks, shreya

clement911 commented 4 years ago

I see.. Can you point me to the relevant documentation on how to do that? What will it show in the portal if I change to 3 days? It's a shame it takes month, a slider seems like it would be easy enough... We are actually planning on moving to Hyperscale. You said it's not possible for Hyperscale? Do you have more info on that?

shkale-msft commented 4 years ago

Here is how you can do it using PowerShell: https://docs.microsoft.com/en-us/azure/azure-sql/database/automated-backups-overview?tabs=single-database#change-the-pitr-backup-retention-period-by-using-powershell This is how you can do it using REST API: https://docs.microsoft.com/en-us/azure/azure-sql/database/automated-backups-overview?tabs=single-database#change-the-pitr-backup-retention-period-by-using-the-rest-api

For Hyperscale, the default retention period is 7 days and it's fixed. The ability to change it to any value between 1-35 days is not available yet.

clement911 commented 4 years ago

Thank you, I hope this becomes available in the portal with a slider soon.