You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when 0 then 'The Always On availability groups is disabled.'
67
+
when 1 then 'The Always On availability groups is enabled.'
68
+
else 'Unknown status.'
69
+
end as'HadrStatus'
70
70
```
71
71
72
72
If AlwaysOn isn't enabled, then you'll need to enable it. You can find official detailed instructions for this process [here](https://docs.microsoft.com/sql/database-engine/availability-groups/windows/enable-and-disable-always-on-availability-groups-sql-server). In the following paragraphs, we'll explain how Always On can be enabled.
@@ -76,7 +76,7 @@ To enable AlwaysOn on a SQL Server, you need to start the **SQL Server Configura
76
76
2. Select on the SQL Server Services.
77
77
3. Right-select on the SQL Server, then go Properties.
78
78
79
-
:::image type="content" source="./media/managed-instance-link-preparation/sql-server-configuration-manager-sql-server-properties.png" alt-text="Screenshot showing SQL Server configuration manager.":::
79
+
:::image type="content" source="./media/managed-instance-link-preparation/sql-server-configuration-manager-sql-server-properties.png" alt-text="Screenshot showing S Q L Server configuration manager.":::
80
80
81
81
4. On SQL Server Configuration Manager properties window, select the AlwaysOn High Availability tab.
82
82
5. Use the Checkbox to enable AlwaysOn Availability Groups.
@@ -97,21 +97,21 @@ For optimal performance of Manage Instance link feature, it's highly recommended
97
97
Detailed official instructions for enabling SQL Server trace flags can be found [here](https://docs.microsoft.com/sql/t-sql/database-console-commands/dbcc-traceon-transact-sql). In the following paragraphs, we'll describe how traceflags can be set.
98
98
Recommended way to enable trace flags, which will persist through the SQL Server restart, is through the SQL Server Configuration Manager.
99
99
To enable the trace flags on a SQL Server, follow the steps:
100
-
- Start SQL Server Configuration Manager.
101
-
- select on the SQL Server Services.
102
-
- Right-select on the SQL Server, then go Properties.
103
-
:::image type="content" source="./media/managed-instance-link-preparation/sql-server-configuration-manager-sql-server-properties.png" alt-text="Screenshot showing SQL Server configuration manager.":::
104
-
- Go to **Startup Parameters** tab.
105
-
- Enter trace flag -T1800 and select Add button.
106
-
- Enter trace flag -T9567 and select Add button.
107
-
- select OK.
100
+
1. Start SQL Server Configuration Manager.
101
+
2. Select SQL Server Services.
102
+
3. Open the SQL Server context menu, then select Properties.
103
+
:::image type="content" source="./media/managed-instance-link-preparation/sql-server-configuration-manager-sql-server-properties.png" alt-text="Screenshot showing S Q L Server configuration manager.":::
### Restart the SQL Server and validate SQL Server configuration.
112
112
113
113
After performing the above configuration steps, restart your SQL Server. To do this, go to SQL Server Configuration Manager, right select on the SQL Server, and then go Restart.
114
-
:::image type="content" source="./media/managed-instance-link-preparation/sql-server-configuration-manager-sql-server-restart.png" alt-text="Screenshot showing SQL Server restart command call.":::
114
+
:::image type="content" source="./media/managed-instance-link-preparation/sql-server-configuration-manager-sql-server-restart.png" alt-text="Screenshot showing S Q L Server restart command call.":::
115
115
116
116
After the restart use these steps to validate that SQL Server configuration has been successfully completed. With the following T-SQL you'll verify that you're running:
117
117
- Supported version of SQL Server
@@ -120,17 +120,17 @@ After the restart use these steps to validate that SQL Server configuration has
120
120
121
121
Execute the following T-SQL query:
122
122
```sql
123
-
-- Shows the version and CU of the SQL Server
124
-
SELECT @@VERSION
125
-
126
-
-- Shows if AlwaysOn feature is enabled on SQL Server
127
-
SELECT SERVERPROPERTY ('IsHadrEnabled')
128
-
129
-
-- Lists all trace flags enabled on the SQL Server
130
-
DBCC TRACESTATUS
123
+
-- Shows the version and CU of the SQL Server
124
+
SELECT @@VERSION
125
+
126
+
-- Shows if AlwaysOn feature is enabled on SQL Server
127
+
SELECT SERVERPROPERTY ('IsHadrEnabled')
128
+
129
+
-- Lists all trace flags enabled on the SQL Server
130
+
DBCC TRACESTATUS
131
131
```
132
132
Below is an example of expected output for SQL Server 2019 with CU15.
133
-
:::image type="content" source="./media/managed-instance-link-preparation/ssms-results-expected-outcome.png" alt-text="Screenshot showing expected outcome in SSMS.":::
133
+
:::image type="content" source="./media/managed-instance-link-preparation/ssms-results-expected-outcome.png" alt-text="Screenshot showing expected outcome in S S M S.":::
134
134
135
135
## Enabling network connectivity between SQL Server and Managed Instance
136
136
@@ -166,9 +166,8 @@ Here are instructions on how to open the following network ports on both environ
166
166
167
167
On SQL Server host machine, ports can be allowed in Windows firewall with following PowerShell script.
168
168
```powershell
169
-
New-NetFirewallRule -DisplayName "Allow TCP port 5022 inbound" -Direction inbound -Profile Any -Action Allow -LocalPort 5022 -Protocol TCP
170
-
171
-
New-NetFirewallRule -DisplayName "Allow TCP port 5022 outbound" -Direction outbound -Profile Any -Action Allow -LocalPort 5022 -Protocol TCP
169
+
New-NetFirewallRule -DisplayName "Allow TCP port 5022 inbound" -Direction inbound -Profile Any -Action Allow -LocalPort 5022 -Protocol TCP
170
+
New-NetFirewallRule -DisplayName "Allow TCP port 5022 outbound" -Direction outbound -Profile Any -Action Allow -LocalPort 5022 -Protocol TCP
172
171
```
173
172
174
173
On Azure portal open Network Security Group for the Subnet of the VNet that is hosting the Managed Instance, and there allow inbound and outbound traffic on port 5022.
@@ -183,7 +182,7 @@ Network connectivity through the port 5022 needs to work from SQL Server to Mana
183
182
To check if SQL Server can reach Managed Instance use `tnc` command in PowerShell from SQL Server host machine. Replace <ManagedInstanceFQDN> with the fully qualified domain name of Azure SQL Managed Instance.
184
183
185
184
```powershell
186
-
tnc <ManagedInstanceFQDN> -port 5022
185
+
tnc <ManagedInstanceFQDN> -port 5022
187
186
```
188
187
189
188
Successful test will show TcpTestSucceeded True.
@@ -200,84 +199,84 @@ To check if Managed Instance can reach SQL Server create a test endpoint and use
200
199
Connect to the Managed Instance and execute following T-SQL to create test endpoint.
201
200
202
201
```sql
203
-
-- Create certificate needed for the test endpoint
204
-
USE MASTER
205
-
CREATE CERTIFICATE TEST_CERT
206
-
WITH SUBJECT = N'Certificate for SQL Server',
207
-
EXPIRY_DATE = N'3/30/2051'
208
-
GO
209
-
210
-
-- Create test endpoint
211
-
USE MASTER
212
-
CREATE ENDPOINT TEST_ENDPOINT
213
-
STATE=STARTED
214
-
AS TCP (LISTENER_PORT=5022, LISTENER_IP = ALL)
215
-
FOR DATABASE_MIRRORING (
216
-
ROLE=ALL,
217
-
AUTHENTICATION = CERTIFICATE TEST_CERT,
218
-
ENCRYPTION = REQUIRED ALGORITHM AES
219
-
)
202
+
-- Create certificate needed for the test endpoint
203
+
USE MASTER
204
+
CREATE CERTIFICATE TEST_CERT
205
+
WITH SUBJECT = N'Certificate for SQL Server',
206
+
EXPIRY_DATE = N'3/30/2051'
207
+
GO
208
+
209
+
-- Create test endpoint
210
+
USE MASTER
211
+
CREATE ENDPOINT TEST_ENDPOINT
212
+
STATE=STARTED
213
+
AS TCP (LISTENER_PORT=5022, LISTENER_IP = ALL)
214
+
FOR DATABASE_MIRRORING (
215
+
ROLE=ALL,
216
+
AUTHENTICATION = CERTIFICATE TEST_CERT,
217
+
ENCRYPTION = REQUIRED ALGORITHM AES
218
+
)
220
219
```
221
220
222
221
Connect to Managed Instance and execute following T-SQL to create new SQL Agent job called “NetHelper”.
223
222
224
223
```sql
225
-
-- SQL_SERVER_ADDRESS should be public IP address, or DNS name that can be resolved from the Managed Instance host machine.
The result from executing the `tnc` (test network connection) will be False if no connection from Managed Instance to the destination IP could made on the port 5022. If the connection is successful, the log will show True, otherwise False.
:::image type="content" source="./media/managed-instance-link-preparation/ssms-output-tnchelper.png" alt-text="Screenshot showing expected output of NetHelper S Q L Agent job.":::
273
272
274
273
Finally, drop the test endpoint and certificate.
275
274
276
275
```sql
277
-
DROP ENDPOINT TEST_ENDPOINT
278
-
GO
279
-
DROP CERTIFICATE TEST_CERT
280
-
GO
276
+
DROP ENDPOINT TEST_ENDPOINT
277
+
GO
278
+
DROP CERTIFICATE TEST_CERT
279
+
GO
281
280
```
282
281
283
282
If the log doesn't show True, here is what you can check:
@@ -296,7 +295,7 @@ With this, we've verified that there is bidirectional network connectivity on th
296
295
SSMS with Managed Instance link wizard is the easiest and the most recommended way to use Managed Instance link. Download SSMS version 18.11.1 (or newer) from this [link](https://docs.microsoft.com/sql/ssms/download-sql-server-management-studio-ssms) and install it on your client machine.
297
296
Once the installation is complete, start SSMS and connect to SQL Server that is prepared for Managed Instance link. In the context menu of a user database, you'll find “Azure SQL Managed Instance link” option.
298
297
299
-
:::image type="content" source="./media/managed-instance-link-preparation/ssms-database-context-menu-managed-instance-link.png" alt-text="Screenshot showing Azure SQL Managed Instance link option in the context menu.":::
298
+
:::image type="content" source="./media/managed-instance-link-preparation/ssms-database-context-menu-managed-instance-link.png" alt-text="Screenshot showing Azure S Q L Managed Instance link option in the context menu.":::
0 commit comments