Azure SQL upgrade/downgrades - azure

I have a few questions regarding upgrades/downgrades of azure sql. The only information I found was that to upgrade/downgrade you have to export a .bacpac and import it on a new upgraded/downgraded server.
Does Microsoft "force" you on to newer versions of azure sql when they are available?
How do you upgrade your current azure sql version?
How do you downgrade your current azure sql version?

There is a SQL server versión property on the Azure SQL Server créate request (reference). The DB created on that server will just inherit that versión.
As for your question:
Probably at some point in time it might, not that it happens often. This happened once (as far as I recall) and I dont remember if they forced you to migrate or not, probably did at some point.
Create new server, Backup\Restore databases
Create new server, Backup\Restore databases
I dont think points 2 and 3 have any real application in the current state of affairs, since Azure SQL is almost locked to v12 (which isnt equivalent to SQL 2012), I can hardly imagine a case where you would want to downgrade (and there's no room to upgrade).

Related

What extra one gets by selecting Azure SQL Managed Instance vis-a-vis Azure SQL DB PaaS

I would like to know what extra benefits one get by choosing Azure SQL Managed Instance compared to Azure SQL DB PaaS. I know SQL Managed Instance is offered as a vCore based purchasing model only. Apart from this what is the extra add on and benefits that one gets over the other. Any reply would be appreciated.
With Azure SQL Managed Instance, you essentially get a full fledged SQL Server that you can control any way you want, just like you would control a locally configured SQL Server. All the power and access and customization you want.
With, Azure SQL DB PaaS, you are essentially getting a database service, so, you give up a lot of control.
For example, take server collation. With the database service, SQL_Latin1_General_CP1_CI_AS , is all you get. With the Managed Instance, its your server. So, go ahead and select whatever collation you want, just like how you would select the collation at the time of creatoin.
Another issue is with auditing, if that is something that is important to your setup. with SQL Managed Instance, auditing happens at server level, because, you are getting the full database server. With the database service, it only database, because, you are only getting a database.
These are just the main details that I found. more details here at this Azure doc - https://learn.microsoft.com/en-us/azure/azure-sql/database/features-comparison
Of course, Managed is going to cost you more because you are paying for the license of the SQL server too.
Lastly, for me, this is the almost (not the exact same thing) like you running your own File Server on a Windows VM on Azure (Managed Instance) versus, just using Blob Storage. In both cases, you are just trying to store some files, but its how much control you have.
I would say think about Azure SQL DB vs Azure SQL Managed Instance (MI) as
Azure SQL DB = Resources dedicated to individual DBs like a container. They are grouped under a Azure SQL Server but that SQL Server is just for grouping.
Azure SQL MI = Almost same as on-prem SQL Server except you don't have to worry about OS, backups, high availability.
Here is a good comparison.
https://learn.microsoft.com/en-us/azure/azure-sql/database/features-comparison
Hopefully this will help
Azure SQL Database - The usual PaaS way. You have vCore, DTU, and Serverless billing mode. And Elastic pool support.
Azure SQL Managed Instance - Similar as below. When you want to use instance-scoped features of Azure SQL Managed Instance like Service Broker, CLR, SQL Server Agent, and Linked servers. As if you have an SQL Server on premise, Azure is responsible for patching, upgrading version etc.
SQL Server on Azure Virtual Machines - Similar as above. But you are responsible for OS and SQL server upgrade.

Azure Create SQL Database: Deployment validation failed

I am trying to create a free SQL Database in Azure under my DreamSpark subscription but I repeatedly receive the following error:
When you start an SQL Database creation, Azure lets you choose or create an SQL Server:
Since I don't currently have an Azure SQL Server I have to create one. I figured my error could be isolated to the server creation and effectively, while trying to create only the server, the error still rises.
I think that, even if Dreamspark subscription allows for a free small SQL Database, it does not allow for a free SQL Server. But this does not make any sense because I think there is no way to have an SQL Database without an SQL Server... So my questions:
Could you please confirm or refute my suspicion about Azure not permitting a free SQL Server in DreamSpark subscription?
In case it is not allowed, is there a way to create an SQL database without an SQL Server in Azure?
In case it is indeed allowed, why do I have this error then?
Thanks in advance.
I ended up circumventing this problem by using visual studio 2017 to create DB and DB Server for me. So we can be sure that DreamSpark subscription allows for a small DB AND a DB Server creation, which makes sense.
Still, don't know why I was getting that weird error though.
While creating the db, visual studio changed the name I provided by concatenating "dbserver" and "_db" to the server and db respectively. Perhaps, there was a naming issue that VS solved automatically, and that Azure is not reporting correctly.

How to upgrade from V11 to V12 SQL Azure?

I am using V11 SQL Azure.
At this stage I do not want to upgrade my existing SQL server which contains all my current QA and Production DBs.
Logically it seems safer to create a new SQL Server setup for V12, then somehow copy/migrate the V11 DB instances from my V11 Sql Server to my new V12 SQL Server ie QA DBs to start with. I am aware of: V12 Upgrade article
Is this possible and how?
The easiest way to do this would be to create a new V12 server and then export the databases and import them into the new server.
There are a few ways to do this, you could either use the portal (https://manage.windowsazure.com) and click the database and click the Export button at the top, this will export the database to Azure Storage. To Import click New, Data Services, Import and select the bacpac file from your storage account and select the new V12 server to import it to.
Your other option is to download SSMS (https://msdn.microsoft.com/en-us/library/mt238290.aspx) and login to both servers. Right click the database you want to export, and go to Tasks -> Export Data-tier Application. The select local storage to download the database locally. To Import, right click the Databases folder on your V12 server and go to Tasks -> Import Data-tier Application.
At this point this is the only straight forward way to go from V11 to V12 without upgrading your server directly.
We are needing to do the same thing for a production deployment of ~150 databases. Our strategy is similar: we have spun up a separate V12 instance for migration after we've assessed each database for the proper tier. However we have opted to upgrade the databases to the new tier within the V11 instance for a few weeks prior to migration to verify they are sized appropriately.
As far as migration, I don't know of any automatic or online way to do it. We've basically had to backup / restore the database via Azure storage using the portal or PowerShell scripts. There is unfortunately downtime for the customer during the time that the database is being copied. Also note that you will need to know prior to the import into the V12 server which new DB tier to use.
In a testing cycle we just did this past week, we migrated ~12 GB (8 databases) from a V11 server to a V12 server. Backing up the databases took around 1 hr 47 minutes, and then restoring the databases took 2 hr 24 minutes. So you get a rough benchmark of about 21 min/GB for the whole process, which is not real great if you have a lot of large databases. Fortunately for us most of our databases are small (<1 GB). If you have lots of larger databases, you may need to upgrade them within the V11 server (which is an online operation), and then upgrade the whole server (which is also online) to avoid downtime.
I would recommend creating a new server and do database copy (create database [copy_db] as copy of [source_db] and then upgrade the server to V12. I/E service takes too long compared to this approach. If you want a consistent state, you can set the source database in the read_only mode

Replication sqlserver database to azure

Scenario: I have a server farm to deploy my web site. I want to try to add one server from Azure platform. Every host has a replication from one database server. I have tried to add the replication database but I got this message error:
Microsoft SQL Server Management Studio is unable to access replication
components because replication is not installed on this instance of
SQL Server. For information about installing replication, see the
topic Installing Replication in SQL Server Books Online. (New
Subscription Wizard)
After this message I suppose that something is missing in the sqlserver database Azure side.
I have googled something to solve my problem but without luck.
I have found one tool (Azure SQL Data Sync) and tried something to solve the problem but it didn't work.
From the Azure documentation, I have found that until V12 of the azure database replication wasn't available.
But what about v12?
Questions:Am I missing something with the version of the database? Should I change the database plan in Azure subscription?
Should I use some external tool that allow me to maintain sync my database server with the replication?
Replication is not yet available according to the MSDN even on V12. You can use https://azure.microsoft.com/en-us/documentation/articles/data-factory-introduction/ and https://azure.microsoft.com/en-us/documentation/articles/sql-database-get-started-sql-data-sync/. You can write your own sync logic with change tracking, Service broker and linked servers / safe CLR but better use the existing tools.
Maybe Azure Data Factory Service could be a solution for you?
https://azure.microsoft.com/en-us/documentation/articles/data-factory-introduction/

Support for SQL Server Compact 4.0 on Azure

My website is a .net 4.5 mvc site built with VS 2012. I have a SQL Server Compact DB in my app_data folder. All works great on my localhost. I deploy to Azure website and get this error?
Unable to find the requested .Net Framework Data Provider. It may not be installed.
I've googled it and get lots of possible answers, but none specific to Azure and SQL server compact. So my question is simple. Does a windows Azure Website which is deployed to an Azure shared hosting server support SQL Server Compact? If so, what do I need to do to eliminate the aforementioned error and make it work?
It certainly is possible to use SQL Server Compact on Windows Azure. However, you need to ask yourself:
Will I change anything in database?
This includes adding, updating and removing data. If you do, you should not use SQL Server Compact on Windows Azure. Because, if you use SQL Server Compact on Windows Azure and change anything in the database, you'll run into two problems:
Data is not replicated.
You risk losing data.
Data is not replicated
If you change anything in the database, the changes stays local. This means that if you have multiple instances running your web application, then each web application will have their own database, and if you change something in one of them, the change won't be replicated to other instances, which will result in unpredictable behaviour in your application.
You risk losing data
If you change anything in the database after deployment, you risk losing data, because Windows Azure might decide to redeploy your instance to another virtual or physical machine. When this happens, the new instance will be setup with the deployment package you originally uploaded to Windows Azure, and this package does not contain any changes you make to the database. And this redeployment can happen at any time for several reasons.
Conclusion
So, SQL Compact on Azure? Sure, no problem if your data is read-only. However, note that you won't get the performance you would with SQL Azure. But if your need changes down the road, you can always migrate your application from SQL Server Compact to SQL Azure.
If you want to use SQL Server Compact with Windows Azure, you can use the "private deployment" method, as explained on "ErikEJ"'s blog.
Edit: Microsoft has announced that they now provide 1 free 20 MB SQL Azure Database for every Azure subscription. This means you can create a subscription and create a free website, with a free SQL Azure Database. (As long as it's less than 20 MB) You can also have multiple Web Sites associated with the same SQL Azure Database for free. So, if you're considering SQL Server Compact on Windows Azure because your database will be very small and you don't want to pay for a 100 MB database, you can consider this option. In most cases, it will be a better solution. Your website will perform better, your database performance will be better and you have the ability to change your data and it will be replicated.
It's possible for SQL Server Compact 4.0 on Azure!!
I write an an article for it
And this is the English version I found
By few step:
Below is the solution after my research:
Step by Step like this:
Install two nuget: EntityFrame.SqlServerCompact & Microsoft SQL Server Compact Edition
put your SQL database file(.sdf/.mdf) in APP_Data folder
(Put the connection string like this in order to use it:
<add name ="DefaultConnection" connectionString ="Data Source=|DataDirectory|CompactDB.sdf" providerName ="System.Data.SqlServerCe.4.0" />)
Publish full project include above SQL database file to AzureWebsites.
you can find it can work well and is totally free.
Second Wenchao Zeng of Microsoft the Azure don't support Sql Compact.
I could use once but this is not recommended because the Windows Azure work with replication of the data (this is the cloud, remember?) and the Sql CE does not support this functionality. If you can to put a Sql CE in Azure sometimes will not get access or users see data outdated or broken because the async.
The best way is you to use the Azure Sql ou BLOB storage.

Resources