Where to find Azure SQL Database backups? - sql-server

I have created an azure SQL database, single database. I would like to see where my backup files are saved. I know in Data Management > Backups I can see my database and can configure retention policies. My question is where are the backup files? I want to restore them in another Azure SQL datbase, either database server or in a SQL managed instance, or simply keep them in some blob for archiving purpose. This is also my issue with Azure SQL database, database server.
As shown in the image above only databases are there with their policies, but the location of saved backups is unclear to me. Thank you for your valuable input.

I have created an azure SQL database, single database. I would like to see where my backup files are saved.
That is not possible. The backups are stored securely with no direct customer access. You can restore to another Azure SQL Database, or create a logical export to a BACPAC file.

Related

Restoring Azure SQL Server to a previous point without replicas

I am reading some guides to see how to backup/restore a Microsoft Azure SQL Server database.
Searching Microsoft documentation, it seems that:
Azure SQL Database has automated backups, so Azure Data Studio doesn't perform Azure SQL Database backup and restore. For more information, see Learn about automatic SQL Database backups.
After further reading, I see we can indeed restore a DB by creating a replica of it at a previous time point, but this costs ~80 euros if I read it correctly, as it basically creates a second instance of the db. Also, It seems to be able to go back in time only some limited time.
Is there a cost-less (without incurring additional cost to the existing costs) way to create a "permanent" off line copy of the database and restore it to an Azure SQL Database?
The first part of this question is similar to Is there a way to download the azure sql database managed backups - though I am not asking if it's possible, and I do not care about any format of the backup, and do not want to download the Azure backups. I would be happy creating my own backup so I am pretty sure the answer to my question is that is possible even though that answer is probably impossible.
Is there a cost-less (without incurring additional cost to the
existing costs) way to create a "permanent" off line copy of the
database and restore it to an Azure SQL Database?
You would have to install an extension to use DACPAC and BACPAC features in Azure Data studio.
Name: SQL Server Dacpac
Id: microsoft.dacpac
Description: Manage data-tier applications
Version: 1.8.0
Publisher: Microsoft
Here is a simple way to export DB as Bacpac, you can similarly use the [Import Bacpac] Operation to restore.
I am Connected to Microsoft SQL Server, backing up a SQL DB. But you can do this connecting to on-premise SQL server too.
What's the actual objective?
You can restore an Azure SQL to a point in time. Go into the Azure portal and do it in there. (Azure Data Studio may not have a nice way for you to do this)
By offline do you mean an on-premises (non cloud) copy? again what is the objective? Is it disaster recovery? Your on premises copy is more likely to be lost than the Azure one.
You can also point in time restore to another Azure database. If your DB <2Gb then you can just retore to the basic edition which is 4.25 Euro a month. Or you can use the serverless option which is even cheaper
But you have to consider why you are doing this. Azure has a lot of redundancy already built in which makes these kinds of manual offline copies and processes unecessary.

How can i Restore the same Database with different name on RDS Server

How can i Restore the same Database with different name on RDS Server its gives me the error like 'DATABASENAME cannot be restored because there is already an existing database with the same file_guids on the instance.'
It looks like they fixed this on RDS for SQL Server instances:
https://aws.amazon.com/blogs/database/rds-sql-server-has-two-new-exciting-backup-and-restore-enhancements/
I was able to backup a database to S3 and restore it on the same instance today.
As a work around, I ended up with the following process:
Create a .bacpac (contains both data & schema) of the original DB.
Import that .bacpac into a staging database (could be LocalDB, or another instance somewhere, or even the same instance as the original DB).
Create a traditional backup (.bak) of the staging DB.
Upload the backup to S3.
Run the msdb.dbo.rds_restore_database command on the S3 backup file.

Azure Data Factory - Azure SQL Server Destination Schema

I need to copy several hundred tables from an on-premise SQL Server to an Azure SQL Server using ADF. I don't have access to the DB or the network it's on, but I was able to get the on-prem data gateway installed, given an AD account with sufficient DB privileges, and then use the "Copy Data (Preview)" to copy all tables to blob storage.
My problem is that I don't have access to the DB's schema, so I can't easily provision the Azure SQL Server with the necessary tables/columns since there are several hundred tables & performing manually would be extremely time consuming. I found that copying to an Azure Data Warehouse has a "Auto table creation" feature & I am able to copy from on-prem SQL Server directly to Azure DW without defining a schema at the destination, but this isn't supported on Azure SQL Server.
Is there a way to obtain the same script/method that provisions the Azure DW schema & use it for Azure SQL Server? Is there any other way to obtain the source DB's schema via the on-prem data gateway?
given that you were able to run the Copy Data tool to extract data out of on-premises SQL Server, you must have credentials to access the database. Can you run SSMS (SQL Server Management Studio) on the on-prem data gateway and examine/extract the schema?
"Auto table creation" feature is currently only available for Azure Data Warehouse. Supporting this feature when loading into Azure SQL Server is on our backlog but we don't have a committed timeline for this yet.
Shirley Wang
Couldn't you use DMG to run a query against the database to generate the schema for your tables, assuming your AD account has read access to the metadata?
So with your pipeline, instead of it selecting * from each table, have it run a query to exract the schema, some examples here: How can I show the table structure in SQL Server query?
You would then output that to a blob.

Copying SQL Server Transaction Logs from Local Server to Azure

I've Googled this a lot and can't really find anything. The SQL Server for our main system is on-premise, not in the cloud. I figured out how to copy our nightly SQL Server backup to Azure. I also want to copy the Transaction Logs each time they roll so if our server dies we have the transaction logs, can restore to that point and only lose at most five minutes of work, not potentially a full day.
I'm really new to Azure, just starting to learn it. Is there an easy way to copy the logs to Azure? Can it be done within SSMS? Does someone already have a script they'd be willing to share? Thanks for any tips you might have!
Yes, there is SQL Server Backup to Azure Tool
Microsoft SQL Server Backup to Microsoft Azure Tool enables backup to
Azure Blob Storage and encrypts and compresses SQL Server backups
stored locally or in the cloud.
There's also Powershell option:
Use PowerShell to Backup Multiple Databases to Windows Azure Blob Storage Service
This topic provides sample scripts that can be used to automate backups to Windows Azure Blob storage service using PowerShell cmdlets. PowerShell support for Backup and Restore to Windows Azure Blob Storage service is introduced in SQL Server 2012 SP1 CU4.
The parent article gives you TSQL options as well.

Is it possible to restore a SQL Server Standard 2014 backup to Azure SQL?

We currently have a SQL Server Standard 2014 database on one of our servers that is backed up daily to Azure Blob Storage. Those backups are working well and have restored beautifully to the original server in manual tests.
However, to ensure that our backups continue to be valid, I want to put in place some sort of automated restore testing. Due to performance/disk constraints, I'd rather not do this automated testing on our primary database server. But we can't spend the money to buy more SQL Server Standard licenses to set up another server. And we can't use SQL Server Express, because our database is too large (about 20 GB).
Given that our backups are stored in Azure, I thought the best way to test backup restoration would be to restore the backup directly into an Azure SQL database. I could do this roughly once per week, run some quick checks on the restored data, and then automatically delete the database, and pay for less than 1 hour of service/week. This would result in minimal expense. However, I'm not sure it's possible. Google searches for instructions on how to restore a SQL Server backup directly to Azure SQL haven't turned up anything so far. Is it possible for me to restore my SQL Server backups directly to Azure Managed SQL like this?
If it isn't possible, my next thought is that I could just create an SQL Server VM in Azure and activate/deactivate it as needed for my automated restore tests. That'd be a bit more complicated though, so I'm saving that approach for plan B.
Not Directly. You can only directly import a bacpac file into SQL Azure.
What you can do is use SQL Server on an Azure VM to test your backup files.
Pretty sure you can write a script to automatically pull down the latest .bak file and restore it to the SQL Server Instance on the VM.

Resources