Thursday, May 1, 2008

FAQ : How can we know the progress of a maintenance command using DMVs

Its very common that, when we run DBCC maintenance command we would like to know how long will it take or how much percentage the process is completed. Here we go…


Select R.Session_id,R.Command,R.Percent_complete
From
sys.dm_exec_requests R
Inner Join
Sys.dm_exec_sessions S
on S.Session_id=R.Session_ID and S.IS_User_Process=1

This process is supported for DBCC CheckDB, DBCC CheckTable, DBCC CheckFilegroup,
DBCC IndexDefrag, DBCC Shrinkfile

2 comments:

DESHPANDE said...

Thanks Madhu for the information here. I believe this is in SQL server 2005. Do we have anything of this kind in 2000??

Thanks,
Manoj Deshpande.

Anonymous said...

True.. this is applicable only in 2005. In 2000 there is no equivalent method

thanks

Madhu

 
Locations of visitors to this page