ITPub博客

首页 > 数据库 > Oracle > How To Display Information About Processes on SUN Solaris_0609.1

How To Display Information About Processes on SUN Solaris_0609.1

Oracle 作者:rongshiyuan 时间:2014-04-03 16:11:00 0 删除 编辑
How To Display Information About Processes on SUN Solaris (Doc ID 70609.1)

PURPOSE

This document helps you to understand how to display information about a
process running on SUN Solaris.

Sun Microsystems provides a series of utilities with its Solaris
operating system that can be used to gather information about a
particular process.  These utilities are located in the /usr/proc/bin
directory.  To use one of these utilities, the process id (PID) of
the process must first be determined.


SCOPE & APPLICATION

The information in this document is intended for system administrators and
database administrators.


1. (Optional) Use output from the ps command to obtain the identification number
   of the process you want to display more information about.


    % ps -e | grep process


2. Use the appropriate /usr/proc/bin command to display the information you
   need.

    % /usr/proc/bin/pcommand pid

   pcommand=Process tool command you want to run. /usr/proc/bin

Process Tools That Display Information lists these commands.

*** PCOMMANDs

    pcred =Credentials
    pfiles =fstat and fcntl information for open files in a process
    pflags = /proc tracing flags, pending and held signals, and other status
                                  information
    pldd = Dynamic libraries linked into a process
    pmap =Address space map
    psig =Signal actions
    pstack = Hex+symbolic stack trace
    ptime  = Process time using microstate accountin
    ptree = Process trees that contain the process
    pwait = Status information after a process terminates
    pwdx = Current working directory for a process


Displaying Information About Processes

The following example shows how to use process tool commands to display more
information about an lpsched process. First the /usr/proc/bin path is defined
to avoid typing long process tool commands. Next, the identification number for
lpsched is obtained. Finally, output from three process tool commands is shown.


    [ Adds the /usr/proc/bin directory to
    the PATH variable. ]# PATH=$PATH:/usr/proc/bin
    %export PATH

    [ Obtains the process identification number for lpsched. ]% ps -e | grep
    lpsched
   
    191 ?        0:00 /usr/lib/lpsched
   
    [ Displays the current working directory for lpsched.]% pwdx 191
 
    191:    /

    [  Displays the process tree containing lpsched. ]%ptree 191
 
    183   /usr/lib/lpsched

    [ Displays fstat and fcntl information. ]% pfiles 191

    210:    /usr/lib/lpsched
    Current rlimit: 1024 file descriptors
    0: S_IFIFO mode:0000 dev:165,0 ino:83 uid:0 gid:0 size:0
       O_RDWR
    1: S_IFIFO mode:0000 dev:165,0 ino:83 uid:0 gid:0 size:0
       O_RDWR
    3: S_IFCHR mode:0666 dev:32,24 ino:34307 uid:0 gid:3 rdev:21,0
       O_WRONLY FD_CLOEXEC
    4: S_IFDOOR mode:0444 dev:171,0 ino:4124226512 uid:0 gid:0
       size:0
       O_RDONLY|O_LARGEFILE FD_CLOEXEC  door to nscd[200]
    5: S_IFREG mode:0664 dev:32,24 ino:311 uid:71 gid:8 size:0
       O_WRONLY



The following example shows output from the pwait command, which waits until a
process terminates, then displays information about what happened. The following
example shows output from the pwait command after a Command Tool window is
exited.


    $ ps -e | grep cmdtool
      273 console 0:01 cmdtool
      277 console 0:01 cmdtool
      281 console 0:01 cmdtool
    $ pwait -v 281
      281: terminated, wait status 0x0000


NOTE:

The /usr/proc/bin commands do not appear on the Linux operating system.




来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/17252115/viewspace-1135531/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2009-11-24

  • 博文量
    798
  • 访问量
    3250927