清理区容器命令Clean extent containers commands

本文介绍 Azure 数据资源管理器中的 .clean databases extentcontainers.show database extentcontainers clean operations 命令。This article describes the .clean databases extentcontainers and .show database extentcontainers clean operations commands in Azure Data Explorer.

.clean databases extentcontainers.clean databases extentcontainers

.clean databases extentcontainers 命令删除数据分片(区)上的维护和后台操作剩余的未使用的存储项目。The .clean databases extentcontainers command deletes unused storage artifacts that are left from the maintenance and background operations on data shards (extents). 该命令在群集的基础存储帐户上以后台方式运行。The command runs in the background on the underlying storage accounts of a cluster. 可以针对群集中数据库的特定列表或所有数据库调用此命令。This command can be called on a specific list of databases or on all the databases in the cluster. 对于每个数据库,都会初始化一个单独操作,使用 .show database extentcontainers clean operations 命令可以监视这些操作。A separate operation is initialized for each database, and these operations can be monitored with the .show database extentcontainers clean operations command.

你必须具有 AllDatabasesAdmin 或特定数据库管理权限才能执行此命令。You must have an AllDatabasesAdmin or specific database admin permission to execute this command. 有关详细信息,请参阅 Kusto 中基于角色的授权For more information, see Role-based Authorization in Kusto.

警告

运行 .clean databases extentcontainers 命令之后,保留策略中定义的可恢复性会重置为该命令启动的时间。Once the .clean databases extentcontainers command is run, the recoverability defined in the retention policy is reset to the time when the command started. 数据库状态无法更改为较早的时间点。You can't change the database state to an earlier point in time. 最好只根据 Azure 顾问的建议来运行此命令。We advise only running this command based on Azure Advisor recommendation.

语法Syntax

.clean databases extentcontainers.clean databases extentcontainers

.clean databases (DatabaseName1,...,DatabaseNameN) extentcontainers .clean databases (DatabaseName1,...,DatabaseNameN) extentcontainers

示例Example

.clean databases extentcontainers

.clean databases (DB1, DB2) extentcontainers

输出Output

输出参数Output parameter 类型Type 说明Description
OperationIdOperationId GuidGuid 操作 ID。The operation ID.
LastUpdatedOnLastUpdatedOn DateTimeDateTime 上次操作更新的日期/时间。The datetime of the last operation's update.
数据库Database 字符串String 已激活操作的数据库的名称。The name of the database on which the operation was activated.
DatabaseMajorVersionDatabaseMajorVersion IntegerInteger 以其为基础来完成清理的数据库的主版本。The major version of the database based on which the cleanup is done.
DatabaseManorVersionDatabaseManorVersion IntegerInteger 以其为基础来完成清理的数据库的次要版本。The minor version of the database based on which the cleanup is done.
数据库Database GuidGuid 已激活操作的数据库的 ID。The ID of the database on which the operation was activated.
状态State StringString 操作的状态。The state of the operation.

.show database extentcontainers clean operations.show database extentcontainers clean operations

此命令在数据库级别监视 .clean databases extentcontainers 操作。This command monitors the .clean databases extentcontainers operations on the database level.

你必须具有 AllDatabasesAdmin、AllDatabasesMonitor 或特定数据库管理或监视权限才能执行此命令。You must have an AllDatabasesAdmin, AllDatabasesMonitor or specific database admin or monitor permission to execute this command. 有关详细信息,请参阅 Kusto 中基于角色的授权For more information, see Role-based Authorization in Kusto.

语法Syntax

.show database DatabaseName1 extentcontainers clean operations.show database DatabaseName1 extentcontainers clean operations

.show database DatabaseName1 extentcontainers clean operations operation_id .show database DatabaseName1 extentcontainers clean operations operation_id

示例Example

.show database DB1 extentcontainers clean operations 

.show database DB1 extentcontainers clean operations 674d33e4-1a61-4bfb-a8d9-1378a90a56db

输出Output

输出参数Output parameter 类型Type 说明Description
OperationIdOperationId GuidGuid 操作 ID。The operation ID.
LastUpdatedOnLastUpdatedOn DateTimeDateTime 上次操作更新的日期/时间。The datetime of the last operation's update.
数据库Database 字符串String 已激活操作的数据库的名称。The name of the database on which the operation was activated.
DatabaseVersionDatabaseVersion 字符串String 以其为基础完成了清理的数据库的版本。The version of the database based on which the cleanup is done.
状态State StringString 操作的状态。The state of the operation.