This commit is contained in:
Bob Ward 2023-04-04 10:58:46 -06:00
Родитель b7381a82e2
Коммит 68817227b3
3 изменённых файлов: 70 добавлений и 6 удалений

33
demos/sqlmidemo/ddl.sql Normal file
Просмотреть файл

@ -0,0 +1,33 @@
USE master;
GO
DROP DATABASE IF EXISTS todo;
GO
CREATE DATABASE todo;
GO
USE todo;
GO
-- Create a todolist table
--
DROP TABLE IF EXISTS todolist;
GO
CREATE TABLE todolist (
list_id int identity primary key clustered,
list_item nvarchar(100),
list_status int DEFAULT (0), -- 0 means started; 1 means complete
list_assigned sysname,
list_date datetime DEFAULT (GETDATE())
);
-- Populate the table with some data to start
--
SET NOCOUNT ON;
GO
DECLARE @x int;
SET @x = 0;
WHILE (@x < 1000)
BEGIN
INSERT INTO todolist (list_item, list_assigned) VALUES ('New todolist item', user_name());
SET @x = @x + 1;
END;
GO
SET NOCOUNT OFF;
GO

Просмотреть файл

@ -0,0 +1,10 @@
## Demo for an online migration from SQL Server 2019 to Azure SQL Managed Instance
This is a demo for an online migration from SQL Server 2019 to Azure SQL Managed Instance using the Managed Instance link feature. Follow all the prerequisites and setup instructions first at <https://github.com/microsoft/bobsql/blob/master/demos/sqlmidemo/readme.md>
## Steps
1. Carefully go through all the steps to prepare your SQL Server 2019 and Azure SQL Managed Instance to use the Managed Instance Link feature: <https://learn.microsoft.com/azure/azure-sql/managed-instance/managed-instance-link-preparation?view=azuresql>
> **Note:** Using the Azure marketplace for SQL Server 2019 automatically applies the latest CU for SQL Server 2019.

Просмотреть файл

@ -54,31 +54,52 @@ Use all defaults
Now select **Review+Create** and then **select Create**.
Wait for the Azure SQL Managed Instance to be created. Since this instance is part of the November 2022 Feature Wave, the deployment can be as fast as 30 minutes.
Wait for the Azure SQL Managed Instance to be created. Since this instance is part of the November 2022 Feature Wave, the deployment can be as fast as 30-45 minutes.
### Deploy a SQL Server 2019 instance with Azure Virtual Machine.
1. Create a new subnet in the virtual network for the deployed Azure SQL Managed Instance per these instructions. https://learn.microsoft.com/azure/azure-sql/managed-instance/connect-vm-instance-configure?view=azuresql. This is the subnet where the SQL Server 2019 Virtual Machine will be placed.
1. Create a new subnet in the virtual network for the deployed Azure SQL Managed Instance per these instructions. <https://learn.microsoft.com/azure/azure-sql/managed-instance/connect-vm-instance-configure?view=azuresql>. This is the subnet where the SQL Server 2019 Virtual Machine will be placed.
1. Now create a new SQL Server 2019 deployment in an Azure Virtual Machine.Use the marketplace to create a SQL Server 2019 Standard Edition on Windows Server 2022.
**Basics**
**Disks/Networking/Management/Monitoring/Advanced**
- Use the resource group from the Azure SQL Managed Instance deployment
- Put in a virtual machine name. I used bwsql2019vm.
- Keep region the same as for the resource group and Azure SQL Managed Instance.
- For Availability Options choose "No infrastructure redundancy required"
- For Security type choose Standard
- For Image choose SQL Server 2019 Standard on Windows Server 2022 - x64 Gen2
- For size to reduce costs I chose Standard_D8s_v3 which provides 8 vCores and 32GB RAM.
- Supply a Window admin and password. You will use this to login to the Windows Virtual Machine.
- For inbound port rules choose the option which matches the security compliance of your organization. Since this is just an example, I use the default of leaving RDP port 3389 allowed. A more secure solution would not to allow 3389 and use Bastion or a virtual network.
- For Licensing you can choose Azure Hybrid Benefit if you have existing Windows licenses.
**Disks**
Use all the defaults
**Networking**
The portal should fill in the name of the virtual network for Azure SQL Managed Instance and the subnet you created earlier. Leave all other values to defaults.
**Management/Monitoring/Advanced**
Use all the defaults
**SQL Server settings**
Use all defaults except for Storage to minimize costs for this example I configured data and log to be shared and only chose 512Gb P20 storage. I chose the option for tempdb to be on the local SSD (D: Drive).
Use all defaults except for Storage to minimize costs for this example I configured data and log to be shared and only chose 512Gb P20 storage. I chose the option for tempdb to be on the local SSD (D: Drive). Leave all other SQL options to their defaults.
Click **Review+Create** and then **Create** to create the virtual machine.
Click **Review+Create** and then **Create** to create the virtual machine. The average deployment time for a SQL Server marketplace image like this can be as fast as 5 minutes.
### Create a new database and table with data in SQL Server 2019
1. Create a new database and table for SQL Server 2019 using the provided script **ddl.sql**.
1. Connect to the SQL Server 2019 instance.
1. Create a new database and table for SQL Server 2019 using the provided script **ddl.sql**.
## Perform an online migration from SQL Server 2019 to Azure SQL Managed Instance
Execute all the steps in the **online_migration\readme.md** file.
## See the compatibility between SQL Server and Azure SQL Managed Instance.