《Oracle DBA的UNIX 袖珍参考手册》笔记9

这一章节超级简单,unix下的基本命令,搞熟了就行~
1.显示Oracle 的Unix 进程
'2.70'*orcl-/home/oracle>ps -ef|grep ora_|grep -v grep
oracle    6642     1  0 05:50 ?        00:00:00 ora_pmon_orcl
oracle    6644     1  0 05:50 ?        00:00:00 ora_psp0_orcl
oracle    6646     1  0 05:50 ?        00:00:00 ora_mman_orcl
oracle    6648     1  0 05:50 ?        00:00:00 ora_dbw0_orcl
oracle    6650     1  0 05:50 ?        00:00:00 ora_lgwr_orcl
oracle    6652     1  0 05:50 ?        00:00:00 ora_ckpt_orcl
oracle    6654     1  4 05:50 ?        00:00:03 ora_smon_orcl
oracle    6656     1  0 05:50 ?        00:00:00 ora_reco_orcl
oracle    6658     1  3 05:50 ?        00:00:02 ora_mmon_orcl
oracle    6660     1  0 05:50 ?        00:00:00 ora_mmnl_orcl
oracle    6662     1  0 05:50 ?        00:00:00 ora_d000_orcl
oracle    6664     1  0 05:50 ?        00:00:00 ora_s000_orcl
oracle    6668     1  0 05:51 ?        00:00:00 ora_qmnc_orcl
oracle    6670     1  0 05:51 ?        00:00:00 ora_q000_orcl
oracle    6672     1  0 05:51 ?        00:00:00 ora_q001_orcl
oracle    6678     1  2 05:51 ?        00:00:00 ora_cjq0_orcl
'2.70'*orcl-/home/oracle>
2.查看消耗CPU 时间最长的进程:
'2.70'*orcl-/home/oracle>ps -ef|grep oracle|sort +6|tail
oracle    6672     1  0 05:51 ?        00:00:00 ora_q001_orcl
oracle    6668     1  0 05:51 ?        00:00:00 ora_qmnc_orcl
oracle    6656     1  0 05:50 ?        00:00:00 ora_reco_orcl
oracle    6664     1  0 05:50 ?        00:00:00 ora_s000_orcl
oracle    6688  6607  0 05:53 pts/1    00:00:00 ps -ef
oracle    6690  6607  0 05:53 pts/1    00:00:00 sort +6
root      6604  5322  0 05:48 ?        00:00:00 sshd: oracle [priv]
oracle    6606  6604  0 05:48 ?        00:00:00 sshd: oracle@pts/1
oracle    6658     1  1 05:50 ?        00:00:02 ora_mmon_orcl
oracle    6654     1  2 05:50 ?        00:00:03 ora_smon_orcl
还可以用下一种方法;
输出的第 3列(sort 中的+2)名字叫%CPU,显示的是当前每个进程的CPU 持有百分比。
'2.70'*orcl-/home/oracle>ps auxgw|sort +2|tail
oracle    6646  0.2  1.5 373592 16368 ?      Ss   05:50   0:00 ora_mman_orcl
oracle    6652  0.2  1.6 373780 16688 ?      Ss   05:50   0:00 ora_ckpt_orcl
root      5503  0.3  0.2  5888 2756 ?        Ss   05:47   0:01 hald
oracle    6650  0.3  1.4 389156 14960 ?      Ss   05:50   0:00 ora_lgwr_orcl
oracle    6678  0.4  2.7 375216 28204 ?      Ss   05:51   0:00 ora_cjq0_orcl
root      6341  0.8  0.8 11252 8388 ?        S    05:47   0:03 /usr/X11R6/bin/X :0 -audit 0 -auth /var/gdm/:0.Xauth -nolisten tcp vt7
gdm       6603  0.8  1.2 59664 13448 ?       Ss   05:48   0:03 /usr/bin/gdmgreeter
oracle    6658  1.2  4.4 376440 45808 ?      Ss   05:50   0:02 ora_mmon_orcl
oracle    6654  1.3  3.6 374192 37768 ?      Ss   05:50   0:03 ora_smon_orcl
USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
3.显示Oracle 的活动连接用户数量
'2.70'*orcl-/home/oracle>ps -ef|grep $ORACLE_SID|grep -v grep|grep ora_|wc -l
16

4.杀掉进程,见笔记一,汗,明天继续~


[本日志由 nero 于 2009-08-23 10:48 PM 编辑]
文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags: 简单就是美
评论: 0 | 引用: 0 | 查看次数: 161
发表评论
昵 称:
密 码: 游客发言不需要密码.
内 容:
验证码: 验证码
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
字数限制 1000 字 | UBB代码 开启 | [img]标签 开启