Microsoft Azure SQL Database Trace Replay - sql-server

I'd like to make a direct comparison of a physical server to a serverless Azure SQL environment by using an hour snapshot of all SQL Server activity from some existing infrastructure.
Is it possible to use the SQL Server Profiler to record trace data and replay this on an Azure SQL instance? I am not attempting to tweak or performance tune the existing system, but want to compare how an Azure server at various tiers will perform that workload.
Another option might be to use the SQL Server Distributed Replay functionality if this is an option in Azure.

SQL Server profiler and Distributed Replay are not available.
https://feedback.azure.com/forums/217321-sql-database/suggestions/431943-profiler-for-sql-azure
You may want to try SQL Workload Profiler.
https://cbailiss.wordpress.com/sql-workload-profiler/
SQL Azure Managed Instances will soon have SQL Profiler available:
https://www.youtube.com/watch?v=0uT46lpjeQE&feature=youtu.be&t=1415

your entire question boils down to how can i choose the correct tier in sql azure for my on premises instances..
As alberto points out,there is no way to handle this now directly,for now you can use below workaround
go to http://dtucalculator.azurewebsites.net/ and download powershell script and schedule it for some duration and upload the generated log files to azure website.Once done, you will be provided with chart like below ..
References:
https://www.simple-talk.com/cloud/platform-as-a-service/azure-sql-database-how-to-choose-the-right-service-tier/

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.

On-premise SQL Server to Azure PostgreSQL replication

The client has on-premise SQL Server on his side. We want to replicate his database to our PostgreSQL Azure. The replication we want can have maximum 1min delay. ADF is not the option - copying is too frequent.
What tools can we use? We thought about Azure Sync or SymetricDS. Eventually Would SQL Server -> SQL Server be easier to execute? Any suggestions even beyond Azure are much appreciated.
As #Martin Cairney said on-prem SQL Server -> Azure PostgreSQL doesn't exist in Azure DataSync, so you would need to make use of offical or a 3rd party replication tool. Azure DataSync only support Azure SQL as the Hub Database.
Offical tool, such as Azure data factory. You can set a trigger condition to reduce the frequency of copy activities.
3rd party tool, sunch as skyvia. You said SymmetricDS maybe not support Azure PostgreSQL, according to its official doc.

How do I run script remotely on an Azure database without reliance on network reliability

I am connecting to and running queries on an Azure database (S4) which I connect to through SQL Server Management studio on my Windows 10 laptop. I have a complicated query I am running that gives me an select output after about 5 hours but since the database is so large any network problem causes me to get a transport error and lose any output I would have gotten.
if this happened with an on-premises database I would simply put the query in a SQL Server Agent job. But when connecting to an azure database instance I don't see any sql server agent in the Azure instance for me to add a query to.
I would like to be able to run a long running query remotely on a SQL Server Azure database without being dependent on stable network connection
Put those queries on a stored procedure and then use Azure Automation to schedule the execution of the stored procedure. In this StackOverflow thread I show step-by-step how to schedule execution of a stored procedure on Azure SQL Database using Azure Automation.
Also an Azure VM jump box in the same region as your database is commonly used for stuff like this.

Is it possible to create an SQL Server Azure VM but use your own license?

I have a program that is a .net console app that is intended to track information at a few websites daily and then put this data into an SQL database.
Previously I've had this program running on a scheduler on my computer but I'm about to take off on a 3 month vacation so I'm planning on deploying it on azure to run it while I'm away.
Last night I set up a SQL server VM. I got it all set up then I tracked the pricing and realized that using the SQL Server image increased the price by about 30$ per month compared to the Windows image (http://www.windowsazure.com/en-us/pricing/calculator/?scenario=virtual-machines)
I have an SQL Server license. So I was thinking of just setting up a Windows VM and then installing SQL server on it. THe only problem is that I'm going to have to copy the MSI over and install it etc. - it would take ages.
Is it possible to just create an SQL Server VM in azure and then enter my own license in there to avoid paying the extra 30$ per month?
By the way, is there a more economical way to get Azure to do this then using a VM? Really, it just needs to run daily and performance doesn't matter.
To answer your question directly: you can only utilise your own SQL Server license on an Azure VM if your organisation's agreement with Microsoft includes License Mobility (http://www.windowsazure.com/en-us/pricing/license-mobility/). If your are unsure or believe this is not the case then you cannot deploy your own license. This is exactly the same on Amazon Web Services (AWS).
SQL Databases for Azure Mobile Services that are under 20MB are free - that may be an option depending on your needs. (see point 5 on this page: http://www.windowsazure.com/en-us/pricing/details/mobile-services/).
You can try converting the .NET console application to Worker Role (PAAS) and use Web Edition of SQL Database (PAAS), and recalculate your TCO.
You can start with the SQL Server Trial image, then apply your own license on it (as on any trial installation).
You could also have a free Azure Web Site, with your code triggered as a "web job". For DB, there is a 20MB free tier for Azure SQL Database.
Why don't you just create a SQL Azure DB. They are only $4.95/mo for DB's under 100MB http://www.windowsazure.com/en-us/pricing/details/sql-database/
Saves the entire headache of running your own SQL Server.
Update: SQL Azure now has different pricing
As suggested in the comments, use Azure WebJobs and if possible a free SQL DB if you only have very limited data to track operation.
Under 20Mb free
~$5/mo for up to 2GB
More Details: http://azure.microsoft.com/en-us/pricing/details/sql-database/

How to migrate from Azure SQL to SQL Server? [duplicate]

This question already has answers here:
How do I copy SQL Azure database to my local development server?
(24 answers)
Closed 9 years ago.
Okay this is not about migrating existing sql server database to azure database. Its the other way round.
I want to stop using azure sql database, and moved to full version of SQL Server. How do I migrate existing database in AZURE Sql to a new SQL Server 2008 database?
If you don't want to lose any data, you have to stop using it for the moment of transfer. I can suggest you couple of ways:
First way is to use the SQL Azure Migration Wizard. Yes. Although it is originally designed to migrate your local SQL DB to SQL Azure, it can be used the other way around. I've done in numerous times. Just first point the migration wizard to your SQL Azure instance, then target the local server.
Second way is to use the Azure SQL Database backup. Create a bacpac archive either using the portal or via SSMS. Then import this BacPac package into your local SQL Server instance.
If you don't want downtime and want full data synchronization I will suggest doing the following:
Move schema and data initially using any of the above methods (for live systems I highly recommend to first a new database AS COPY and then create the BacPac from it, or use the Migration wizard to transfer it).
Enable the SQL Data Sync to begin synchronizing local data with on-going live data.
Wait while local is fully in sync.
Switch the connection strings in your app.
Cut down SQL Azure.
There are a lot of third party tools that will allow you to synchronize your SQL Azure database with full SQL Server database. Just use any of these to synchronize structures and then data.
You can try tools from Red Gate, ApexSQL, Idera or any other… Even though these tools are not really cheap you can still use them in trial mode (its fully functional in most cases) to get the job done.

Resources