Determines the status of a shrink operation.
shrinkdb_status(database_name, query)
in_progress – determines if a shrink database is in progress on this database. Returns a value of 0 for no, a value of 1 for yes.
au_total – returns the total number of allocation units (that is, groups of 256 pages) the shrink operation affects.
au_current – returns the total number of allocation units processed by the shrink operation.
pages_moved – returns the number of index or data pages moved during the current shrink operation. pages_moved does not include empty pages that were released during the shrink operation.
begin_date – the date and time the current shrink operation began, returned as an unsigned bigint.
time_move – returns the amount of time, in microseconds, spent moving pages. time_move includes the time spent updating page references to the moved pages, but does not include the time spent performing administrative tasks that happen at the end of individual move blocks.
time_repair – returns the amount of time, in microseconds, spent on administrative tasks for moving blocks. time_repair plus the value for time_move indicates the approximate amount of time Adaptive Server spent working on the current shrink operation.
shrinkdb_status("pubs2", "in_progress")
shrinkdb_status("pubs2", "time_move")
shrinkdb_status("pubs2", "time_move")
shrinkdb_status returns 0 if no shrink operations are currently running on the database.