检测 Azure SQL 数据仓库是否有 运行 或排队的操作
Detect if Azure SQL Data Warehouse has running or queued operations
我正在使用 Azure REST API inside a Logic App. Every evening, the logic app checks the DW to see if the status is "Online", and if TRUE it issues a Pause. This is working, but does not take into account whether the DW has any operations active or queued. According to the documentation,暂停 "cancels all running or queued operations"。
我不想丢失或影响任何人的工作,所以我只想在 DW 空闲时暂停。有没有办法检测是否有任何 运行 或排队的操作?
是 - 使用基于'Monitor active queries'示例的查询link。
类似于:
select count(*)
from sys.dm_pdw_exec_requests
where status not in ('Completed','Failed','Cancelled')
and session_id <> session_id()
session_id 子句可确保您不计算自己的查询。
我正在使用 Azure REST API inside a Logic App. Every evening, the logic app checks the DW to see if the status is "Online", and if TRUE it issues a Pause. This is working, but does not take into account whether the DW has any operations active or queued. According to the documentation,暂停 "cancels all running or queued operations"。
我不想丢失或影响任何人的工作,所以我只想在 DW 空闲时暂停。有没有办法检测是否有任何 运行 或排队的操作?
是 - 使用基于'Monitor active queries'示例的查询link。
类似于:
select count(*)
from sys.dm_pdw_exec_requests
where status not in ('Completed','Failed','Cancelled')
and session_id <> session_id()
session_id 子句可确保您不计算自己的查询。