Skip to content

Commit f826ccd

Browse files
author
Simonx Xu
committed
Merge branch 'main' into simon-1
2 parents f240591 + 82b0892 commit f826ccd

10 files changed

Lines changed: 332 additions & 302 deletions

File tree

azure-sql/managed-instance/connection-types-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ This article explains how clients connect to Azure SQL Managed Instance dependin
2222
Azure SQL Managed Instance's VNet-local endpoint supports the following two connection types:
2323

2424
- **Redirect (recommended):** This is the preferred way for SQL clients to connect to managed instances. With redirect, clients establish connections directly to the node hosting the database. To enable redirect, you need to configure firewalls and Network Security Group (NSG) rules to allow inbound access on ports 1433 and port range 11000-11999. Redirect exhibits superior latency and throughput performance compared to proxy. Redirect also minimizes the impact of planned maintenance events of the gateway component, since redirect connections, once established, have no dependency on the gateway. Redirection capability depends on SQL drivers to understand TDS (Tabular Data Stream) 7.4 or newer. TDS 7.4 was first published with Microsoft SQL Server 2012, so any client newer than that will work.
25-
- **Proxy (default):** This is the legacy connectivity mechanism meant to support SQL drivers that implement TDS versions older than 7.4. In this mode, all connections are proxied through the internal gateway and only the port 1433 is required to be open. Depending on the nature of the workload, proxy mode can severely degrade the latency and lower the throughput compared to redirect. It is also more susceptible to the loss of live connections due to planned maintenance events of the gateway component. For this reason, we highly recommend you configure all your managed instances to use the redirect connection policy unless your SQL clients do not support TDS redirects.
25+
- **Proxy (default):** This is the legacy connectivity mechanism meant to support SQL drivers that implement TDS versions older than 7.4. In this mode, all connections are proxied through the internal gateway and only the port 1433 is required to be open. In proxy method, the gateways process the instruction to locate the primary SQL replica node to forward the connection. Depending on the nature of this workload, gateways can bottleneck connectivity. Proxy mode can severely degrade the latency and lower the throughput compared to redirect as it is more susceptible to the loss of live connections due to planned maintenance events of the gateway component. For this reason, we **highly recommend** you configure all your managed instances to **use the redirect connection policy** unless your SQL clients do not support TDS redirects.
2626

2727
Note that redirect option only has effect on the VNet-local endpoint. Public endpoints and private endpoints to Azure SQL Managed Instance always operate in proxy mode.
2828

4.51 KB
Loading

docs/relational-databases/replication/agents/replication-log-reader-agent.md

Lines changed: 217 additions & 194 deletions
Large diffs are not rendered by default.
Lines changed: 50 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
title: "sys.dm_broker_queue_monitors (Transact-SQL)"
3-
description: sys.dm_broker_queue_monitors (Transact-SQL)
3+
description: sys.dm_broker_queue_monitors returns a row for each queue monitor in the instance.
44
author: rwestMSFT
55
ms.author: randolphwest
6-
ms.date: "02/24/2023"
6+
ms.date: 10/15/2024
77
ms.service: sql
88
ms.subservice: system-objects
99
ms.topic: "reference"
@@ -18,61 +18,57 @@ dev_langs:
1818
- "TSQL"
1919
---
2020
# sys.dm_broker_queue_monitors (Transact-SQL)
21+
2122
[!INCLUDE [SQL Server](../../includes/applies-to-version/sqlserver.md)]
2223

23-
Returns a row for each queue monitor in the instance. A queue monitor manages activation for a queue.
24-
24+
Returns a row for each queue monitor in the instance. A queue monitor manages activation for a queue.
25+
26+
| Column name | Data type | Description |
27+
| --- | --- | --- |
28+
| `database_id` | **int** | Object identifier for the database that contains the queue that the monitor watches. Nullable. |
29+
| `queue_id` | **int** | Object identifier for the queue that the monitor watches. Nullable. |
30+
| `state` | **nvarchar(32)** | State of the monitor. Nullable. This value is one of the following options:<br /><br />`INACTIVE`<br />`NOTIFIED`<br />`RECEIVES_OCCURRING` |
31+
| `last_empty_rowset_time` | **datetime** | Last time that a `RECEIVE` from the queue returned an empty result. Nullable. |
32+
| `last_activated_time` | **datetime** | Last time that this queue monitor activated a stored procedure. Nullable. |
33+
| `tasks_waiting` | **int** | Number of sessions that are currently waiting within a `RECEIVE` statement for this queue. Nullable.<br /><br />**Note:** This number includes any session executing a receive statement, regardless of whether the queue monitor started the session. This is for when you use `WAITFOR` together with `RECEIVE`. In other words, these tasks are waiting for messages to arrive on the queue. |
34+
35+
## Permissions
36+
37+
[!INCLUDE [sssql19-md](../../includes/sssql19-md.md)] and earlier versions require `VIEW SERVER STATE` permission on the server.
38+
39+
[!INCLUDE [sssql22-md](../../includes/sssql22-md.md)] and later versions require `VIEW SERVER PERFORMANCE STATE` permission on the server.
40+
41+
## Examples
42+
43+
### A. Current status queue monitor
2544

26-
|Column name|Data type|Description|
27-
|-----------------|---------------|-----------------|
28-
|**database_id**|**int**|Object identifier for the database that contains the queue that the monitor watches. NULLABLE.|
29-
|**queue_id**|**int**|Object identifier for the queue that the monitor watches. NULLABLE.|
30-
|**state**|**nvarchar(32)**|State of the monitor. NULLABLE. This is one of the following:<br /><br /> **INACTIVE**<br /><br /> **NOTIFIED**<br /><br /> **RECEIVES_OCCURRING**|
31-
|**last_empty_rowset_time**|**datetime**|Last time that a RECEIVE from the queue returned an empty result. NULLABLE.|
32-
|**last_activated_time**|**datetime**|Last time that this queue monitor activated a stored procedure. NULLABLE.|
33-
|**tasks_waiting**|**int**|Number of sessions that are currently waiting within a RECEIVE statement for this queue. NULLABLE.<br /><br /> Note: This number includes any session executing a receive statement, regardless of whether the queue monitor started the session. This is if you use WAITFOR together with RECEIVE. Basically, these tasks are waiting for messages to arrive on the queue.|
34-
35-
## Permissions
36-
Requires VIEW SERVER STATE permission on the server.
37-
38-
### Permissions for SQL Server 2022 and later
45+
This scenario provides the current status of all message queues.
3946

40-
Requires VIEW SERVER PERFORMANCE STATE permission on the server.
47+
```sql
48+
SELECT DB_NAME() AS [Database_Name],
49+
s.[name] AS [Service_Name],
50+
sch.[name] AS [Schema_Name],
51+
q.[name] AS [Queue_Name],
52+
ISNULL(m.[state], N'Not available') AS [Queue_State],
53+
m.tasks_waiting,
54+
m.last_activated_time,
55+
m.last_empty_rowset_time,
56+
(SELECT COUNT(1)
57+
FROM sys.transmission_queue AS t6
58+
WHERE t6.from_service_name = s.[name]) AS Tran_Message_Count
59+
FROM sys.services AS s
60+
INNER JOIN sys.databases AS d
61+
ON d.database_id = DB_ID()
62+
INNER JOIN sys.service_queues AS q
63+
ON s.service_queue_id = q.[object_id]
64+
INNER JOIN sys.schemas AS sch
65+
ON q.[schema_id] = sch.[schema_id]
66+
LEFT OUTER JOIN sys.dm_broker_queue_monitors AS m
67+
ON q.[object_id] = m.queue_id
68+
AND m.database_id = d.database_id;
69+
```
4170

42-
## Examples
43-
44-
### A. Current status queue monitor
45-
This scenario provides the current status of all message queues.
46-
47-
```
48-
SELECT t1.name AS [Service_Name], t3.name AS [Schema_Name], t2.name AS [Queue_Name],
49-
CASE WHEN t4.state IS NULL THEN 'Not available'
50-
ELSE t4.state
51-
END AS [Queue_State],
52-
CASE WHEN t4.tasks_waiting IS NULL THEN '--'
53-
ELSE CONVERT(VARCHAR, t4.tasks_waiting)
54-
END AS tasks_waiting,
55-
CASE WHEN t4.last_activated_time IS NULL THEN '--'
56-
ELSE CONVERT(varchar, t4.last_activated_time)
57-
END AS last_activated_time ,
58-
CASE WHEN t4.last_empty_rowset_time IS NULL THEN '--'
59-
ELSE CONVERT(varchar,t4.last_empty_rowset_time)
60-
END AS last_empty_rowset_time,
61-
(
62-
SELECT COUNT(*)
63-
FROM sys.transmission_queue t6
64-
WHERE (t6.from_service_name = t1.name) ) AS [Tran_Message_Count]
65-
FROM sys.services t1 INNER JOIN sys.service_queues t2
66-
ON ( t1.service_queue_id = t2.object_id )
67-
INNER JOIN sys.schemas t3 ON ( t2.schema_id = t3.schema_id )
68-
LEFT OUTER JOIN sys.dm_broker_queue_monitors t4
69-
ON ( t2.object_id = t4.queue_id AND t4.database_id = DB_ID() )
70-
INNER JOIN sys.databases t5 ON ( t5.database_id = DB_ID() );
71-
```
72-
73-
## See Also
74-
[Dynamic Management Views and Functions &#40;Transact-SQL&#41;](~/relational-databases/system-dynamic-management-views/system-dynamic-management-views.md)
75-
[Service Broker Related Dynamic Management Views &#40;Transact-SQL&#41;](../../relational-databases/system-dynamic-management-views/service-broker-related-dynamic-management-views-transact-sql.md)
76-
77-
71+
## Related content
7872

73+
- [System dynamic management views](system-dynamic-management-views.md)
74+
- [Service Broker Related Dynamic Management Views (Transact-SQL)](service-broker-related-dynamic-management-views-transact-sql.md)

docs/relational-databases/system-dynamic-management-views/sys-dm-pdw-exec-requests-transact-sql.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: sys.dm_pdw_exec_requests holds information about all requests curre
44
author: jacinda-eng
55
ms.author: jacindaeng
66
ms.reviewer: wiassaf, randolphwest
7-
ms.date: 04/23/2024
7+
ms.date: 10/14/2024
88
ms.service: sql
99
ms.subservice: data-warehouse
1010
ms.topic: "reference"
@@ -66,15 +66,15 @@ The negative integer value in the `result_cache_hit` column is a bitmap value of
6666

6767
## Permissions
6868

69-
Requires `VIEW SERVER STATE` permission.
69+
Requires `VIEW DATABASE STATE` permission.
7070

7171
## Security
7272

73-
`sys.dm_pdw_exec_requests` doesn't filter query results according to database-specific permissions. Logins with `VIEW SERVER STATE` permission can obtain results query results for all databases.
73+
`sys.dm_pdw_exec_requests` doesn't filter query results according to database-specific permissions. Logins with `VIEW DATABASE STATE` permission can obtain results query results for all databases.
7474

7575
> [!WARNING]
76-
> An attacker can use `sys.dm_pdw_exec_requests` to retrieve information about specific database objects by simply having `VIEW SERVER STATE` permission and by not having database-specific permission.
76+
> An attacker can use `sys.dm_pdw_exec_requests` to retrieve information about specific database objects by simply having `VIEW DATABASE STATE` permission and by not having database-specific permission.
7777
7878
## Related content
7979

80-
- [Azure Synapse Analytics and Parallel Data Warehouse Dynamic Management Views (Transact-SQL)](../../relational-databases/system-dynamic-management-views/sql-and-parallel-data-warehouse-dynamic-management-views.md)
80+
- [Azure Synapse Analytics and Parallel Data Warehouse Dynamic Management Views (Transact-SQL)](../../relational-databases/system-dynamic-management-views/sql-and-parallel-data-warehouse-dynamic-management-views.md)

docs/relational-databases/system-functions/sys-fn-xe-file-target-read-file-transact-sql.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ In [!INCLUDE [sssql17](../../includes/sssql17-md.md)] and later versions, the fo
117117
```sql
118118
SELECT *
119119
FROM sys.fn_xe_file_target_read_file('system_health*.xel', NULL, NULL, NULL)
120-
WHERE timestamp_utc > DATEADD(DAY, -1, GETUTCDATE());
120+
WHERE CAST(timestamp_utc AS DATETIME2(7)) > DATEADD(DAY, -1, GETUTCDATE());
121121
```
122122

123123
## Related content
Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
22
title: "MSagent_profiles (Transact-SQL)"
3-
description: MSagent_profiles (Transact-SQL)
3+
description: The MSagent_profiles table contains one row for each defined replication agent profile.
44
author: VanMSFT
55
ms.author: vanto
6-
ms.date: "03/06/2017"
6+
ms.reviewer: randolphwest
7+
ms.date: 10/15/2024
78
ms.service: sql
89
ms.subservice: replication
910
ms.topic: "reference"
@@ -16,21 +17,21 @@ dev_langs:
1617
- "TSQL"
1718
---
1819
# MSagent_profiles (Transact-SQL)
20+
1921
[!INCLUDE [SQL Server](../../includes/applies-to-version/sqlserver.md)]
2022

21-
The **MSagent_profiles** table contains one row for each defined replication agent profile. This table is stored in the **msdb** database.
22-
23-
|Column name|Data type|Description|
24-
|-----------------|---------------|-----------------|
25-
|**profile_id**|**int**|The profile ID.|
26-
|**profile_name**|**sysname**|The unique profile name for agent type.|
27-
|**agent_type**|**int**|The type of agent:<br /><br /> **1** = Snapshot Agent<br /><br /> **2** = Log Reader Agent<br /><br /> **3** = Distribution Agent<br /><br /> **4** = Merge Agent<br /><br /> **9** = Queue Reader Agent|
28-
|**type**|**int**|The type of profile:<br /><br /> **0** = System**1** = Custom|
29-
|**description**|**nvarchar(3000)**|The description of the profile.|
30-
|**def_profile**|**bit**|Specifies whether this profile is the default for this agent type.|
31-
32-
## See Also
33-
[Replication Tables &#40;Transact-SQL&#41;](../../relational-databases/system-tables/replication-tables-transact-sql.md)
34-
[Replication Views &#40;Transact-SQL&#41;](../../relational-databases/system-views/replication-views-transact-sql.md)
35-
36-
23+
The `MSagent_profiles` table contains one row for each defined replication agent profile. This table is stored in the `msdb` database on the Distributor.
24+
25+
| Column name | Data type | Description |
26+
| --- | --- | --- |
27+
| `profile_id` | **int** | The profile ID. |
28+
| `profile_name` | **sysname** | The unique profile name for agent type. |
29+
| `agent_type` | **int** | The type of agent:<br /><br />`1` = Snapshot Agent<br />`2` = Log Reader Agent<br />`3` = Distribution Agent<br />`4` = Merge Agent<br />`9` = Queue Reader Agent |
30+
| `type` | **int** | The type of profile:<br /><br />`0` = System<br />`1` = Custom |
31+
| `description` | **nvarchar(3000)** | The description of the profile. |
32+
| `def_profile` | **bit** | Specifies whether this profile is the default for this agent type. |
33+
34+
## Related content
35+
36+
- [Replication Tables (Transact-SQL)](replication-tables-transact-sql.md)
37+
- [Replication Views (Transact-SQL)](../system-views/replication-views-transact-sql.md)

0 commit comments

Comments
 (0)