Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.databases.ms-sqlserver    |    Notorious Rube Goldberg contraption    |    19,505 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 18,218 of 19,505    |
|    ravi p to All    |
|    Re: Shrink Database problem!!!    |
|    08 Apr 11 06:44:04    |
   
   b52ca190   
   From: zygonr@airtel.blackberry.com   
      
   If the state is in suspended, you need to identify on what is the spid or   
   session waiting on. You can do that by running the dmv   
      
   select * from sys.dm_os_wait_stats   
   order by wait_time_ms desc.   
      
   select * from sys.dm_os_waiting_tasks where session_id ='user session no'   
      
   Once have the information you can compare the session waits with server waits.   
      
   To check how much of shrink of database is complete, you can use the query   
      
   Select percent_complete from sys.dm_exec_requests where session_id= 'your   
   session id'   
      
   The shrinking of database causes fragemtation , you need to update the   
   statistics of the database once the shrink is complete.   
      
   the following command calls sp_updatestats to update all statistics for the   
   database.   
      
    EXEC sp_updatestats   
      
      
   for table or index   
      
   UPDATE STATISTICS table_or_indexed_view_name   
    [   
    {   
    { index_or_statistics__name }   
    | ( { index_or_statistics_name } [ ,...n ] )   
    }   
    ]   
    [ WITH   
    [   
    [ FULLSCAN ]   
    | SAMPLE number { PERCENT | ROWS } ]   
    | RESAMPLE   
    |
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca