What is a retention period of deleted Azure SQL Databases? - azure

I have a question related to Azure SQL Databases.
I know that we can restore databases to any point in time (7 or 35 days) for different tiers in Azure. That is fine.
However, I am wondering how long the deleted Azure SQL databases will be available to restore for.
Does anybody know?
Any answer will be appreciated.

Deleted databases can be restored to the point in time of deletion during the retention period of the service tier they were in. (currently that is Basic: 7 days; Standard and Premium: 35 days 7 days).
For more information:
https://learn.microsoft.com/en-us/azure/sql-database/sql-database-business-continuity
https://learn.microsoft.com/en-us/azure/sql-database/sql-database-recovery-using-backups#deleted-database-restore
https://learn.microsoft.com/en-us/azure/sql-database/sql-database-automated-backups
Also, if you delete the SQL server that was hosting the databases, all the backups are GONE instantly.
Backups will be stored till retention period: Microsoft docs quote below(emphasis mine): and this is covered on Overview of business continuity with Azure SQL Database in Perform a point-in-time restore section
You can use the automated backups to recover a copy of your database to a known good point in time, provided that time is within the database retention period.

Related

Azure Manage Backups menu missing

Im checking several tutorials about how to setup and configure a sql backup to blob, but what Ive found so far are to backup from Sql Server Management Studio.
I did found this nice article at azurelessons: https://azurelessons.com/backup-azure-sql-database/
But the problem I have is that they mention a "Manage Backups" option at the settings group (Sql server level) which I cannot seem to find:
And when I go to the Backups option on Data Management, it only shows me one that is 7 days old with the following legend: "Azure SQL databases are backed up automatically. Backup availability is listed below for each database on this server. Manage your available long-term retention (LTR) backups or restore a database here."
I have a failover group for the SQL server, but I would also like to have backups performed every 6 hours, and I just cant find the option where to do this, even on the SQL Database.
Thanks for the help.
It looks like you have a managed instance of SQL
Both SQL Database and SQL Managed Instance use SQL Server technology to create full backups every week, differential backups every 12-24 hours, and transaction log backups every 5 to 10 minutes. The frequency of transaction log backups is based on the compute size and the amount of database activity.
When you restore a database, the service determines which full, differential, and transaction log backups need to be restored.
Please check this link:
https://learn.microsoft.com/en-us/azure/azure-sql/database/automated-backups-overview?tabs=single-database

Restore Azure SQL Database LTR back-up via the Portal after deleting the original Azure SQL Server

I can't find a straight answer to this question so hoping someone here came across this.
As the LTR backups are tied to the subscription there should be a way to restore a backup even if the original SQL Server that hosted the database is deleted.
How can these be viewed and restored via the Portal after the SQL Server is deleted?
Or via other means.
Currently there isn't a built-in method to restore the entire server. When a server is deleted (soft deleted) then you should call Azure support as soon as possible before a purge process that runs periodically fully removes the logical server. There are no SLAs for server deletions. So the quicker you can get to Azure CSS, the better it is.
If the server is deleted, there is no way to restore from automated built-in backups offered by Azure. Quoting from the page:
If you delete an Azure SQL Database server instance, all its databases
are also deleted and cannot be recovered. There is currently no
support for restoring a deleted server.
So everything is AS-IS. When a user deletes a logical server, you were asking the server to be deleted which is why you typed in the server name, etc. etc. CSS can work with engineering to figure out what is possible at best but there are no service-level guarantees unless Disaster Recovery (Geo-replication, Synchronization, long-term backups, etc.) was part of the deployment strategy.
I witnessed a case where a developer that works for a company in Costa Rica deleted their production Azure SQL logical server on a Thursday and Azure Support was able to recover on the next Monday. Usually Azure CSS gives a time frame of 7 days to recover an Azure SQL logical server that was accidentally deleted.
To avoid this in the future you can use “resource locks” which can protect against accidental deletion using Azure portal.
This question specifically asks about Long Term Retention backups which the other answers (so far) do not address. Yes, when a logical server is deleted, all the automatic backups are also deleted, but NOT the long term retention backups. If a database was configured to use LTR and the LTR backup's retention period has not expired, then yes you can restore from them.
After a logical server is deleted, you can't see the LTR backups from the portal so you must use Powershell commands to list them and issue the restore.
Get-AzSqlDatabaseLongTermRetentionBackup
Restore-AzSqlDatabase
This link gives a good basic tutorial.
https://www.mssqltips.com/sqlservertip/6443/how-to-restore-azure-sql-ltr-backup-after-azure-sql-instance-deleted/
If you delete your Azure sql server, then you could not backup it from the LTR backup.
Alberto Morillo has show you the document:
If you delete an Azure SQL Database server instance, all its databases are also deleted and cannot be recovered. There is currently no support for restoring a deleted server.
I also asked Azure support to get more message about your question. The replied me:
" Azure support can help you recover you Azure SQL server in 7 days after the deletion. You need to provide your server name and region for Azure Support."
You can call Azure Support from portal:
Hope this helps.

Differential backup of azure sql database in to storage account blob storage using Powershell Script

I am having an issue creating differential backups of Azure SQL database in storage account blob storage using powershell. I don't know if it is possible or not to get a differential back up of an Azure SQL database. Please suggest me what can I do.
If have seen the differential backup document, you will find this:
Azure SQL database has the feature Automated backups. It referred that:
SQL Database supports self-service for point-in-time restore (PITR) by automatically creating full backup, differential backups, and transaction log backups. Full database backups are created weekly, differential database backups are generally created every 12 hours, and transaction log backups are generally created every 5 - 10 minutes, with the frequency based on the compute size and amount of database activity. The first full backup is scheduled immediately after a database is created. It usually completes within 30 minutes, but it can take longer when the database is of a significant size. For example, the initial backup can take longer on a restored database or a database copy. After the first full backup, all further backups are scheduled automatically and managed silently in the background. The exact timing of all database backups is determined by the SQL Database service as it balances the overall system workload. You cannot change or disable the backup jobs.
I also asked Azure Support, they told me that we(customer) can not create the differential backup by ourselves, Azure SQL database will do that automatic.
Hope this helps.

Increase Azure SQL Managed Instance backup retention beyond 7 days

Azure SQL Managed Instance provides a default backup retention of 7 days and this cannot be changed as per MS. Access to the Automated backups are not provided as well which is quite surprising. My client requires the backups to be restored for their analysis.
Requirement is to have last 14 days daily back and 1st day of every month backup to be saved.
How can the above requirement is meet? or How do we create automated
backups and auto archiving from our end in MI with TDE on?
Provide the location where these automated backups are stored.
Managed Instance now supports up to 35 days of backup retention (instead of 7) see https://learn.microsoft.com/en-us/azure/sql-database/sql-database-managed-instance-index#new-and-preview-features
MI Supports 7-35 days backups retention depends on pricing tier. MI also supports long-term retention of full backups for up to 10 years in Azure blob storage. You can't get access to Azure automated backups but you can schedule copy_only backups on URL.
For TDE and other information you can check following link:
https://learn.microsoft.com/en-us/azure/sql-database/sql-database-automated-backups
Updated information (May 2020):
Managed Instance now supports 1-35 day PITR backup retention for active databases, and 0-35 days for deleted databases (0 would mean no backup is kept). More info here: https://aka.ms/mi-backup-tuning.
LTR support for Managed Instance is also available with up to 10 years of retention. More info here: https://learn.microsoft.com/en-us/azure/sql-database/sql-database-long-term-retention#managed-instance-support

Is SQL Azure database backed up across datacenters by default?

I want to confirm our understanding of how our Azure SQL databases are being backed up to enable point in time restore. We have not currently configured geo-replication to have the database available in another region. We may in the future as some data analysis is done. But my understanding is that the database is still being backed up to a geo redundant location so I could do a geo-restore if there was an issue with the data center that houses my sql database. Is that correct or do I need to enable geo-replication and pay for a second database in order to have a disaster recover option if the datacenter had an issue.
To clarify further: I think this article states what I'm saying in the Geo-Restore section.
https://azure.microsoft.com/en-us/documentation/articles/sql-database-business-continuity/
Thanks
Yes, all databases have a geo-replicated copy for disaster recovery purposes. For more details, please see the following: https://azure.microsoft.com/en-us/blog/azure-sql-database-geo-restore/
Geo-restore uses the same technology as point in time restore with one
important difference. It restores the database from a copy of the most
recent daily backup in geo-replicated blob storage (RA-GRS). For each
active database, the service maintains a backup chain that includes a
weekly full backup, multiple daily differential backups, and
transaction logs saved every 5 minutes. These blobs are geo-replicated
this guarantees that daily backups are available even after a massive
failure in the primary region.
Yes, Azure SQL Databases are automatically backed up to a different Azure data center using Geo-Replication. This is an automatic features of Azure SQL that is baked into the service offering.
Here's a blog post with further information about Azure SQL Data Replication:
https://azure.microsoft.com/en-us/blog/azure-sql-database-standard-geo-replication/

Resources