Technical FAQs

Ask a Question

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

Issue: 
 
In some cases when you have a huge database (>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.2, Struxureware Power Monitoring 7.0.1, ION Enterprise 6.0
 
Environment: 
Power Monitoring Expert v7.2.2, Struxureware Power Monitoring 7.0.1, ION Enterprise 6.0
 
Cause: 
SQL Management Studio does not have the capability of showing percentage of completion for Shrink Task.

 
Resolution/Workflow: 

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 ?