Mostrar a hierarquia dos processos – pstree

[oracle@oracle ~]$ pstree
init─┬─acpid
├─atd
├─auditd─┬─audispd───{audispd}
│ └─{auditd}
├─automount───4*[{automount}]
├─avahi-daemon───avahi-daemon
├─bonobo-activati───{bonobo-activati}

Investigar os processos cat /proc/

/

[oracle@oracle ~]$ ps -ef |grep pmon
oracle 4040 1 0 16:01 ? 00:00:00 asm_pmon_+ASM
oracle 12688 11666 0 18:43 pts/4 00:00:00 grep pmon

[oracle@oracle ~]$ cat /proc/4040/status

e varios outros.

Memoria livre atualmente em mega bytes – free

[oracle@oracle ~]$ free -m
total used free shared buffers cached
Mem: 4049 3579 470 0 96 2957
-/+ buffers/cache: 525 3524
Swap: 8189 0 8189

Visualizar as bibliotecas utilizadas pelo processo naquele momento – pstack

[oracle@oracle ~]$ ps -ef |grep pmon
oracle 4040 1 0 16:01 ? 00:00:00 asm_pmon_+ASM
oracle 12688 11666 0 18:43 pts/4 00:00:00 grep pmon
[oracle@oracle ~]$ pstack
Usage: pstack
[oracle@oracle ~]$ pstack 4040
#0 0x00e52410 in __kernel_vsyscall ()
#1 0x00c50feb in poll () from /lib/libc.so.6
#2 0x0bb5750c in ntevpque ()
#3 0x0bb554be in ntevque ()
#4 0x0bb34937 in nsevwait ()
#5 0x084b2b3f in ksnwait ()

Finalizar o processo pelo nome pkill

[oracle@oracle ~]$ ps -ef |grep pmon
oracle 4040 1 0 16:01 ? 00:00:00 asm_pmon_+ASM
oracle 9720 1 0 17:47 ? 00:00:00 ora_pmon_orcl
oracle 12588 11666 0 18:41 pts/4 00:00:00 grep pmon

[oracle@oracle ~]$ pkill -9 -f ora_pmon_orcl
[oracle@oracle ~]$ ps -ef |grep pmon
oracle 4040 1 0 16:01 ? 00:00:00 asm_pmon_+ASM
oracle 12688 11666 0 18:43 pts/4 00:00:00 grep pmon

Visualizar a memoria alocada:

[oracle@oracle ~]$ ipcs -m

– Segmentos da memória compartilhada –
chave shmid proprietário perms bytes nattch status
0x351b2710 458762 oracle 640 85983232 13
0xbe3bb918 2719757 oracle 640 1260388352 33

Visualizar os semaforos:

[oracle@oracle ~]$ ipcs -m

– Segmentos da memória compartilhada –
chave shmid proprietário perms bytes nattch status
0x351b2710 458762 oracle 640 85983232 13
0xbe3bb918 2719757 oracle 640 1260388352 33

Criar os dispositivos – rawdevices e loop

MAKEDEV raw
MAKEDEV loop