Product FAQs

Ask a Question

How to check status on Database Shrink Task in SQL Management Studio?

Issue
 
In some cases when database are large (>300GB), users will want to shrink the database (not trim) through SQL Management studio.
 
However, there is no status bar or percentage of completion on the Database Shrink Task. The windows task manager will not show any spikes in CPU.
 
Product Line
Power Monitoring Expert v7.2.x, 8.x
Struxureware Power Monitoring 7.0.x 
ION Enterprise 6.0
 
Environment
SQL Management Studio
 
Cause 
SQL Management Studio does not have the capability of showing percentage of completion for Shrink Task.

Resolution/Workflow
*Warning: Irreparable database damage can occur. This procedure should only be performed by users familiar with SQL Server Management Studio. Databases should be backed up prior to performing this procedure.*
Open up a new query in SQL Management Studio and run the following query:
 
SELECT
       percent_complete,
       start_time,
       status,
       command,
       estimated_completion_time,
       cpu_time,
       total_elapsed_time
FROM
       sys.dm_exec_requests
WHERE
       command = 'DbccFilesCompact'
 
The query will show you the percentage of completion and the status of the current database shrink. You can rerun the query to check statuses overtime. 
Was this helpful?
What can we do to improve the information ?