Diagnosing Oracle memory on HP using GLANCE

来源:互联网 发布:大数据工程师 年龄要求 编辑:程序博客网 时间:2024/06/08 06:05

 大家在监控主机的时候,发现内存剩余很少,就担心,特别使用了网管软件,发现报警就担心,其实各种操作系统在使用内存的时候是都不一样的,下面我把aix下怎么监控内存使用给大家转载一篇文章,是oracle知识库里比较经典的一篇介绍hp下监控内存的。


   Monitoring Oracle Memory usage on HP
-----------------------------
 
Hp's "glance" utility can be found in /opt/perf/bin
This is a add on so it may need to be installed


To launch glance do the following:


/opt/perf/bin> ./glance


For this example we are looking at the PMON process for Oracle pid=3691*


when glance is launched we see the PROCESS LIST screen:


                                  PROCESS LIST                      Users=    3
                              User      CPU Util     Cum     Disk         Block
  Process Name   PID   PPID Pri Name    ( 200% max)    CPU   IO Rate    RSS    On
  --------------------------------------------------------------------------------
  ora_pmon_L8  24346      1 156 lsupport  0.0/ 0.0     0.0  0.0/ 0.0  41.8mb OTHER
  ora_pmon_R8   3691 *    1 156 rsupport  0.0/ 0.0     0.0  0.0/ 0.0   5.4mb   SEM
  ora_pmon_T8  22471      1 156 tsupport  0.0/ 0.0     0.0  0.0/ 0.0   5.6mb   SEM
  ora_pmon_V8  15321      1 156 usupport  0.0/ 0.0     0.1  0.0/ 0.0   5.8mb   SEM
  ora_pmon_X7  11970      1 156 xsupport  0.0/ 0.0     0.0  0.0/ 0.0   5.4mb   SEM
  ora_pmon_X8   5666      1 156 xsupport  0.0/ 0.0     0.0  0.0/ 0.0   5.6mb   SEM
  ora_pmon_X8  26978      1 156 xsupport  0.0/ 0.0     0.0  0.0/ 0.0   4.8mb   SEM
  ora_qmn0_V8  15343      1 156 usupport  0.0/ 0.0     0.0  0.0/ 0.0   3.1mb   SEM
  ora_reco_L7  21296      1 156 lsupport  0.0/ 0.0     0.0  0.0/ 0.0   9.4mb OTHER
  ora_reco_L8  24356      1 156 lsupport  0.0/ 0.0     0.0  0.0/ 0.0  32.1mb OTHER
  ora_reco_R7   5501      1 156 rsupport  0.0/ 0.0     0.0  0.0/ 0.0  12.7mb OTHER
                                                                    Page 3 of 7


1)We can see that this process has a RSS(resident set size) of 5.4m 
  actual memory used. 


   To focus in on the 3691 PMON process type in "s" then supply the process id


  Resources PID:  3691, ora_pmon_R817   PPID:     1 euid:1040 User: rsupport    
  --------------------------------------------------------------------------------
  CPU Usage (sec) :     0.00 Log Reads :      0 Rem Log Rds/Wts:      0/      0  
  User/Nice/RT CPU:     0.00 Log Writes:      0 Rem Phy Rds/Wts:      0/      0   
  System CPU      :     0.00 Phy Reads :      0
  Interrupt CPU   :     0.00 Phy Writes:      0 Total RSS/VSS  :  5.4mb/ 25.9mb
  Cont Switch CPU :     0.00 FS Reads  :      0 Traps / Vfaults:      0/      0   
  Scheduler       :     HPUX FS Writes :      0 Faults Mem/Disk:      0/      0   
  Priority        :      156 VM Reads  :      0 Deactivations  :      0
  Nice Value      :       20 VM Writes :      0 Forks & Vforks :      0
  Dispatches      :        2 Sys Reads :      0 Signals Recd   :      2
  Forced CSwitch  :        0 Sys Writes:      0 Mesg Sent/Recd :      0/      0   
  VoluntaryCSwitch:        2 Raw Reads :      0 Other Log Rd/Wt:      0/      0   
  Running CPU     :        0 Raw Writes:      0 Other Phy Rd/Wt:      0/      0   
  CPU Switches    :        0 Bytes Xfer:    0kb Proc Start Time
      C - cum/interval toggle   % - pct/absolute togglev 13 10:25:19Page 1 of 1




To see the memory mapping of process 3691 (PMON)


type in "M" then enter 3691 for the id

  Memory Regions PID:  3691, ora_pmon_R817   PPID:     1 euid:1040 User: rsupport
                              
  Type     RefCt   RSS    VSS  Locked  Virtual Address      File Name   
  --------------------------------------------------------------------------------
  TEXT  /S    9 10.0mb 16.0mb    0kb 0x0dd7d400.0x00001000 <reg,ufs,/u04,/dev/vg01
  DATA  /P    1  1.8mb  2.1mb    0kb 0x08188000.0x40001000 <reg,ufs,/u04,/dev/vg01
  MEMMAP/P    1    4kb    4kb    0kb 0x08188000.0x7aff6000 <reg,ufs,/u04,/dev/vg01
  MEMMAP/P    1    4kb   20kb    0kb 0x08188000.0x7aff7000 <reg,vxfs,/usr,/dev/vg0
  MEMMAP/P    1    8kb    8kb    0kb 0x08188000.0x7affc000 <reg,vxfs,/usr,/dev/vg0
  MEMMAP/P    1   12kb   12kb    0kb 0x08188000.0x7affe000 <mmap>
  MEMMAP/P    1   12kb   16kb    0kb 0x08188000.0x7b001000 <mmap>
  MEMMAP/P    1    4kb    4kb    0kb 0x08188000.0x7b005000 <reg,vxfs,/usr,/dev/vg0
  MEMMAP/P    1   12kb   16kb    0kb 0x08188000.0x7b006000 <mmap>
  MEMMAP/P    1   40kb   44kb    0kb 0x08188000.0x7b00a000 <reg,vxfs,/usr,/dev/vg0
  MEMMAP/P    1   60kb  136kb    0kb 0x08188000.0x7b015000 <mmap>
  MEMMAP/P    1   12kb   12kb    0kb 0x08188000.0x7b037000 <reg,vxfs,/usr,/dev/vg0
  STACK /P    1   20kb   20kb    0kb 0x08188000.0x7b03a000 <stack>
  UAREA /P    1   16kb   16kb    0kb 0x09489800.0x7ffe6000 <uarea>
  LIBTXT/S  150   56kb   60kb    0kb 0x00000000.0xc0003000 <reg,vxfs,/usr,/dev/vg0
  LIBTXT/S   95  1.2mb  1.4mb    0kb 0x00000000.0xc0012000 <reg,vxfs,/usr,/dev/vg
  LIBTXT/S  150    4kb    4kb    0kb 0x00000000.0xc0177000 <reg,vxfs,/usr,/dev/vg0
  LIBTXT/S  115  440kb  440kb    0kb 0x00000000.0xc054a000 <reg,vxfs,/usr,/dev/vg0
  LIBTXT/S   55   72kb   76kb    0kb 0x00000000.0xc06d4000 <reg,vxfs,/usr,/dev/vg0
  LIBTXT/S    9    4kb    8kb    0kb 0x00000000.0xc2b8e000 <reg,ufs,/u04,/dev/vg01
  SHMEM /S    9  2.6mb  5.5mb    0kb 0x00000000.0xc9de8000 <shmem>
  0/lvol9,inode:20151>    
  Text  RSS/VSS: 10mb/ 16mb  Data  RSS/VSS:1.8mb/2.1mb  Stack RSS/VSS: 20kb/ 20kb 
  Shmem RSS/VSS:2.6mb/5.5mb  Other RSS/VSS:2.0mb/2.2mb 


We can see that for this process, it did allocate:


a. 16MB for TEXT or code area. Code area is shared on HP.
b. 2.1MB for DATA or PGA area. This area is private to the process
c. 5.5MB for SHMEM or Shared Memory). This area is shared by all Oracle processes.
d. 20KB for Stack. This area is private to the process
e. 2.2MB for Other. This area is mostly reflect swap space (MEMMAP)


Further, the total RSS(real memory) used by this process is 16.42Mb, and
it did allocate use a total of 25.80MB VSS(virtual memory).


To see open files used by the PMON process
type "F"


  Open Files PID:  3691, ora_pmon_R817   PPID:     1 euid:1040 User: rsupport   
                                                          Open  Open      
  FD  File Name                                      Type   Mode  Count     Offset
  --------------------------------------------------------------------------------
  0 /dev/null                                      chr    read    3            0
  1 /dev/null                                      chr    read    3            0
  2 /dev/null                                      chr    read    3            0
  3 /dev/null                                      chr    read   16            0
  4 /dev/null                                      chr    read   16            0
  5 /dev/null                                      chr    read    2            0
  6 /dev/null                                      chr    read    8            0
  7 <reg,ufs,/u04,/dev/vg01/lvol2,inode:448002>    reg    write   6         6916
  8 /dev/null                                      chr    read    2            0
  9 <reg,ufs,/u04,/dev/vg01/lvol2,inode:436861>    reg    rd/wr   8         1254
 10 inet,tcp,*:3389 -> (any:0)                     socket rd/wr   8
 11 /dev/null                                      chr    read    1            0
 12 <reg,ufs,/u04,/dev/vg01/lvol2,inode:448002>    reg    write   1         6940
 13 inet,tcp,*:3390 -> (any:0)                     socket rd/wr   1            0
 14 <reg,ufs,/u04,/dev/vg01/lvol2,inode:332814>    reg    read    1         2078


UNIX files are attached to a inode number and you can find the file name via the inode:


 ncheck -i <i-node_number> <volume_name> 
     find <file_system_associated_with_lv_name> -xdev -inum <inode_number> -print


Determining memory usage for shadow processes is more
complicated since the amount of memory used can change greatly
from one moment to the next depending on what the user is doing.


To get a good estimate of memory used for shadow processes, 
run the "ps -flp <pid>"
command repeatedly at regular intervals while the process is under
peak load to get an average value. Take this value and
multiply it by the number of expected users to estimate how
much memory will be needed on the system.


                         GlancePlus Commands Menu
? - Commands Menu    b - Page Backward (or -)       < - Display Previous Screen
! - Invoke Shell     f - Page Forward (or +,space)  > - Display Next Logical Scr
h - Online Help      q - exit (or e )               z - Reset Statistics to Zero
p - Print Toggle     r - Refresh Screen (or ^L)   <cr>- Update Current Screen
j - Adjust Interval  o - Process Threshold Options    A - Application List
g - Process List     d - Disk Report                  P - PRM Group List
a - CPU By Processor i - IO By File System            Y - Global System Calls
c - CPU Report       u - IO By Disk                   F - Process Open Files
m - Memory Report    v - IO By Logical Volume         M - Process Memory Regions
t - System Tables    N - NFS Global Activity          R - Process Resources
w - Swap Space       n - NFS By System                W - Process Wait States
B - Global Waits     l - Network By Interface         L - Process System Calls
D - DCE Global       K - DCE Process List             E - Process DCE
T - Trans Tracking   s - Select Process               O - Process DCE Ops
H - Alarm History    S - Select Disk/NFS/Appl/Trans   y - Renice Process

原创粉丝点击