更为方便的是,支持分区数据库,也能够让你监控session级别的应用.
用法如下:
Usage: db2top [-d dbname] [-n nodename] [-u username] [-p password] [-V schema] [-i interval] [-P ]
[-a] [-R] [-k] [-x] [-f file ] [-b options] -o outfile]] [-C] [-m duration]
db2top -h
-d : Database name (default DB2DBDFT)
-n : Node name
-u : User name
-p : User password
-V : Default explain schema
-i : Interval in seconds between snapshots
-b : background mode
option: d=database, l=sessions, t=tablespaces, b=bufferpools, T=tables, D=Dynamic SQL, s=Statements, U=Locks
-o : output file for background mode
-a : Monitor only active objects
-R : Reset snapshot at startup
-k : Display cumulated counters
-x : Extended display
-P : Partition snapshot (number or current)
-f : Replay monitoring session from snapshot data collector file, can skip entries when +seconds is specified
-C : Run db2top in snapshot data collector mode
-m : Max duration in minutes for -b and -C
-h : this help
同时,这个工具和ibm的nmon一样,支持在后台运行,让你定时对系统采集数据,帮助你做趋势分析。另外,在下载的db2top包里面,甚至有一些sample的脚本,帮助你在自己的脚本里面调用.
比如:
db2top -d db_name -i 2 -a
表示使用交互模式,每隔2秒的采样,监控数据库active的对象。使用-b参数可以和nmon一样在后台作定时采样,并将数据生成到csv文件里面,然后在excel里面做成好看的图表:)
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/4096/viewspace-52593/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/4096/viewspace-52593/