Tuesday, January 24, 2023

List Resumable Index SQL SERVER

 --List Current Resumable Index

ALTER INDEX IX_ProdDate_v6 ON T_TDHEADER REBUILD 

WITH (ONLINE = ON, RESUMABLE = ON, MAXDOP=8);


ALTER INDEX IX_ProdDate_v6 ON T_TDHEADER REBUILD 

WITH (ONLINE = ON, RESUMABLE = ON);


SELECT 

name as index_name,

percent_complete, 

state_desc, 

start_time,

last_pause_time, 

total_execution_time AS ExecutionMin,

-- execution time times 

-- ratio of percent to complete and precent completed

total_execution_time * (100.0-percent_complete)/percent_complete  

    AS ApproxExecutionMinLeft 

FROM sys.index_resumable_operations;


ALTER INDEX IX_ProdDate_v6 ON T_TDHEADER PAUSE;


ALTER INDEX IX_ProdDate_v6 ON T_TDHEADER RESUME;


ALTER INDEX IX_ProdDate_v6 ON T_TDHEADER ABORT;


No comments:

Post a Comment