{"id":103,"date":"2023-03-08T13:04:34","date_gmt":"2023-03-08T16:04:34","guid":{"rendered":"https:\/\/kappasoft.com.br\/wiki\/?p=103"},"modified":"2023-03-08T13:06:22","modified_gmt":"2023-03-08T16:06:22","slug":"mostrar-operacoes-com-longas-duracoes-em-execucao-no-oracle","status":"publish","type":"post","link":"https:\/\/kappasoft.com.br\/wiki\/2023\/03\/08\/mostrar-operacoes-com-longas-duracoes-em-execucao-no-oracle\/","title":{"rendered":"Mostrar opera\u00e7\u00f5es com longas dura\u00e7\u00f5es em execu\u00e7\u00e3o no Oracle"},"content":{"rendered":"\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;sql&quot;,&quot;mime&quot;:&quot;text\/x-plsql&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;PLSQL&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;plsql&quot;}\">COLUMN sid FORMAT 999\nCOLUMN serial# FORMAT 9999999\nCOLUMN machine FORMAT A30\nCOLUMN progress_pct FORMAT 99999999.00\nCOLUMN elapsed FORMAT A10\nCOLUMN remaining FORMAT A10\n\nSELECT S.SID || ',' || S.SERIAL#|| CASE WHEN S.INST_ID IS NOT NULL THEN ',@' || S.INST_ID END  AS &quot;SID\/SERIAL&quot;,       \n       SUBSTR(S.USERNAME,1,10)||DECODE(S.USERNAME,'SYS',SUBSTR(NVL2(S.MODULE,' [',NULL)||UPPER(S.MODULE),1,6)||NVL2(S.MODULE,']',NULL)) AS USERNAME,       \n       S.SQL_ID,       \n       substr(DECODE(TARGET_DESC, NULL, DECODE(TARGET, NULL, OPNAME, CONCAT(OPNAME, CONCAT(' - ', TARGET))), DECODE(TARGET, NULL, CONCAT(OPNAME, CONCAT(' : ',TARGET_DESC)), CONCAT(OPNAME, CONCAT(' : ', CONCAT(TARGET_DESC, CONCAT(' - ',TARGET)))))),1,50) &quot;OPERATION&quot;, TO_CHAR(sl.START_TIME, 'DD\/MM\/YYYY HH24:MI:SS') STARTED,       \n       TO_CHAR(TRUNC(ELAPSED_SECONDS\/3600) , 'FM000') || ':' ||       TO_CHAR(TRUNC(MOD(ELAPSED_SECONDS, 3600)\/60), 'FM00') || ':' ||       TO_CHAR(MOD(MOD(ELAPSED_SECONDS, 3600), 60) , 'FM00') ELAPSED,       \n       TO_CHAR(TRUNC(TIME_REMAINING\/3600) , 'FM000') || ':' ||       TO_CHAR(TRUNC(MOD(TIME_REMAINING, 3600)\/60), 'FM00') || ':' ||       TO_CHAR(MOD(MOD(TIME_REMAINING, 3600), 60) , 'FM00') ESTIMATED,       \n       TO_CHAR(TOTALWORK, 'FM9,999,999,990') TOTAL, \n       TO_CHAR(SOFAR, 'FM9,999,999,990') DONE,       \n       TO_CHAR(SOFAR \/ TOTALWORK * 100, '990.99') &quot;% DONE&quot; ,       \n       TO_CHAR(TIME_REMAINING\/(24*3600)+SYSDATE,'DD\/MM HH24:MI') FINISH_TIME\n  FROM GV$SESSION_LONGOPS SL, GV$SESSION S, GV$PROCESS P\nWHERE SL.SID= S.SID \nAND SL.SERIAL#=S.SERIAL#\nand sl.INST_ID = s.INST_ID\nAND (SL.SOFAR\/SL.TOTALWORK)*100 &lt; 100AND SL.TOTALWORK &gt; 0AND S.PADDR = P.ADDR\nand s.INST_ID = p.INST_ID\norder by S.SQL_ID||SOFAR||S.SID||S.INST_ID desc , ELAPSED;<\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,2],"tags":[],"class_list":["post-103","post","type-post","status-publish","format-standard","hentry","category-banco-de-dados","category-oracle"],"_links":{"self":[{"href":"https:\/\/kappasoft.com.br\/wiki\/wp-json\/wp\/v2\/posts\/103","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kappasoft.com.br\/wiki\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kappasoft.com.br\/wiki\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kappasoft.com.br\/wiki\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kappasoft.com.br\/wiki\/wp-json\/wp\/v2\/comments?post=103"}],"version-history":[{"count":1,"href":"https:\/\/kappasoft.com.br\/wiki\/wp-json\/wp\/v2\/posts\/103\/revisions"}],"predecessor-version":[{"id":104,"href":"https:\/\/kappasoft.com.br\/wiki\/wp-json\/wp\/v2\/posts\/103\/revisions\/104"}],"wp:attachment":[{"href":"https:\/\/kappasoft.com.br\/wiki\/wp-json\/wp\/v2\/media?parent=103"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kappasoft.com.br\/wiki\/wp-json\/wp\/v2\/categories?post=103"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kappasoft.com.br\/wiki\/wp-json\/wp\/v2\/tags?post=103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}