Click here to Skip to main content
Click here to Skip to main content

Tagged as

Time remaining of Database Shrink

, 19 Apr 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
Time remaining of Database Shrink
I found a stored procedure already in my database (via legacy), and modified it to display remaining seconds and lapsed seconds.
 
SELECT percent_complete, start_time, status, command, estimated_completion_time/1000/60 As 'Minutes to Completion', total_elapsed_time/1000/60 As 'Minutes Elapsed', wait_type, last_wait_type
FROM sys.dm_exec_requests
order by 'Minutes to Completion' desc
 
This is useful when you must perform a shrink or another time consuming task. It does not give much help besides "start_time" and "status" for ad hoc queries though.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

wizardzz
Software Developer (Senior)
United States United States
What I get paid or have been paid to do:
Trading software and protocols (QuickFIX, Onix, etc).
Price feed development.
Data integration.
Trader simulation tools.
Back office, end of day reporting, NFA compliance.
Performance testing, optimization, and analysis.
Large scale data management, analysis, and visualization.
Worked with most major banks, some electronic exchanges, many data providors, and a few counter-parties:
MISO, PJM, NYISO, NEISO, CAISO, AESO, ERCOT, BOE, CME, CBOE, Eurex, ICE, Morgan Stanley, J.P. Morgan, RBS, EBS, Credit Suisse, Nomura, Barclays, Deutsche Bank, Citibank, UBS, Goldman Sachs, Bear Stearns (defunct), Triaina, Bloomberg
Experience in FX, energies, futures.

Comments and Discussions

 
GeneralUseful tip, 5* PinmemberDrABELL24-Apr-11 17:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.141216.1 | Last Updated 19 Apr 2011
Article Copyright 2011 by wizardzz
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid