sql - Activity Monitor query -


What does the following question do? I found it on the database monitor, relating to restoring the database.

  SELECT command, s.text, start_time, percent_complete, CAST (((DATEDIFF (S, start_time, GetDate ()) / 3600) as varchar) + 'h (hours); the '+ CAST ((DateDiff (s, start_time, GetDate ())% 3600) / as 60 varchar) +' minute, '+ cast (from 60% (DateDiff (s, start_time, GetDate ())) varchar aS) + "seconds" Running_time, CAST ((estimated_completion_time / 3,600,000) as as varchar) + 'h (hours),' + CAST ((as estimated_completion_time% 3,600,000) / 60000 varchar) + 'minutes '+ CAST ((estimated_completion_time% 60000) / aS 1000 varchar) +' 'seconds as est_time_to_go, DATEADD (second, estimated_completion_time / 1000, getdate ()) est_completion_ time as sys.dm_exec_requests the r cross apply sys.dm_exec_sql_text (r.sql_handle) S WHERE r.command IN (Restore database 'backup database' Reload 'log' backup logs')  

This command will give you a status of a backup / restoration process that is currently implemented. If you are not going to run the script, then you have to understand how and when it was played. Maybe it's making a standoff.

This site can help you:


  • Comments