如何在Azure Data Explorer中查看已删除的具体化视图具体信息?
查询被删除的具体化视图名称的方法
方法1:解析操作记录的Details字段
MaterializedViewDrop操作的Details字段是JSON格式,包含被删除视图的名称,可通过parse_json函数提取:
.show operations | where Operation == 'MaterializedViewDrop' | extend ViewName = parse_json(Details).MaterializedViewName | project OperationId, StartTime, EndTime, ViewName, Details
方法2:查询集群审计日志
若集群开启了操作审计日志,直接查询审计日志表可获取明确的视图名称:
ClusterAuditLogs | where OperationName == "MaterializedViewDrop" | project EventTime, OperationName, EntityName, InitiatedBy, ClientIP
其中EntityName字段即为被删除的具体化视图名称。
方法3:查看数据库命令历史
如果删除操作通过Kusto客户端执行,可查询数据库的命令历史记录:
.show database <你的数据库名> commands | where Command contains ".drop materialized-view" | project Timestamp, Command, User
从Command字段中可直接读取被删除的视图名称。
内容的提问来源于stack exchange,提问作者Oleksandr Klunnyi
相关产品推荐
相关产品推荐

