{"id":8916,"date":"2023-01-19T18:25:35","date_gmt":"2023-01-19T21:25:35","guid":{"rendered":"https:\/\/swiv.com.br\/?p=8916"},"modified":"2023-01-19T18:25:35","modified_gmt":"2023-01-19T21:25:35","slug":"how-to-identify-cpu-intensive-processes-on-oracle-linux-and-database","status":"publish","type":"post","link":"https:\/\/swiv.com.br\/index.php\/2023\/01\/19\/how-to-identify-cpu-intensive-processes-on-oracle-linux-and-database\/","title":{"rendered":"How to identify CPU Intensive Processes on Oracle Linux and Database"},"content":{"rendered":"\n<p>Artigo simples de apoio para aquelas ocasi\u00f5es onde identifcamos um alto consumo de CPU em nosso ambiente, e precisamos partir para a pr\u00f3xima fase da investiga\u00e7\u00e3o: poss\u00edveis processos ofensores, tanto no S.O quanto no database.<\/p>\n\n\n\n<p>O modo mais simples e direto \u00e9 utilizar o &#8220;top&#8221;, que por default j\u00e1 ordena a lista de processos por consumo de CPU, conforme exemplo abaixo:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;oracle@oel7 ~]$ top\ntop - 19:08:51 up 10 min,  2 users,  load average: 1.24, 0.95, 0.58\nTasks: 354 total,   7 running, 261 sleeping,   0 stopped,   0 zombie\n%Cpu(s): 66.9 us,  0.7 sy,  0.0 ni, 32.3 id,  0.0 wa,  0.0 hi,  0.2 si,  0.0 st\nKiB Mem : 16150724 total, 10330188 free,  1223556 used,  4596980 buff\/cache\nKiB Swap:  1261564 total,  1261564 free,        0 used. 11574284 avail Mem\n\n  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND\n 7527 root      20   0    7324    100      0 R 100.0  0.0   0:12.13 stress\n 7525 root      20   0    7324    100      0 R  99.7  0.0   0:12.16 stress\n 7528 root      20   0    7324    100      0 R  98.3  0.0   0:11.98 stress\n 7526 root      20   0    7324    100      0 R  98.0  0.0   0:12.10 stress\n 3948 grid      -2   0 1554740  64444  61216 S   1.7  0.4   0:06.41 asm_vktm_+asm\n 4092 oracle    -2   0 2983028  61048  57784 S   1.3  0.4   0:06.21 ora_vktm_cortex\n 7576 oracle    20   0  163736   4688   3768 R   1.0  0.0   0:00.12 top\n 3600 grid      20   0 2143224 132860  89712 S   0.7  0.8   0:07.65 oraagent.bin\n 3074 grid      20   0 2574648 112892  68044 S   0.3  0.7   0:16.99 ohasd.bin\n<\/pre><\/div>\n\n\n<p>Tamb\u00e9m \u00e9 poss\u00edvel identicar uma lista de processos a partir do comando ps abaixo, onde a primeira coluna aponta a % de consumo, a segunda o PID do processo (que nos pode ser insumo para outras an\u00e1lises):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nps -e -o pcpu,pid,user,tty,args | sort -n -k 1 -r | head\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;oracle@oel7 ~]$ ps -e -o pcpu,pid,user,tty,args | sort -n -k 1 -r | head\n 103  9401 root     pts\/0    stress --cpu 4 --timeout 60s\n 103  9399 root     pts\/0    stress --cpu 4 --timeout 60s\n 103  9398 root     pts\/0    stress --cpu 4 --timeout 60s\n 101  9400 root     pts\/0    stress --cpu 4 --timeout 60s\n 2.3  3074 grid     ?        \/grid\/19.3.0\/product\/bin\/ohasd.bin reboot\n 1.2  3600 grid     ?        \/grid\/19.3.0\/product\/bin\/oraagent.bin\n 1.1  4092 oracle   ?        ora_vktm_cortex\n 1.1  3948 grid     ?        asm_vktm_+ASM\n 1.1  3173 gdm      ?        \/usr\/bin\/gnome-shell\n 0.9  2586 root     tty1     \/usr\/bin\/X :0 -background none -noreset -audit 4 -verbose -auth \/run\/gdm\/auth-for-gdm-XDgYhG\/database -seat seat0 -nolisten tcp vt1\n&#x5B;oracle@oel7 ~]$\n<\/pre><\/div>\n\n\n<p>Caso o processo seja proveniente do banco de dados Oracle, atrav\u00e9s do PID e da consulta abaixo \u00e9 poss\u00edvel termos mais detalhes do mesmo. Nota: a query foi retirada da obra &#8220;Linux and Solaris Recipes for Oracle DBAs&#8221;, de Darl Kuln:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSET LINES 200 PAGES 0 HEAD OFF LONG 100000\nCOL dummy_value NOPRINT\nSELECT &#039;dummy_value&#039; dummy_value,\n&#039;USERNAME : &#039; || s.username || CHR(10) ||\n&#039;SCHEMA : &#039; || s.schemaname || CHR(10) ||\n&#039;OSUSER : &#039; || s.osuser || CHR(10) ||\n&#039;MODULE : &#039; || s.program || CHR(10) ||\n&#039;ACTION : &#039; || s.schemaname || CHR(10) ||\n&#039;CLIENT INFO : &#039; || s.osuser || CHR(10) ||\n&#039;PROGRAM : &#039; || s.program || CHR(10) ||\n&#039;SPID : &#039; || p.spid || CHR(10) ||\n&#039;SID : &#039; || s.sid || CHR(10) ||\n&#039;SERIAL# : &#039; || s.serial# || CHR(10) ||\n&#039;KILL STRING : &#039; || &#039;&#039;&#039;&#039; || s.sid || &#039;,&#039; || s.serial# || &#039;&#039;&#039;&#039; || CHR(10) ||\n&#039;MACHINE : &#039; || s.machine || CHR(10) ||\n&#039;TYPE : &#039; || s.type || CHR(10) ||\n&#039;TERMINAL : &#039; || s.terminal || CHR(10) ||\n&#039;CPU : &#039; || q.cpu_time\/1000000 || CHR(10) ||\n&#039;ELAPSED_TIME: &#039; || q.elapsed_time\/1000000 || CHR(10) ||\n&#039;BUFFER_GETS : &#039; || q.buffer_gets || CHR(10) ||\n&#039;SQL_ID : &#039; || q.sql_id || CHR(10) ||\n&#039;CHILD_NUM : &#039; || q.child_number || CHR(10) ||\n&#039;START_TIME : &#039; || TO_CHAR(s.sql_exec_start,&#039;dd-mon-yy hh24:mi&#039;) || CHR(10) ||\n&#039;STATUS : &#039; || s.status || CHR(10) ||\n&#039;SQL_TEXT : &#039; || q.sql_fulltext\nFROM v$session s\nJOIN v$process p ON (s.paddr = p.addr)\nLEFT OUTER JOIN v$sql q ON (s.sql_id = q.sql_id)\nWHERE s.username IS NOT NULL -- eliminates background procs\nAND NVL(q.sql_text,&#039;x&#039;) NOT LIKE &#039;%dummy_value%&#039; -- eliminates this query from output\nAND p.spid = &#039;&amp;amp;PID_FROM_OS&#039;\nORDER BY q.cpu_time;\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;oracle@oel7 admin]$ sqlplus \/ as sysdba\n\nSQL*Plus: Release 19.0.0.0.0 - Production on Tue Jan 17 19:39:59 2023\nVersion 19.3.0.0.0\n\nCopyright (c) 1982, 2019, Oracle.  All rights reserved.\n\n\nConnected to:\nOracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production\nVersion 19.3.0.0.0\n\nSQL&gt; SET LINES 200 PAGES 0 HEAD OFF LONG 100000\nCOL dummy_value NOPRINT\nSELECT &#039;dummy_value&#039; dummy_value,\n&#039;USERNAME : &#039; || s.username || CHR(10) ||\n&#039;SCHEMA : &#039; || s.schemaname || CHR(10) ||\nSQL&gt; &#039;OSUSER : &#039; || s.osuser || CHR(10) ||\n&#039;MODULE : &#039; || s.program || CHR(10) ||\n&#039;ACTION : &#039; || s.schemaname || CHR(10) ||\n&#039;CLIENT INFO : &#039; || s.osuser || CHR(10) ||\nSQL&gt;   2    3    4    5  &#039;PROGRAM : &#039; || s.program || CHR(10) ||\n  6    7    8    9  &#039;SPID : &#039; || p.spid || CHR(10) ||\n&#039;SID : &#039; || s.sid || CHR(10) ||\n 10   11  &#039;SERIAL# : &#039; || s.serial# || CHR(10) ||\n 12  &#039;KILL STRING : &#039; || &#039;&#039;&#039;&#039; || s.sid || &#039;,&#039; || s.serial# || &#039;&#039;&#039;&#039; || CHR(10) ||\n 13  &#039;MACHINE : &#039; || s.machine || CHR(10) ||\n 14  &#039;TYPE : &#039; || s.type || CHR(10) ||\n&#039;TERMINAL : &#039; || s.terminal || CHR(10) ||\n 15   16  &#039;CPU : &#039; || q.cpu_time\/1000000 || CHR(10) ||\n 17  &#039;ELAPSED_TIME: &#039; || q.elapsed_time\/1000000 || CHR(10) ||\n&#039;BUFFER_GETS : &#039; || q.buffer_gets || CHR(10) ||\n 18   19  &#039;SQL_ID : &#039; || q.sql_id || CHR(10) ||\n 20  &#039;CHILD_NUM : &#039; || q.child_number || CHR(10) ||\n&#039;START_TIME : &#039; || TO_CHAR(s.sql_exec_start,&#039;dd-mon-yy hh24:mi&#039;) || CHR(10) ||\n 21   22  &#039;STATUS : &#039; || s.status || CHR(10) ||\n&#039;SQL_TEXT : &#039; || q.sql_fulltext\n 23   24  FROM v$session s\n 25  JOIN v$process p ON (s.paddr = p.addr)\nLEFT OUTER JOIN v$sql q ON (s.sql_id = q.sql_id)\n 26   27  WHERE s.username IS NOT NULL -- eliminates background procs\n 28  AND NVL(q.sql_text,&#039;x&#039;) NOT LIKE &#039;%dummy_value%&#039; -- eliminates this query from output\nAND p.spid = &#039;&amp;amp;PID_FROM_OS&#039;\n 29   30  ORDER BY q.cpu_time;\nEnter value for pid_from_os: 26405\nold  29: AND p.spid = &#039;&amp;amp;PID_FROM_OS&#039;\nnew  29: AND p.spid = &#039;26405&#039;\nUSERNAME : SYSTEM\nSCHEMA : SYSTEM\nOSUSER : SWIV\nMODULE : sqlplus.exe\nACTION : SYSTEM\nCLIENT INFO : SWIV\nPROGRAM : sqlplus.exe\nSPID : 26405\nSID : 93\nSERIAL# : 22672\nKILL STRING : &#039;93,22672&#039;\nMACHINE : WORKGROUP\\xxx\nTYPE : USER\nTERMINAL : xxx\nCPU : .237271\nELAPSED_TIME: .386385\nBUFFER_GETS : 5233\nSQL_ID : 7xr6jha03c1wx\nCHILD_NUM : 0\nSTART_TIME : 17-jan-23 19:38\nSTATUS : INACTIVE\nSQL_TEXT : SELECT * FROM DBA_OBJECTS\n\n\nSQL&gt;\n<\/pre><\/div>\n\n\n<p>A partir daqui podemos avan\u00e7ar na investiga\u00e7\u00e3o dentro do banco de dados, por exemplo validando o plano de execu\u00e7\u00e3o:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSELECT * FROM table(DBMS_XPLAN.DISPLAY_CURSOR(&#039;&amp;amp;sql_id&#039;,&amp;amp;child_num));\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSQL&gt; SELECT * FROM table(DBMS_XPLAN.DISPLAY_CURSOR(&#039;&amp;amp;sql_id&#039;,&amp;amp;child_num));\nEnter value for sql_id: 7xr6jha03c1wx\nEnter value for child_num: 0\nold   1: SELECT * FROM table(DBMS_XPLAN.DISPLAY_CURSOR(&#039;&amp;amp;sql_id&#039;,&amp;amp;child_num))\nnew   1: SELECT * FROM table(DBMS_XPLAN.DISPLAY_CURSOR(&#039;7xr6jha03c1wx&#039;,0))\nSQL_ID  7xr6jha03c1wx, child number 0\n-------------------------------------\nSELECT * FROM DBA_OBJECTS\n\nPlan hash value: 2114560210\n\n------------------------------------------------------------------------------------------------------------\n| Id  | Operation                              | Name              | Rows  | Bytes | Cost (%CPU)| Time     |\n------------------------------------------------------------------------------------------------------------\n|   0 | SELECT STATEMENT                       |                   |       |       |   393 (100)|          |\n|   1 |  VIEW                                  | DBA_OBJECTS       | 66791 |    30M|   393   (3)| 00:00:01 |\n|   2 |   UNION-ALL                            |                   |       |       |            |          |\n|   3 |    TABLE ACCESS BY INDEX ROWID         | SUM$              |     1 |    26 |     0   (0)|          |\n|*  4 |     INDEX UNIQUE SCAN                  | I_SUM$_1          |     1 |       |     0   (0)|          |\n|*  5 |    TABLE ACCESS BY INDEX ROWID BATCHED | USER_EDITIONING$  |     1 |     6 |     2   (0)| 00:00:01 |\n|*  6 |     INDEX RANGE SCAN                   | I_USER_EDITIONING |     2 |       |     1   (0)| 00:00:01 |\n|   7 |     TABLE ACCESS BY INDEX ROWID BATCHED| OBJ$              |     1 |    40 |     3   (0)| 00:00:01 |\n|*  8 |      INDEX RANGE SCAN                  | I_OBJ1            |     1 |       |     2   (0)| 00:00:01 |\n|*  9 |    TABLE ACCESS BY INDEX ROWID         | SUM$              |     1 |    26 |     0   (0)|          |\n|* 10 |     INDEX UNIQUE SCAN                  | I_SUM$_1          |     1 |       |     0   (0)|          |\n|* 11 |    FILTER                              |                   |       |       |            |          |\n|* 12 |     HASH JOIN                          |                   | 72419 |    10M|   332   (1)| 00:00:01 |\n|  13 |      TABLE ACCESS FULL                 | USER$             |   130 |  2340 |     4   (0)| 00:00:01 |\n|* 14 |      HASH JOIN                         |                   | 72419 |  9547K|   328   (1)| 00:00:01 |\n|  15 |       INDEX FULL SCAN                  | I_USER2           |   130 |  3250 |     1   (0)| 00:00:01 |\n|* 16 |       TABLE ACCESS FULL                | OBJ$              | 72419 |  7779K|   327   (1)| 00:00:01 |\n|  17 |     NESTED LOOPS                       |                   |     1 |    32 |     4   (0)| 00:00:01 |\n|  18 |      NESTED LOOPS                      |                   |     1 |    23 |     3   (0)| 00:00:01 |\n|  19 |       TABLE ACCESS BY INDEX ROWID      | IND$              |     1 |    10 |     2   (0)| 00:00:01 |\n|* 20 |        INDEX UNIQUE SCAN               | I_IND1            |     1 |       |     1   (0)| 00:00:01 |\n|* 21 |       TABLE ACCESS CLUSTER             | TAB$              |     1 |    13 |     1   (0)| 00:00:01 |\n|* 22 |      INDEX RANGE SCAN                  | I_OBJ1            |     1 |     9 |     1   (0)| 00:00:01 |\n|* 23 |     TABLE ACCESS CLUSTER               | TAB$              |     1 |    13 |     2   (0)| 00:00:01 |\n|* 24 |      INDEX UNIQUE SCAN                 | I_OBJ#            |     1 |       |     1   (0)| 00:00:01 |\n|* 25 |     TABLE ACCESS BY INDEX ROWID        | SEQ$              |     1 |     8 |     1   (0)| 00:00:01 |\n|* 26 |      INDEX UNIQUE SCAN                 | I_SEQ1            |     1 |       |     0   (0)|          |\n|* 27 |     TABLE ACCESS BY INDEX ROWID BATCHED| USER_EDITIONING$  |     1 |     6 |     2   (0)| 00:00:01 |\n|* 28 |      INDEX RANGE SCAN                  | I_USER_EDITIONING |     2 |       |     1   (0)| 00:00:01 |\n|* 29 |     TABLE ACCESS BY INDEX ROWID BATCHED| USER_EDITIONING$  |     1 |     6 |     2   (0)| 00:00:01 |\n|* 30 |      INDEX RANGE SCAN                  | I_USER_EDITIONING |     2 |       |     1   (0)| 00:00:01 |\n|  31 |     NESTED LOOPS SEMI                  |                   |     1 |    29 |     2   (0)| 00:00:01 |\n|* 32 |      INDEX SKIP SCAN                   | I_USER2           |     1 |    20 |     1   (0)| 00:00:01 |\n|* 33 |      INDEX RANGE SCAN                  | I_OBJ4            |     1 |     9 |     1   (0)| 00:00:01 |\n|  34 |    NESTED LOOPS                        |                   |     1 |    36 |     3   (0)| 00:00:01 |\n|  35 |     TABLE ACCESS FULL                  | LINK$             |     1 |    18 |     2   (0)| 00:00:01 |\n|  36 |     TABLE ACCESS CLUSTER               | USER$             |     1 |    18 |     1   (0)| 00:00:01 |\n|* 37 |      INDEX UNIQUE SCAN                 | I_USER#           |     1 |       |     0   (0)|          |\n------------------------------------------------------------------------------------------------------------\n\nPredicate Information (identified by operation id):\n---------------------------------------------------\n\n   4 - access(&quot;S&quot;.&quot;OBJ#&quot;=:B1)\n   5 - filter(&quot;UE&quot;.&quot;TYPE#&quot;=:B1)\n   6 - access(&quot;UE&quot;.&quot;USER#&quot;=:B1)\n   8 - access(&quot;EO&quot;.&quot;OBJ#&quot;=:B1)\n   9 - filter(BITAND(&quot;S&quot;.&quot;XPFLAGS&quot;,34368126976)=0)\n  10 - access(&quot;S&quot;.&quot;OBJ#&quot;=:B1)\n  11 - filter((((&quot;O&quot;.&quot;TYPE#&quot;&amp;lt;&gt;1 AND &quot;O&quot;.&quot;TYPE#&quot;&amp;lt;&gt;2 AND &quot;O&quot;.&quot;TYPE#&quot;&amp;lt;&gt;6) OR (&quot;O&quot;.&quot;TYPE#&quot;=1 AND  IS\n              NULL) OR (&quot;O&quot;.&quot;TYPE#&quot;=2 AND =1) OR (&quot;O&quot;.&quot;TYPE#&quot;=6 AND =1)) AND (BITAND(&quot;U&quot;.&quot;SPARE1&quot;,16)=0 OR\n              BITAND(&quot;O&quot;.&quot;FLAGS&quot;,1048576)=1048576 OR (&quot;O&quot;.&quot;TYPE#&quot;&amp;lt;&gt;88 AND  IS NULL) OR ( IS NOT NULL AND\n              ((SYS_CONTEXT(&#039;userenv&#039;,&#039;current_edition_name&#039;)=&#039;ORA$BASE&#039; AND &quot;U&quot;.&quot;TYPE#&quot;&amp;lt;&gt;2) OR (&quot;U&quot;.&quot;TYPE#&quot;=2\n              AND &quot;U&quot;.&quot;SPARE2&quot;=TO_NUMBER(SYS_CONTEXT(&#039;userenv&#039;,&#039;current_edition_id&#039;))) OR  IS NOT NULL)))))\n  12 - access(&quot;O&quot;.&quot;SPARE3&quot;=&quot;U&quot;.&quot;USER#&quot;)\n  14 - access(&quot;O&quot;.&quot;OWNER#&quot;=&quot;U&quot;.&quot;USER#&quot;)\n  16 - filter((&quot;O&quot;.&quot;NAME&quot;&amp;lt;&gt;&#039;_NEXT_OBJECT&#039; AND &quot;O&quot;.&quot;NAME&quot;&amp;lt;&gt;&#039;_default_auditing_options_&#039; AND\n              &quot;O&quot;.&quot;TYPE#&quot;&amp;lt;&gt;10 AND &quot;O&quot;.&quot;LINKNAME&quot; IS NULL AND BITAND(&quot;O&quot;.&quot;FLAGS&quot;,128)=0))\n  20 - access(&quot;I&quot;.&quot;OBJ#&quot;=:B1)\n  21 - filter((&quot;I&quot;.&quot;BO#&quot;=&quot;T&quot;.&quot;OBJ#&quot; AND BITAND(&quot;T&quot;.&quot;PROPERTY&quot;,36893488147419103232)=3689348814741910\n              3232))\n  22 - access(&quot;IO&quot;.&quot;OBJ#&quot;=&quot;I&quot;.&quot;BO#&quot; AND &quot;IO&quot;.&quot;TYPE#&quot;=2)\n       filter(&quot;IO&quot;.&quot;TYPE#&quot;=2)\n  23 - filter(BITAND(&quot;T&quot;.&quot;PROPERTY&quot;,36893488147419103232)=0)\n  24 - access(&quot;T&quot;.&quot;OBJ#&quot;=:B1)\n  25 - filter((BITAND(&quot;S&quot;.&quot;FLAGS&quot;,1024)=0 OR &quot;S&quot;.&quot;FLAGS&quot; IS NULL))\n  26 - access(&quot;S&quot;.&quot;OBJ#&quot;=:B1)\n  27 - filter(&quot;TYPE#&quot;=:B1)\n  28 - access(&quot;UE&quot;.&quot;USER#&quot;=:B1)\n  29 - filter(&quot;UE&quot;.&quot;TYPE#&quot;=:B1)\n  30 - access(&quot;UE&quot;.&quot;USER#&quot;=:B1)\n  32 - access(&quot;U2&quot;.&quot;TYPE#&quot;=2 AND &quot;U2&quot;.&quot;SPARE2&quot;=TO_NUMBER(SYS_CONTEXT(&#039;userenv&#039;,&#039;current_edition_id&#039;)\n              ))\n       filter((&quot;U2&quot;.&quot;TYPE#&quot;=2 AND &quot;U2&quot;.&quot;SPARE2&quot;=TO_NUMBER(SYS_CONTEXT(&#039;userenv&#039;,&#039;current_edition_id&#039;\n              ))))\n  33 - access(&quot;O2&quot;.&quot;DATAOBJ#&quot;=:B1 AND &quot;O2&quot;.&quot;TYPE#&quot;=88 AND &quot;O2&quot;.&quot;OWNER#&quot;=&quot;U2&quot;.&quot;USER#&quot;)\n  37 - access(&quot;L&quot;.&quot;OWNER#&quot;=&quot;U&quot;.&quot;USER#&quot;)\n\nNote\n-----\n   - this is an adaptive plan\n\n\n91 rows selected.\n\nSQL&gt;\n<\/pre><\/div>\n\n\n<p>Validando por exemplo os waitings da query:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSELECT sid,\nDECODE(state, &#039;WAITING&#039;,&#039;Waiting&#039;, &#039;Working&#039;) state,\nDECODE(state, &#039;WAITING&#039;, &#039;So far &#039;||seconds_in_wait,\n&#039;Last waited &#039;|| wait_time\/100)|| &#039; seconds for &#039;||event\nFROM v$session\nWHERE sid = &#039;&amp;amp;&amp;amp;session_id&#039;\nAND serial# = &#039;&amp;amp;&amp;amp;serial&#039;;\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSQL&gt; SELECT sid,\nDECODE(state, &#039;WAITING&#039;,&#039;Waiting&#039;, &#039;Working&#039;) state,\nDECODE(state, &#039;WAITING&#039;, &#039;So far &#039;||seconds_in_wait,\n&#039;Last waited &#039;|| wait_time\/100)|| &#039; seconds for &#039;||event\nFROM v$session\nWHERE sid = &#039;&amp;amp;&amp;amp;session_id&#039;\nAND serial# = &#039;&amp;amp;&amp;amp;serial&#039;;  2    3    4    5    6    7\nEnter value for session_id: 93\nold   6: WHERE sid = &#039;&amp;amp;&amp;amp;session_id&#039;\nnew   6: WHERE sid = &#039;93&#039;\nEnter value for serial: 22672\nold   7: AND serial# = &#039;&amp;amp;&amp;amp;serial&#039;\nnew   7: AND serial# = &#039;22672&#039;\n        93 Waiting So far 0 seconds for SQL*Net message from client\n\nSQL&gt;\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>Artigo simples de apoio para aquelas ocasi\u00f5es onde identifcamos um alto consumo de CPU em nosso ambiente, e precisamos partir para a pr\u00f3xima fase da investiga\u00e7\u00e3o: poss\u00edveis processos ofensores, tanto no S.O quanto no database. O modo mais simples e direto \u00e9 utilizar o &#8220;top&#8221;, que por default j\u00e1 ordena a lista de processos por [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,6],"tags":[],"class_list":["post-8916","post","type-post","status-publish","format-standard","hentry","category-administration","category-linux"],"_links":{"self":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/8916","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/comments?post=8916"}],"version-history":[{"count":0,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/8916\/revisions"}],"wp:attachment":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=8916"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=8916"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=8916"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}