{"id":22,"date":"2021-07-21T15:31:16","date_gmt":"2021-07-21T13:31:16","guid":{"rendered":"http:\/\/130.61.57.200\/?p=22"},"modified":"2021-07-21T16:05:41","modified_gmt":"2021-07-21T14:05:41","slug":"check-if-any-long-operation-is-tunning-backup-restore-dbcc-checkdb","status":"publish","type":"post","link":"http:\/\/130.61.57.200\/index.php\/2021\/07\/21\/check-if-any-long-operation-is-tunning-backup-restore-dbcc-checkdb\/","title":{"rendered":"Check if any long operation is running (Backup\/Restore\/DBCC CHECKDB)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">You can check the progress of your Backup\/Restore\/CheckDB with the following statement<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT r.session_id,r.command,r.blocking_session_id,\nCONVERT(NUMERIC(6,2),r.percent_complete) AS &#091;Percent Complete],CONVERT(VARCHAR(20),\nDATEADD(ms,r.estimated_completion_time,GetDate()),20) AS &#091;ETA Completion Time],\nCONVERT(NUMERIC(10,2),r.total_elapsed_time\/1000.0\/60.0) AS &#091;Elapsed Min],\nCONVERT(NUMERIC(10,2),r.estimated_completion_time\/1000.0\/60.0) AS &#091;ETA Min],\nCONVERT(NUMERIC(10,2),r.estimated_completion_time\/1000.0\/60.0\/60.0) AS &#091;ETA Hours],\nCONVERT(VARCHAR(1000),(SELECT SUBSTRING(text,r.statement_start_offset\/2,\nCASE WHEN r.statement_end_offset = -1 THEN 1000 ELSE (r.statement_end_offset-r.statement_start_offset)\/2 END)\nFROM sys.dm_exec_sql_text(sql_handle)))\nFROM sys.dm_exec_requests r \nWHERE command LIKE (&#039;BACKUP%&#039;)OR command LIKE (&#039;RESTORE%&#039;)OR command LIKE (&#039;DBCC%&#039;)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can check the progress of your Backup\/Restore\/CheckDB with the following statement<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[10,13,12],"class_list":["post-22","post","type-post","status-publish","format-standard","hentry","category-mssql","tag-backup","tag-checkdb","tag-restore"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[]}},"_links":{"self":[{"href":"http:\/\/130.61.57.200\/index.php\/wp-json\/wp\/v2\/posts\/22","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/130.61.57.200\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/130.61.57.200\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/130.61.57.200\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/130.61.57.200\/index.php\/wp-json\/wp\/v2\/comments?post=22"}],"version-history":[{"count":2,"href":"http:\/\/130.61.57.200\/index.php\/wp-json\/wp\/v2\/posts\/22\/revisions"}],"predecessor-version":[{"id":37,"href":"http:\/\/130.61.57.200\/index.php\/wp-json\/wp\/v2\/posts\/22\/revisions\/37"}],"wp:attachment":[{"href":"http:\/\/130.61.57.200\/index.php\/wp-json\/wp\/v2\/media?parent=22"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/130.61.57.200\/index.php\/wp-json\/wp\/v2\/categories?post=22"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/130.61.57.200\/index.php\/wp-json\/wp\/v2\/tags?post=22"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}