Backup Strategy in SQL Azure - sql

Do we have any standard way of daily backing up SQL Azure databases to onprim?
I know about the option of making backups to Storage, but on a daily basis, if we backup on storage blobs we will end up having many files and it will incur a high cost with Azure.
We need to take backup of SQL Azure Databases directly to onprim disks.
Maintain only two latest backups on the disk.
Do we have mechanism to schedule daily backup to storage blob and maintain only two copies at any moment of time?

Not sure if the new SQL Database Point-in-time feature is good to you. You need to enable this preview feature and select a new edition when creating your database. "Basic" edition support daily backup stores in the past 24 hours while "Standard" and "Premium" editions provides point-in-time backup stores backups in the past 7 days and 35 days.
Alternatively you need to pragmatically backup the database in blob and remove the old ones through worker role, scheduler, webjob.

Related

AzureSQL PaaS Serverless and LTR

All,
We have a Azure SQL PaaS database on serverless edition. Due to limitations inherent in serverless editions, we cannot setup a LTR beyond the daily backups being retained for a period of 5 weeks.
Just wanted to check how others are handling the LTR needs for the same for this edition for Monthly and Yearly backups
Thanks,
rgn
Export your database as bacpac to an Storage Account. We are using weekly exports of the database on Saturdays, with a retention of one year for long-term backups.
The export will trigger a auto-resume of the database if the database was auto-paused.
We use an Azure Automation account and a PowerShell runbook to schedule the export of the database,

How do I change the online status of an Azure SQL Database to offline

I want to change the status of my Azure SQL Database to offline, but cant see a way to do it from the management portal.
Thanks for reading :-)
You can add a firewall setting to deny all the IP addresses, your won't get double billed and your database is intact. The other option is rename but I wouldn't go with it unless needed.
https://msdn.microsoft.com/en-us/library/dn270017.aspx
For those who are looking to pause the Azure SQL Database to save money, now there is also a vCore-based purchase model for SQL databases in Azure.
After choosing vCore-based billing, you need to choose between:
Provisioned: Compute resources are pre-allocated. Billed per hour based on vCores configured​.
or
Serverless: Compute resources are auto-scaled​. Billed per second based on vCores used​.
If you choose "Provisioned" you can enable "auto-pause" where the database automatically pauses if it is inactive for the time period specified (eg. 1 Hour or more), and automatically resumes when database activity recurs.
Source: https://portal.azure.com
Currently, there is no way to take a database "offline" without deleting the database. A few alternatives are deleting the database and then restoring it at a later day (7, 14, 35 days) depending on the edition of the database (basic, standard, premium) respectively or exporting the database to Azure storage and then restoring at a later date.
For purpose of reducing the expenses you can downscale your database to S0 tier, which allows for same 250Gb as S3 and will cost just 15$ per month.
If you have a premium database with size more than 250Gb, than you can export it to a .bacpac and just delete / re-import. But this actually takes a lot of time and is hard to automate.
Denying all IP-s will not prevent billing AFAIK.

SQL Azure Daily Automatic and Keep Unlimited Time

SQL Azure Daily Automatic and Keep Unlimited Time
I am trying to do the azure tutorial: https://msdn.microsoft.com/en-us/library/f6899710-634e-425a-969d-8db1267e9471
But the STORAGE ACCOUNT dont show any option, and I already had a storage account.
Databases are now automatically backed up and you don't need to set this up, this is what I found with playing with it today:
Did you know we already backup your databases? You can restore
databases from automatic backups using the Point-In-Time Restore and
Geo-Restore capabilities. Learn more.
But if you need to maintain your own copies for longer periods of time: In manage.windowsazure.com, navigating to the DB and then "Configure" you will find this option.

Microsoft Azure SQL and Storage backup

I have the following set up:
Azure service
Azure SQL database
Azure Table Storage
Azure Blob Storage
I am trying to develop a backup strategy for this service.
The thing is, that SQL, Tables and BLOBs should be synced. In the backup all three of those have to be of the same version. (backups taken at the same moment). And the main problem is - I can only afford several minutes downtime, not more than that.
What should I do? May be there is existing solution?
Windows Azure Storage supports geo-replication for Blobs, Tables and Queues. Data in the storage account is made durable by replicating transactions across different storage nodes in the same region (LRS) or a secondary region (GRS). GRS is the default redundancy option when creating a storage account. Refer to http://blogs.msdn.com/b/windowsazurestorage/archive/2013/12/11/introducing-read-access-geo-replicated-storage-ra-grs-for-windows-azure-storage.aspx for more details.
If you want to build a custom backup solution then you could use the techniques suggested in the below 2 blogs
1) http://blogs.msdn.com/b/windowsazurestorage/archive/2010/04/30/protecting-your-blobs-against-application-errors.aspx
2) http://blogs.msdn.com/b/windowsazurestorage/archive/2010/05/03/protecting-your-tables-against-application-errors.aspx
I am not sure of the exact use case of why you need to backup azure table and blob. You can backup All the above services without downtime; might be there would be slight glitch or bottleneck performance with SQL database durning back.
The single shot answer is to write a custom script which would read the data from azure table ( or SQL database, or the required service ) make a archive (packaging) and store it back.
The important thing to note here is where would storage backups, broadly speaking generally store the archives in blob. In this case you have thing where you would be storing, if you are storing on-premises you need calculate upon the storage locally, out bandwidth cost and latency of the data transfer from azure.
PS : cloud storage by itself has good leave of availability and durability, you further improve these factors by enabling geo-replication

SQL Azure, frequency of DB copies and backup strategy

Trying to design our DB backup strategy for SQL Azure. In the first instance transactions will be about 200/day.
Scenarios I will be protecting against is:
1) Complete DB lost, failure, corruption which is essentially covered by SQL Azure's saving to 3 point policy ie it has 1 primary and 2 secondary copies.
2) Corruption of records, by buggy code or user error. I would not want to restore a DB for this, and my current thoughts are use a DB copy from a "previous period" (maybe previous night) and do a data compare. Tool in mind is SQL Server Data Tools are used in VS.
My current thoughts are once a day over night take a DB Copy ie
Create Database as copy of liveDB
I think MS talks about a rolling 3 copy procedure, in my case 3 days of backup would be kept then copy 1 would be overwritten by copy 4.
Also do a DB Export as recommended by MS.
Thoughts?
Since the question was "thoughts?" here are some:
Be advised, a DB Export via the Azure managment pages produces a BACPAC which is not transactionally consistent (see http://msdn.microsoft.com/en-us/library/hh335292.aspx).
A DB Copy as you expressed above (Create Database as copy of liveDB) is transactionally consistent, but when it is finished it is billable as it will have the same edition and database size as the source database (see http://msdn.microsoft.com/en-us/library/azure/ff951631.aspx).
As JuneT mentions, using an Automated Export is transactionally consistent, because it first creates a DB Copy, then does a DB Export. Because databases are billed in increments of a day no matter how long the copy is online, if you had a daily backup, you would be paying double the cost of your source database because of the copy coming online before the BACPAC is produced. Once the BACPAC is produced the copy is no longer needed by Automated Export, but you'll still be charged for a prorated day of use. Your retention settings will also impact billing as it relates to storage accounts since you'll be paying for stored BACPACs in terms of their size.
see http://blogs.msdn.com/b/sql-bi-sap-cloud-crm_all_in_one_place/archive/2013/07/24/sql-azure-automated-database-export.aspx and http://msdn.microsoft.com/library/azure/ee621788.aspx
SQL Azure has a built-in feature for restoring from this sort of issue:
see http://msdn.microsoft.com/en-us/library/hh852669.aspx
All Azure SQL Databases are automatically backed up, and the recovery options vary based on the edition of the database. Basic databases allow you to restore the database back to a its state when it was last backed up (once per 24 hours).
Standard and Premium edition databases allow restore to any point in time.