ORATOP
Autor: Mario Leonel Martinez Junior | Publicado: 2014-05-29T05:46:00-04:00

&nbsp;  Para quem vem do Windows , administrar um banco de dados Oracle no Linux exige uma verdadeira quebra de paradigmas, muita coisa é diferente.Em geral o ambiente Windows facilita muito algumas atividades, enquanto o Linux não faz questão de facilitar.Depois de um tempo da para ver como o Linux é superior , o simples fato de que o Oracle roda muito melhor no Linux é uma dica de que o Oracle foi feito para essa plataforma.A impressão que tenho é que foram feitas varias “gambis” para o Oracle rodar no Windows.Bem Hoje vou falar sobre uma ferramenta para ajudar na administração do Oracle em ambiente Linux, o top do Oracle, falaremos hoje sobre o oratop: O oratop é uma ferramenta disponível para download no metalink que nos trás varias informações do Banco tudo juntinho, top 5 wait events, transações por minuto, uso de disco, pga etc… Muito interessante mesmo, para começar faça o download no metalink na nota 1500864.1 Segundo a Oracle só esta disponível para a versão 11.2 a 12.1 para plataforma 32 e 64 bits. Com o oatop já no servidor de banco faça o seguinte: Renomeie o arquivo : 1- mv oratop* oratop conceda as permissões para o arquivo: 2- chmod 755 oratop Variáveis de ambiente:Como vamos rodar do servidor de banco espere-se que a maioria das variáveis de ambiente estejam configuradas, ORACLE_HOME, ORACLE_SID etc… Assim pelo menos no meu caso só precisei configurar a variável LD_LIBRARY_PATH  3- export LD_LIBRARY_PATH=$ORACLE_HOME/lib Agora abrimos o oratop: 4- ./oratop -i 10 / as sysdba  &nbsp; Em ambientes RAC , basta executar em um nó apenas.No começo pode ser um pouco confuso mas o help do oratop é muito util.Digite h com o oratop e execução: Interactive Keys: [default]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d : toggle between [Cumulative (C)] &amp; Real-Time (RT) (section 3)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; k : toggle between [EVENT/LATCH] &amp; object FILE#:BLOCK# (proc section 4)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m : Toggle between [USERNAME/PROGRAM] &amp; MODULE/ACTION (proc section 4)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; s : switch to SQL mode (section 4)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f : toggle between [standard] &amp; detailed format (long)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p : switch to [process] mode (section 4)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t : tablespace information&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a : ASM diskgroup information&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x : basic SQL plan table (requires sql_id input)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; i : refresh interval, requires value in seconds [5s]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; q : quit/ exit program (also, { Q | Esc | function keys }) Abbreviations:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [N/B]: count(N)/ Byte(B) - (k)illo, (M)ega, (G)iga, (T)erra, [PEZY]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [T]&nbsp; : Time - (u)micro, (m)illi, (s)econd, (h)our, (d)ay, (y)ear&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [m/s]: stats interval size, (m) 1 minute, (s) 15s, else, Real Time&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [c]&nbsp; : database service centric Acronym Help Menu:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Section 1 - DATABASE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .. [1]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Section 2 - INSTANCE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .. [2]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Section 3 - DB WAIT EVENTS&nbsp; .. [3]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Section 4 - SQL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .. [4]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Quit Help&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .. (q|Q) Enter selection Number: Aqui podemos conferir as legendas e entender o que é o que: ID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [c,N]: inst_id (instance id)%CPU&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [m,N]: host cpu busy %(busy/busy+idle). (red if &gt; 90%)LOAD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [m,N]: current os load. (red if &gt; 2*#cpu &amp; high cpu)%DCU&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [m,N]: db cpu usage as %host cpu. (red if &gt; 99% &amp; high AAS)AAS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [s,N]: Average Active Sessions. (red if &gt; #cpu)ASC&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [c,N]: active Sessions on CPUASI&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [c,N]: active Sessions waiting on user I/OASW&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [c,N]: active Sessions Waiting, non-ASI (red if &gt; ASC+ASI)AST&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [c,N]: Active user Sessions Total (ASC+ASI+ASW)IOPS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [m,N]: i/o requests per second%FR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [s,N]: shared pool free %PGA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [s,N]: total pga allocatedUTPS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [s,N]: user transactions per secUCPS&nbsp;&nbsp;&nbsp; [c,m,N]: user calls per secSSRT&nbsp;&nbsp;&nbsp; [c,m,T]: sql service response time (T/call)%DBT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [s,N]: instance %Database Time (e.g. non-rac shows 100%) É isso ai, na mesma nota do metalink tem um manual muito util tambem.