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

適用於: 是SQL Server 2017 與更新版本是Azure SQL Database否Azure Synapse Analytics (SQL DW)否平行處理資料倉儲APPLIES TO: YesSQL Server 2017 and later YesAzure SQL Database NoAzure Synapse Analytics (SQL DW) 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 or creation.
適用于: SQL Server (2017和更新版本)和 Azure SQL DatabaseApplies to: SQL Server (2017 and newer), and Azure SQL Database

資料行名稱Column name 資料類型Data type 描述Description
object_idobject_id intint 此索引所屬物件的識別碼(不可為 null)。ID of the object to which this index belongs (not nullable).
index_idindex_id intint 索引的識別碼(不可為 null)。ID of the index (not nullable). index_id只有在物件內才是唯一的。index_id is unique only within the object.
namename sysnamesysname 索引的名稱。Name of the index. name只有在物件內才是唯一的。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.
狀態state 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 即時real % 中的索引作業進度完成(不可為 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 ).

權限Permissions

目錄檢視內中繼資料的可見性會限制在使用者所擁有的安全性實體,或已授與使用者某些權限的安全性實體。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.

範例Example

列出處於暫停狀態的所有可繼續的索引建立或重建作業。List all resumable index creation or rebuild operations that are in the PAUSE state.

SELECT * FROM  sys.index_resumable_operations WHERE STATE = 1;  

另請參閱See Also