{"id":230,"date":"2009-04-23T03:53:01","date_gmt":"2009-04-22T21:53:01","guid":{"rendered":"http:\/\/techsatwork.com\/blog\/?p=230"},"modified":"2016-01-07T11:31:13","modified_gmt":"2016-01-07T05:31:13","slug":"checking-reorg-status","status":"publish","type":"post","link":"https:\/\/techsatwork.com\/?p=230","title":{"rendered":"Checking reorg status"},"content":{"rendered":"<p>Often we schedule our reorgs during off peak hours when nobody is watching . If you are paranoid like me, you would also be wondering whether those reorgs ran and how long they ran, did it run within the maintanence window,\u00c2\u00a0 is it slow and so on.\u00c2\u00a0\u00c2\u00a0 Here is an sql that can check the table reorg status and the amount of time it took for each table.<\/p>\n<p>select rtrim(substr(table_schema,1,10))as &#8220;Schema&#8221;,rtrim(substr(table_name,1,29)) as &#8220;Table_name&#8221;,<br \/>\ncase reorg_status<br \/>\n\u00c2\u00a0 when 1 then &#8216;Started&#8217;<br \/>\n\u00c2\u00a0 when 2 then &#8216;Paused&#8217;<br \/>\n\u00c2\u00a0 when 3 then &#8216;Stopped&#8217;<br \/>\n\u00c2\u00a0 when 4 then &#8216;Completed&#8217;<br \/>\n\u00c2\u00a0 when 5 then &#8216;Truncated&#8217;<br \/>\nend as status,<br \/>\n(minute(reorg_end &#8211; reorg_start)) as &#8220;Minutes_Ran&#8221;<br \/>\nfrom table(sysproc.snapshot_tbreorg(&#8221;,-1))as t where date (reorg_start) &gt; (current_date &#8211; 3 day) order by reorg_start desc;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Often we schedule our reorgs during off peak hours when nobody is watching . If you are paranoid like me, you would also be wondering whether those reorgs ran and how long they ran, did it run within the maintanence window,\u00c2\u00a0 is it slow and so on.\u00c2\u00a0\u00c2\u00a0 Here is an sql that can check the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-container-style":"default","site-container-layout":"default","site-sidebar-layout":"default","site-transparent-header":"default","disable-article-header":"default","disable-site-header":"default","disable-site-footer":"default","disable-content-area-spacing":"default","footnotes":""},"categories":[3],"tags":[131,129,133,134,135,132],"class_list":["post-230","post","type-post","status-publish","format-standard","hentry","category-db2","tag-db2-reorg-duration","tag-db2-reorg-status","tag-db2-snapshot-for-reorg","tag-reorg_end","tag-reorg_start","tag-snapshot_tbreorg"],"_links":{"self":[{"href":"https:\/\/techsatwork.com\/index.php?rest_route=\/wp\/v2\/posts\/230","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techsatwork.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techsatwork.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techsatwork.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techsatwork.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=230"}],"version-history":[{"count":1,"href":"https:\/\/techsatwork.com\/index.php?rest_route=\/wp\/v2\/posts\/230\/revisions"}],"predecessor-version":[{"id":231,"href":"https:\/\/techsatwork.com\/index.php?rest_route=\/wp\/v2\/posts\/230\/revisions\/231"}],"wp:attachment":[{"href":"https:\/\/techsatwork.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techsatwork.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=230"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techsatwork.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}