sys. index_resumable_operations (Transact-sql)sys.index_resumable_operations (Transact-SQL)

适用于: 是SQL Server是Azure SQL 数据库否Azure SQL 数据仓库否并行数据仓库APPLIES TO: yesSQL Server yesAzure SQL Database noAzure SQL Data Warehouse noParallel Data Warehouse

index_resumable_operations是一个系统视图,用于监视和检查当前的执行状态以恢复索引重新生成。sys.index_resumable_operations is a system view that monitors and checks the current execution status for resumable Index rebuild.
适用对象:SQL Server 2017 和 Azure SQL DatabaseApplies to: SQL Server 2017 and Azure SQL Database

列名Column name 数据类型Data type 描述Description
object_idobject_id intint 此索引所属的对象的 ID (不可为 null)。ID of the object to which this index belongs (not nullable).
index_idindex_id intint 索引的 ID (不可为 null)。ID of the index (not nullable). index_id仅在对象中是唯一的。index_id is unique only within the object.
namename sysnamesysname 索引的名称。Name of the index. 名称仅在对象中是唯一的。name is unique only within the object.
sql_textsql_text nvarchar(max)nvarchar(max) DDL T-sql 语句文本DDL T-SQL statement text
last_max_doplast_max_dop smallintsmallint 上次使用的 MAX_DOP (默认值 = 0)Last MAX_DOP used (default = 0)
partition_numberpartition_number intint 所属索引或堆中的分区号。Partition number within the owning index or heap. 对于未分区的表和索引,或者如果正在重新生成所有分区,则此列的值为 NULL。For non-partitioned tables and indexes or in case all partitions are being rebuild the value of this column is NULL.
Statestate tinyinttinyint 可恢复索引的操作状态:Operational state for resumable index:

0 = 正在运行0=Running

1 = 暂停1=Pause
state_descstate_desc nvarchar(60)nvarchar(60) 可恢复索引的操作状态的说明(正在运行或已暂停)Description of the operational state for resumable index (running or Paused)
start_timestart_time datetimedatetime 索引操作开始时间(不可为 null)Index operation start time (not nullable)
last_pause_timelast_pause_time datatimedatatime 索引操作上次暂停时间(可以为 null)。Index operation last pause time (nullable). 如果操作正在运行且从未暂停,则为 NULL。NULL if operation is running and never paused.
total_execution_timetotal_execution_time intint 开始时间的总执行时间(分钟)(不可为 null)Total execution time from start time in minutes (not nullable)
percent_completepercent_complete realreal 索引操作进度完成百分比(不可为 null)。Index operation progress completion in % ( not nullable).
page_countpage_count bigintbigint 索引生成操作为新索引和映射索引(不可为 null)分配的索引页的总数。Total number of index pages allocated by the index build operation for the new and mapping indexes ( not nullable ).


目录视图中仅显示用户拥有的安全对象的元数据,或用户对其拥有某些权限的安全对象的元数据。The visibility of the metadata in catalog views is limited to securables that a user either owns or on which the user has been granted some permission. 有关详细信息,请参阅 Metadata Visibility ConfigurationFor more information, see Metadata Visibility Configuration.


列出处于暂停状态的所有可恢复索引重新生成操作。List all resumable index rebuild operations that are in the PAUSE state.

SELECT * FROM  sys.index_resumable_operations WHERE STATE = 1;  

请参阅See Also