nmon使用说明

Nmon 工具是 IBM 提供的免费的监控 AIX 系统与 Linux 系统资源的工具。该工具可实时监控系统性能,也可以将服务器的系统资源耗用情况收集起来并输出一个特定的文件,并可利用 excel 分析工具进行数据的统计分析,非常利用 UNIX 或者 Linux 系统的性能数据分析。

1.下载地址
nmon官网
NMON_Analyser官网
本地下载nmon
本地下载nmon_analyser

2.安装nmon
在压缩包中找到相应的版本,上传至服务器,然后授予执行权限

3.主要操作说明

+-HELP---------most-keys-toggle-on/off------------------------------------------+
|h = Help information     q = Quit nmon             0 = reset peak counts       |
|+ = double refresh time  - = half refresh          r = ResourcesCPU/HW/MHz/AIX |
|c = CPU by processor     C=upto 128 CPUs           p = LPAR Stats (if LPAR)    |
|l = CPU avg longer term  k = Kernel Internal       # = PhysicalCPU if SPLPAR   |
|m = Memory & Paging      M = Multiple Page Sizes   P = Paging Space            |
|d = DiskI/O Graphs       D = DiskIO +Service times o = Disks %Busy Map         |
|a = Disk Adapter         e = ESS vpath stats       V = Volume Group stats      |
|^ = FC Adapter (fcstat)  O = VIOS SEA (entstat)    v = Verbose=OK/Warn/Danger  |
|n = Network stats        N=NFS stats (NN for v4)   j = JFS Usage stats         |
|A = Async I/O Servers    w = see AIX wait procs   "="= Net/Disk KB<-->MB       |
|b = black&white mode     g = User-Defined-Disk-Groups (see cmdline -g)         |
|t = Top-Process --->     1=basic 2=CPU-Use 3=CPU(default) 4=Size 5=Disk-I/O    |
|u = Top+cmd arguments    U = Top+WLM Classes       . = only busy disks & procs |
|W = WLM Section          S = WLM SubClasses)                                   |

4.实时监控结果
1)监控内存使用情况

| Memory -----------------------------------------------------------------------|
|          Physical  PageSpace |        pages/sec  In     Out | FileSystemCache |
|% Used       93.8%     34.3%  | to Paging Space   0.0    0.0 | (numperm) 44.3% |
|% Free        6.2%     65.7%  | to File System    0.0  257.9 | Process   18.2% |
|MB Used    1786.0MB   175.8MB | Page Scans        0.0        | System    31.4% |
|MB Free     118.0MB   336.2MB | Page Cycles       0.0        | Free       6.2% |
|Total(MB)  1904.0MB   512.0MB | Page Steals       0.0        |           ------|
|                              | Page Faults     279.9        | Total    100.0% |
|------------------------------------------------------------ | numclient 44.3% |
|Min/Maxperm     361MB( 19%)  1443MB( 76%) <--% of RAM        | maxclient 75.8% |
|Min/Maxfree     960   1088       Total Virtual    2.4GB      | User      58.4% |
|Min/Maxpgahead    2      8    Accessed Virtual    0.9GB 40.1%| Pinned    28.6% |
|-------------------------------------------------------------------------------|

2)监控cpu使用情况

|                           0----------25-----------50----------75----------100 
|CPU User%  Sys% Wait% Idle%|           |            |           |            | 
|  0   0.0   0.0   0.0 100.0|>                                                | 
|  1   0.0   0.0   0.0 100.0|>          |                                       
|  2   0.0   0.0   0.0 100.0|>                                                |
|  3   0.0   0.0   0.0 100.0|>                                                |
|Physical Averages          +-----------|------------|-----------|------------+
|All   0.2   2.5   0.7  96.6|>                                                |
|                           +-----------|------------|-----------|------------+

3)监控进程状态

| Top-Processes-(147) -----Mode=3  [1=Basic 2=CPU 3=Perf 4=Size 5=I/O 6=Cmds]-----------------------------|
|  PID       %CPU     Size      Res     Res      Res     Char    RAM      Paging         Command          |
|            Used       KB      Set     Text     Data     I/O     Use   io   other repage                 |
| 1908868     0.8    30508    29764      132    29632        2    2%      0      3      0 secldapclntd    |
| 2306196     0.7      512      512        0      512        0    0%      1      8      0 trclogio        |
| 2732116     0.6     2520        0        0        0        0    0%      0     33      0 <defunct Zombie>|
|  340036     0.2     1416      296       72      224        0    0%      0      0      0 dtgreet         |

5.监控一段时间性能

-f            spreadsheet output format [note: default -s300 -c288]
optional
 -s <seconds>  between refreshing the screen [default 2]
 -c <number>   of refreshes [default millions]
 -t            spreadsheet includes top processes
具体信息nmon -h

例如:nmon -f -t -s 30 -c 120
-s 30:每30秒进行一次数据采集
-c 120:一共采集120次

6.分析数据
打开nmon analyser,设置宏的安全级别是低 ,之后点击 Analyser NMON data 按钮 输入文件 保存成excel格式即可。

发表在 AIX | 一条评论

Easy Connect Naming Method与EZCONNECT关系

Easy Connect Naming Method这个东西是Oracle 10g推出的东东,我想不用我解释它的好,dba和开发人员都喜欢它,以前一直都用它,从没有关注到它和sqlnet.ora中的NAMES.DIRECTORY_PATH的关系,昨天一朋友和我说到了EZCONNECT,今天查询了一些资料和做了一些实验,使得自己对NAMES.DIRECTORY_PATH和EZCONNECT有了新的认识,也怪自己一致忽略了这个知识点。

1.NAMES.DIRECTORY_PATH= (TNSNAMES)

[oracle@node1 samples]$ more $ORACLE_HOME/network/admin/sqlnet.ora
#NAMES.DIRECTORY_PATH= (EZCONNECT)
NAMES.DIRECTORY_PATH= (TNSNAMES)


[oracle@node1 samples]$ sqlplus hr/xifenfei@127.0.0.1/ecp

SQL*Plus: Release 10.2.0.5.0 - Production on Wed Feb 8 23:12:12 2012

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified


Enter user-name: 
ERROR:
ORA-01017: invalid username/password; logon denied


Enter user-name: 
ERROR:
ORA-01017: invalid username/password; logon denied


SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus

证明sqlnet.ora中的NAMES.DIRECTORY_PATH设置为TNSNAMES时,Easy Connect Naming Method不能工作。

2.NAMES.DIRECTORY_PATH= (EZCONNECT)

[oracle@node1 samples]$ more $ORACLE_HOME/network/admin/sqlnet.ora
NAMES.DIRECTORY_PATH= (EZCONNECT)
#NAMES.DIRECTORY_PATH= (TNSNAMES)


[oracle@node1 samples]$ sqlplus hr/xifenfei@127.0.0.1/ecp

SQL*Plus: Release 10.2.0.5.0 - Production on Wed Feb 8 23:13:21 2012

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> 

登录成功,其实这里生效是因为设置了NAMES.DIRECTORY_PATH为EZCONNECT的功效,从EZCONNECT的上面也可以看出是

3.NAMES.DIRECTORY_PATH为默认值

[oracle@node1 samples]$ more $ORACLE_HOME/network/admin/sqlnet.ora
#NAMES.DIRECTORY_PATH= (EZCONNECT)
#NAMES.DIRECTORY_PATH= (TNSNAMES)
[oracle@node1 samples]$ sqlplus hr/xifenfei@127.0.0.1/ecp

SQL*Plus: Release 10.2.0.5.0 - Production on Wed Feb 8 23:13:49 2012

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> 

当NAMES.DIRECTORY_PATH为默认值时,使用Easy Connect Naming Method也可以登录成功(正是因为这个原因,导致我忽略了EZCONNECT的存在).

4.sqlnet.ora中关于NAMES.DIRECTORY_PATH说明

#names.directory_path
#
#Syntax:  <adapter-name>
#Default: TNSNAMES,ONAMES,HOSTNAME
#
# Sets the (ordered) list of naming adaptors to use in resolving a name.
# The default is as shown for 3.0.2 of sqlnet onwards. The default was
# (TNSNAMES, ONAMES) before that. The value can be presented without
# parentheses if only a single entry is being specified. The parameter is
# recognized from version 2.3.2 of sqlnet onward. Acceptable values include:
#  TNSNAMES -- tnsnames.ora lookup
#  ONAMES   -- Oracle Names
#  HOSTNAME -- use the hostname (or an alias of the hostname)
#  NIS      -- NIS (also known as "yp")
#  CDS      -- OSF DCE's Cell Directory Service
#  NDS      -- Novell's Netware Directory Service

5.关于NAMES.DIRECTORY_PATH参数的补充说明

tnsnames:local naming naming method
Set to resolve a net service name through the tnsnames.ora file on the client.

hostname:host naming method
Set to resolve a host name alias through an existing names resolution service or a centrally-maintained set of /etc/hosts files.

onames:Oracle Names method
Set to resolve database objects through a Oracle Names server.

ldap:directory naming naming method
Set to resolve a database service name, net service name, or net service alias through a directory server.

cds:Cell Directory Services (CDS) external naming method
Set to resolve an Oracle database name in a Distributed Computing Environment (DCE) environment.

nis:Network Information Service (NIS) external naming method
Set to resolve service information through an existing NIS.

Ezconnect:The easy connect naming method eliminates the need for service name lookup in the tnsnames.ora files for TCP/IP environments; in fact, no naming or directory system is required if you use this method.
发表在 Oracle | 一条评论

ORA-00600[4454]

数据库版本信息

SQL> select * from gv$version;

   INST_ID BANNER
---------- ----------------------------------------------------------------
         1 Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
         1 PL/SQL Release 9.2.0.8.0 - Production
         1 CORE 9.2.0.8.0       Production
         1 TNS for IBM/AIX RISC System/6000: Version 9.2.0.8.0 - Production
         1 NLSRTL Version 9.2.0.8.0 - Production
         2 Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
         2 PL/SQL Release 9.2.0.8.0 - Production
         2 CORE 9.2.0.8.0       Production
         2 TNS for IBM/AIX RISC System/6000: Version 9.2.0.8.0 - Production
         2 NLSRTL Version 9.2.0.8.0 - Production

10 rows selected.

早上检查某运营商的结算数据库时发现

Mon Feb  6 16:03:23 2012
Errors in file /oracle9/app/admin/settl/udump/settl1_ora_1355948.trc:
ORA-00600: internal error code, arguments: [4454], [], [], [], [], [], [], []
Mon Feb  6 16:03:23 2012
Errors in file /oracle9/app/admin/settl/udump/settl1_ora_1355948.trc:
ORA-00600: internal error code, arguments: [4454], [], [], [], [], [], [], []

trace文件信息

*** SESSION ID:(100.35758) 2012-02-06 16:03:23.223
*** 2012-02-06 16:03:23.223
ksedmp: internal or fatal error
ORA-00600: internal error code, arguments: [4454], [], [], [], [], [], [], []
Current SQL statement for this session:
select trim(operator_id) into :b1  from b_sys_proc where program_name=:b2
----- Call Stack Trace -----
calling              call     entry                argument values in hex      
location             type     point                (? means dubious value)     
-------------------- -------- -------------------- ----------------------------
ksedmp+0148          bl       ksedst               1029746CC ?
ksfdmp+0018          bl       01FD4010             
kgeriv+0118          bl       _ptrgl               
kgeasi+00cc          bl       kgeriv               1101FAF48 ? 110248038 ?
                                                   00000000C ? 110235978 ?
                                                   000000040 ?
ktcsptg+00c4         bl       kgeasi               1100062D8 ? 110389E88 ?
                                                   116600001166 ? 200000002 ?
                                                   000000000 ? 70000010738F0E8 ?
                                                   0FFFFFFFF ? 0FFFFFFFF ?
opiexe+0524          bl       ktcsptg              000000000 ? 000000000 ?
opiefn0+01c0         bl       opiexe               49FFFFA640 ? 4900000001 ?
                                                   FFFFFFFFFFFA5C8 ?
opiefn+0100          bl       opiefn0              01000CF60 ? 1029C61B0 ?
                                                   000000002 ? FFFFFFFFFFFC1BC ?
                                                   000000001 ? 00000000C ?
                                                   00000000B ? 110061F50 ?
opiodr+08cc          bl       _ptrgl               
ttcpip+0cc4          bl       _ptrgl               
opitsk+0d60          bl       ttcpip               11000CF60 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
opiino+0758          bl       opitsk               000000000 ? 000000000 ?
opiodr+08cc          bl       _ptrgl               
opidrv+032c          bl       opiodr               3C00000018 ? 4101FAF48 ?
                                                   FFFFFFFFFFFF790 ? 0A000EEA8 ?
sou2o+0028           bl       opidrv               3C0C000000 ? 4A0147B50 ?
                                                   FFFFFFFFFFFF790 ?
main+0138            bl       01FD3A28             
__start+0098         bl       main                 000000000 ? 000000000 ?
………………
SO: 70000010738f0e8, type: 4, owner: 7000001043acd90, flag: INIT/-/-/0x00
    (session) trans: 70000010dde1dd8, creator: 7000001043acd90, flag: (100041) USR/- BSY/-/-/-/-/-
              DID: 0001-0064-7625733A, short-term DID: 0000-0000-00000000
              txn branch: 7000001147dbed8
              oct: 0, prv: 0, sql: 700000117b7f778, psql: 0, user: 24/SETTLE
    O/S info: user: settle, term: , ospid: 1400836, machine: zwq_jies2
              program: /settlement/pkg01/bin/long/long_app@zwq_jies2 (T
    application name: /settlement/pkg01/bin/long/long_app@zwq_jies2 (T, hash value=0
    last wait for 'SQL*Net message from client' blocking sess=0x0 seq=483 wait_time=240
                driver id=54435000, #bytes=1, =0

查询MOS,发现是Bug# 1402161(虽然在mos中声明该bug是在9.2.0.1中已经被修复,但是这里的trace文件中的Call Stack Trace和mos中记录一致,而且网络上也存在很多9.2.0.8中关于该bug的情况),trace文件最后一段可以看出是在节点2上(zwq_jies2)运行/settlement/pkg01/bin/long/long_app程序导致出现该错误
产生该错误原因:

This exception is signalled because the savepoint number is not what was
  expected.
The current transaction savepoint is less than the beginning savepoint of 
  the transaction.

解决方法:
把/settlement/pkg01/bin/long/long_app中的需要运行的程序分割成几个小程序运行。

Break the job into smaller chunks and reconnect for each part of the job 
  to reset the savepoint number.
发表在 ORA-xxxxx | 标签为 , | 评论关闭