一.OSWatcher 说明
OSWatcher 是Oracle 提供的一个用于操作系统监控的工具包,分Windows 和Linux 2个版本。
Linux 下的下载参考:OS Watcher Black Box UserGuide [ID 301137.1]
Windows平台下载:OSWatcher For Windows (OSWFW) User Guide [ID 433472.1]
也可以从我的CSDN 下载:
Oracle OS Watcher Tool
http://download.csdn.net/detail/tianlesoftware/4049989
OSWatcher hasbeen renamed to OSWatcher Black Box to avoid confusion as there are many toolsin support with this same name. This version is not to be confused with theversion of OSWatcher that is shipped with Exadata.
--OSWatcher 在4.0 版本被重命名为OSWatcherBlack Box,已避免造成与同名工具的疑惑。
New in thisrelease (4.0.0) is a built-in analyzer which analyzes the data OSWbb collectsand provides information on system slowdowns, hangs and other OS performanceproblems.
--在最新的4.0.0 版本,添加了收集分析数据的功能,在系统slowdown,hang 或者其他性能问题时会提供相关的分析数据。
OS Watcher BlackBox Analyzer (OSWbba) is a graphing and analysis utility which comes bundledwith OSWbb v4.0.0 and higher. OSWbba allows the userto graphically display data collected, generate reports containing these graphsand provides a built in analyzer to analyze the data and provide details on anyperformance problems it detects. The ability to graph and analyze thisinformation relieves the user of manually inspecting all the files.
-- OS Watcher Black Box Analyzer (OSWbba) 是一个绘图和分析工具,其捆绑在 OS Watcher Black Box(OSWbb)4.0中。
NOTE:OSWbbareplaces the utility OSWg. This was done to eliminate the confusion caused byhaving multiple tools in support named OSWatcher. OSWbba is only supported fordata collected by OSWbb and no other tool.
--OSWbba 替代了OSWg工具,已避免其和OSWatcher 工具的疑惑。OSWbba 仅仅用来支持OSWbb的数据收集,不做其他用途。
以上的说明感觉有点复杂,简单点说:
在OSW 4.0 之前是:OSWatcher 和 OSWg的关系。
OSW 4.0 后变成了: OSWbb 与 OSWbba 的关系。
这样避免造成名称上的疑惑。OSWbb收集数据,OSWbba 分析数据。
还有一个类似的工具OracleRDA:
OracleRDA(Remote Diagnostic Agent) 工具说明
http://blog.csdn.net/tianlesoftware/article/details/6758522
二.OS Watcher Black Box 安装配置
MOS:OS Watcher Black Box User Guide [ID 301137.1]
2.1 OSWbb 说明
OS Watcher BlackBox (OSWbb) is a collection of UNIX shell scripts intended to collect andarchive operating system and network metrics to aid support in diagnosingperformance issues. OSWbb operates as a set of background processes on theserver and gathers OS data on a regular basis, invoking such Unix utilities asvmstat, netstat and iostat. OSWbb can be downloaded from this note. OSWbb isalso included in the RAC-DDT script file, but is not installed by RAC-DDT. Formore information on RAC-DDT see <>. OSWbb is installed on each node wheredata is to be collected. Installation instructions for OSWbb are provided inthis user guide.
--OSWbb 是UNIX 脚本的集合,其用来收集和归档数据,从来来帮助定位问题。 OSWbb 操作可以设置为一个后台进程,然后规则的收集数据,其调用Unix 的工具,如vmstat,netstat和iostat。
OSWbb 包含了RAC-DDT脚本,但RAC-DDT 不包含OSWbb。
OSWbb consistsof a series of shell scripts. OSWatcher.sh is the main controlling executive,which spawns individual shell processes to collect specific kinds of data,using Unix operating system diagnostic utilities. Control is passed toindividually spawned operating system data collector processes, which in turncollect specific data, timestamp the data output, and append the data topre-generated and named files. Each data collector will have its own file,created and named by the File Manager process.
--OSWbb 包含一系列的shell 脚本。 OSWwaterch.sh 是总控制,其可以生成独立的shell 进程来收集不同的数据。
每个收集的信息都有自己独立的文件,文件名有时间戳。
Data collectionintervals are configurable by the user, but will be uniform for all datacollector processes for a single instance of the OSWbb tool. For example, ifOSWbb is configured to collect data once per minute, each spawned datacollector process will generate output for its respective metric, write data toits corresponding data file, then sleep for one minute (or other configuredinterval) and repeat. Because we are collecting data every minute, the filesgenerated by each spawned processes will contain 60 entries, one for eachminute during the previous hour. Each file will contain, at most, one hour ofdata. At the end of each hour, File Manager will wake up and copy the existingcurrent hour file to an archive location, then create a new current hour file.
--数据收集的间隔由用户配置,但对一个OSWbb 实例来说,其所有的收集进程的间隔时间是一样的。
The File Managerensures only the last N hours of information are retained,where N is a configurable integer defaulting to 48. File Manager willwake up once per hour to delete files older than N hours. At anytime, the entire output file set will consist of one current hour file,plus N archive files for each data collector process.
stopOSWbb.sh will terminate all processesassociated with OSWbb, and is the normal, graceful mechanism for stopping thetool's operation.
--File Manager 用来控制日志文件只保留最后N个小时的信息,这个N由用户配置,默认是48小时。File Manager 每隔一小时被唤醒一次,用来删除超过N小时的日志。
OSWbb invokesthese distinct operating system utilities, each as a distinct backgroundprocess, as data collectors. These utilities will be supported, or theirequivalents, as available for each supported target platform.
--OSWbb 直接调用系统命令来收集信息,每个收集的信息都对应一个后台进程,这些命令包括:
(1) ps
(2) top
(3) mpstat
(4) iostat
(5) netstat
(6) traceroute
(7) vmstat
2.2 Supported Platforms
OSWbb is certified to run on the followingplatforms:
--OSWbb 支持如下平台:
(1) AIX
(2) Tru64
(3) Solaris
(4) HP-UX
(5) Linux
2.3 Gathering DiagnosticData
2.3.1 Installing OSWbb
OSWbb needs tobe installed on each node, one installation per node. OSWbb should be installedmanually by using the following procedure:
--OSWbb 需要在每个节点上安装。从MOS上下载的OSWbb 是tar 文件,使用如下命令对tar 文件进行解压缩,就会得到一个OSWbb的文件夹。
[root@rac1 u01]#tar xvfoswbb.tar
oswbb 文件夹包含了所有需要的文件。解压缩的过程就是OSWbb的过程,也就是说,OSWbb 不需要安装,直接解压缩即可。
2.3.2 Uninstalling OSWbb
To de-installOSWbb issue the following command on the oswbb directory.
--卸载OSWbb,使用rm 命令移除整个文件夹即可,命令如下:
[root@rac1 u01]#rm -rf oswbb
2.3.3 Setting up OSWbb
Once OSWbb isinstalled, scripts have been provided to start and stop the OSWbb utility. WhenOSWbb is started for the first time it creates the archive subdirectory. Thearchive directory contains 7 subdirectories, one for each data collector. Datacollectors exist for top, vmstat, iostat, mpstat, netstat, ps and an optionalcollector for tracing private networks. To turn on data collection for privatenetworks the user must create an executable file in the oswbb directory namedprivate.net. An example of what this file should look like is named Exampleprivate.net with samples for each operating system: solaris, linux, aix, hp,etc. in the oswbb directory. This file can be edited and renamed private.net ora new file named private.net can be created. This file contains entries forrunning the traceroute command to verify RAC private networks.
--当OSWbb 安装完成之后,就可以使用start 和stop 脚本,在OSWbb第一次使用时,它会创建一些归档的子目录。 这些归档目录包含7个子目录,每一个子目录对应一个收集数据。 这7个目录分别对应:top, vmstat, iostat, mpstat, netstat, ps 和一个可选的traceprivate network。
要启动private network,必须先在oswbb目录下创建一个private.net的可执行文件。 这个文件里的内容可以是用来验证RAC private network的traceroute命令。
下面是Solaris平台下private.net示例:
Example private.net entry on Solaris:
traceroute -r -F node1
traceroute -r -F node2
Where node1 andnode2 are 2 nodes in addition to the hostnode of a 3 node RAC cluster. If thefile private.net does not exist or is not executable then no data will becollected and stored under the oswprvtnet directory.
OSWbb will needaccess to the OS utilities: top, vmstat, iostat, mpstat,netstat, and traceroute. These OS utilities need to be installon the system prior to running OSWbb. Execute permission on theseutilities need to be granted to the user of OSWbb.
--OSWbb 需要访问OS 命令,这些OS 命令需要在运行OSWbb之前安装好。
2.3.4 Starting OSWbb
To start theOSWbb utility execute the startOSWbb.sh shell script from the directory whereOSWbb was installed. This script has 2 arguments which control the frequencythat data is collected and the number of hour's worth of data to archive.
--启动OSWbb 功能用startOSWbb.sh 脚本。 这个脚本有2个脚本,其用来控制数据收集的频率和归档数据保留的时间。
ARG1 = snapshotinterval in seconds.
ARG2 = the number of hours of archive data to store.
If you do notenter any arguments the script runs with default values of 30 and 48 meaningcollect data every 30 seconds and store the last 48 hours of data in archive files.
--如果没有在启动时没有指定这2个参数,那么默认情况是30秒收集一次,归档数据保留48个小时。
--示例一
Example 1:
./startOSWbb.sh 60 10
This would startthe tool and collect data at 60 second intervals and log the last 10 hours ofdata to archive files.
--这个命令每隔60秒收集一次,数据保留10个小时。
Example 2:
./startOSWbb.sh
NOTE: This woulduse the default values of 30, 48 and collect data at 30 second intervals andlog the last 48 hours of data to archive files.
--没有指定参数,使用默认值
Example 3:
nohup ./startOSWbb.sh 60 10 &
This would startthe tool, put the process in the background, enable to the tool to continuerunning after the session has been terminated, collect data at 60 secondintervals, and log the last 10 hours of data to archive files.
--使用nohup让脚本后台执行。 更多内容,参考我的Blog:
Linux 前台 和 后台进程 说明
http://blog.csdn.net/tianlesoftware/article/details/6165753
2.3.5 Stopping OSWbb
To stop theOSWbb utility execute the stopOSWbb.sh command from the directory where OSWbbwas installed. This terminates all the processes associated with the tool.
--停止OSWbb,使用stopOSWbb.sh 脚本即可。这个命令将终止所有相关的进程。
Example:
./stopOSWbb.sh
2.4 Diagnostic Data Output
--OSWbb 数据内容说明
As stated above,when OSWbb is started for the first time it creates the archive subdirectoryunder the OSWbb installation directory. The archive directory contains 7subdirectories, one for each data collector. These directories are namedoswiostat, oswmpstat, oswnetstat, oswprvtnet, oswps, oswtop, and oswvmstat. Onefile per hour will be generated in each of the 7 OS utility subdirectories withthe exception of oswprvtnet which is dependent on having private networkstracing configured. A new file is created at the top of each hour during thetime that OSWbb is running. The file will be in the following format:
--在第一次运行OSWbb时,会在OSWbb安装目录下创建7个子目录,分别对应7个不同的收集信息。这7个目录是:oswiostat, oswmpstat, oswnetstat, oswprvtnet,oswps, oswtop, and oswvmstat。 在7个目录中,每个一小时生成一个归档文件,这里除了private networks,因为其启动与否决定相关参数是否配置。 每个文件名的格式如下:
__YY.MM.DD.HH24.dat
rac1:/u01/oswbb> cd archive
rac1:/u01/oswbb/archive> ls
oswiostat oswmeminfo oswmpstat oswnetstat oswprvtnet oswps oswslabinfo oswtop oswvmstat
rac1:/u01/oswbb/archive> ll
total 36
drwxr-xr-x. 2 oracle oinstall 4096 Mar 3 21:04 oswiostat
drwxr-xr-x. 2 oracle oinstall 4096 Mar 3 21:04 oswmeminfo
drwxr-xr-x. 2 oracle oinstall 4096 Mar 3 21:04 oswmpstat
drwxr-xr-x. 2 oracle oinstall 4096 Mar 3 21:04 oswnetstat
drwxr-xr-x. 2 oracle oinstall 4096 Mar 3 21:04 oswprvtnet
drwxr-xr-x. 2 oracle oinstall 4096 Mar 3 21:04 oswps
drwxr-xr-x. 2 oracle oinstall 4096 Mar 3 21:04 oswslabinfo
drwxr-xr-x. 2 oracle oinstall 4096 Mar 3 21:04 oswtop
drwxr-xr-x. 2 oracle oinstall 4096 Mar 3 21:04 oswvmstat
rac1:/u01/oswbb/archive> cd oswiostat/
rac1:/u01/oswbb/archive/oswiostat> ls
rac1_iostat_12.03.03.2100.dat
Details about each type of data file can beviewed by clicking on the below links:
oswiostat
oswmpstat
oswnetstat
oswprvtnet
oswps
oswtop
oswvmstat
2.4.1 oswiostat
_iostat_YY.MM.DD:HH24.dat
These files willcontain output from the 'iostat' command that is obtained and archive byOSWatcher Black Box at specified intervals. These files will only existif 'iostat' is installed on the OS and if the OSWbb user has privileges to runthe utility.
The iostatcommand is used for monitoring system input/output device loading by observingthe time the physical disks are active in relation to their average transfer rates.This information can be used to change system configuration to better balancethe input/output load between physical disks and adapters.
--iostat 命令可以监控系统的I/O.
The iostatutility is fairly standard across UNIX platforms, but really on useful for thoseplatforms that support extended disk statistics: AIX, Solaris and Linux. Alsoeach platform will have a slightly different version of the iostat utility. Youshould consult your operating system man pages for specifics. The sampleprovided below is for Solaris.
OSWbb runs theiostat utility at the specified interval and stores the data in the oswiostatsubdirectory under the archive directory. The data is stored in hourly archivefiles. Each entry in the file contains a timestamp prefixed by *** embedded inthe iostat output. Notice there are 3 entries for each timestamp. You shouldalways ignore the first entry as this entry is always invalid. The second andthird entry will be valid but the second entry will be 1 sec later than thetimestamp and the third entry will be 2 seconds later than the timestamp.
Sample iostat file produced by OSWbb
|
extended device statistics
|
r/s
|
w/s
|
kr/s
|
kw/s
|
wait
|
actv
|
wsvc_t
|
asvc_t
|
%w
|
%b
|
device
|
0.0
|
0.3
|
0.0
|
2.1
|
0.0
|
0.0
|
3.4
|
0.8
|
0
|
0
|
c0t0d0
|
0.0
|
2.1
|
0.1
|
12.9
|
0.0
|
0.0
|
0.6
|
0.4
|
0
|
0
|
c0t2d0
|
0.0
|
0.0
|
0.0
|
0.0
|
0.0
|
0.0
|
0.0
|
0.0
|
0
|
0
|
fd0
|
2.9
|
1.2
|
240.8
|
1.5
|
0.0
|
0.1
|
0.0
|
13.3
|
0
|
5
|
c1t0d0
|
1.1
|
0.8
|
18.0
|
8.8
|
0.0
|
0.0
|
0.1
|
5.9
|
0
|
1
|
c1t1d0
|
0.0
|
0.0
|
0.0
|
0.0
|
0.0
|
0.0
|
0.0
|
0.0
|
0
|
0
|
c0t1d0
|
|
2.4.1.1 Field Descriptions –字段描述
The iostat output contains summaryinformation for all devices.
Field
|
Description
|
r/s
|
Shows the number of reads/second
|
w/s
|
Shows the number of writes/second
|
kr/s
|
Shows the number of kilobytes read/second
|
kw/s
|
Shows the number of kilobytes written/second
|
wait
|
Average number of transactions waiting for service (queue length)
|
actv
|
Average number of transactions actively being serviced
|
wsvc_t
|
Average service time in wait queue, in milliseconds
|
asvc_t
|
Average service time of active transactions, in milliseconds
|
%w
|
Percent of time there are transactions waiting for service
|
%b
|
Percent of time the disk is busy
|
device
|
Device name
|
2.4.1.2 What to look for – 关注的内容
(1) Average service times greaterthan 20msec for long duration.
(2) High average wait times.
2.4.2 oswmpstat
_mpstat_YY.MM.DD:HH24.dat
These files willcontain output from the 'mpstat' command that is obtained and archive byOSWatcher Black Box at specified intervals. These files will only existif 'mpstat' is installed on the OS and if the OSWbb user has privileges to runthe utility.
The mpstat command collects and displays performancestatistics for all logical CPUs in the system.
--mpstat 命令收集和显示所有逻辑CPU的性能统计信息。
The mpstatutility is fairly standard across UNIX platforms. Each platform will have aslightly different version of the mpstat utility. You should consult youroperating system man pages for specifics. The sample provided below is forSolaris.
--每个平台都有不同版本的mpstat命令。
OSWbb runs thempstat utility at the specified interval and stores the data in the oswmpstatsubdirectory under the archive directory. The data is stored in hourly archivefiles. Each entry in the file contains a timestamp prefixed by *** embedded inthe mpstat output. Notice there are 3 entries for each timestamp. You shouldalways ignore the first entry as this entry is always invalid. The second andthird entry will be valid but the second entry will be 1 sec later than thetimestamp and the third entry will be 2 seconds later than the timestamp.
Sample mpstat file produced by OSWbb
|
***Fri Jan 28 12:50:36 EST 2005
|
CPU
|
minf
|
mjf
|
xcal
|
intr
|
ithr
|
csw
|
icsw
|
migr
|
smtx
|
srw
|
syscl
|
usr
|
sys
|
wt
|
idl
|
0
|
0
|
0
|
0
|
483
|
383
|
118
|
1
|
0
|
0
|
0
|
64
|
0
|
0
|
0
|
100
|
0
|
1268
|
0
|
0
|
486
|
382
|
414
|
42
|
0
|
0
|
0
|
2902
|
8
|
24
|
0
|
68
|
0
|
4
|
0
|
0
|
479
|
379
|
144
|
3
|
0
|
0
|
0
|
96
|
0
|
0
|
0
|
100
|
|
2.4.2.1 Field Descriptions
Field
|
Description
|
cpu
|
Processor ID
|
minf
|
Minor faults
|
mif
|
Major Faults
|
xcal
|
Processor cross-calls (when one CPU wakes up another by interrupting it).
|
intr
|
Interrupts
|
ithr
|
Interrupts as threads (except clock)
|
csw
|
Context switches
|
icsw
|
Involuntary context switches
|
migr
|
Thread migrations to another processor
|
smtx
|
Number of times a CPU failed to obtain a mutex
|
srw
|
Number of times a CPU failed to obtain a read/write lock on the first try
|
syscl
|
Number of system calls
|
usr
|
Percentage of CPU cycles spent on user processes
|
sys
|
Percentage of CPU cycles spent on system processes
|
wt
|
Percentage of CPU cycles spent waiting on event
|
idl
|
Percentage of unused CPU cycles or idle time when the CPU is basically doing nothing
|
2.4.2.2 What to look for
(1) Involuntary context switches(this is probably the more relevant statistic when examining performanceissues.)
(2) Number of times a CPU failed toobtain a mutex. Values consistently greater than 200 per CPU causes system timeto increase.
(3) xcal is very important, showprocessor migration
2.4.3 oswnetstat
_netstat_YY.MM.DD:HH24.dat
These files willcontain output from the 'netstat' command that is obtained and archive byOSWatcher Black Box at specified intervals. These files will only existif 'netstat' is installed on the OS and if the OSWbb user has privileges to runthe utility.
The netstat commanddisplays current TCP/IP network connections and protocol statistics.
--netstat 命令显示当前网络连接和协议的相关统计信息。
The netstatutility is standard across UNIX platforms. Each platform will have a slightlydifferent version of the netstat utility. You should consult your operatingsystem man pages for specifics. The sample provided below is for Solaris.
OSWbb runs thenetstat utility at the specified interval and stores the data in the oswnetstatsubdirectory under the archive directory. The data is stored in hourly archivefiles. Each entry in the file contains a timestamp prefixed by *** embedded inthe netstat output. Notice there are 3 entries for each timestamp. You shouldalways ignore the first entry as this entry is always invalid. The second andthird entry will be valid but the second entry will be 1 sec later than thetimestamp and the third entry will be 2 seconds later than the timestamp.
The netstatutility has many command line flags, and the most commonly used to troubleshootRAC is "ia(n)" for the interface level output and "s" forthe protocol level statistics. The following are examples for the two differentcommand parameters.
--netstat命令有写命令标记,常用来解决RAC 问题的是 ian 三个。 其含义如下:
The command line options "-ain"have these effects:
Option
|
Description
|
-a
|
The command output will use the logical names of the interface. It will also report the name of the IP address found through normal IP address resolution methods.
|
-i
|
This triggers the Interface specific statistics, the columns of which are outlined in table [bla-KR]
|
-n
|
This causes the output to use IP addresses instead of the resolved names
|
Example netstat file produced by OSWbb:
--输出示例,这里省略了大部分内容
Sample netstat file produced by OSWbb
|
***Fri Jan 28 12:50:36 EST 2005
|
Name
|
Mtu
|
Net/Dest
|
Address
|
Ipkts
|
Ierrs
|
Opkts
|
Oerrs
|
Collis
|
Queue
|
lo0
|
8232
|
127.0.0.0
|
127.0.0.1
|
296065
|
0
|
296065
|
0
|
0
|
0
|
eri0
|
1500
|
138.1.140.0
|
138.1.140.96
|
|
0
|
176244
|
2
|
191951
|
0
|
RAWIP
|
|
|
|
|
|
|
|
|
rawipInDatagrams
|
=
|
0
|
|
rawipInErrors
|
=
|
0
|
|
rawipInCksumErrs
|
=
|
0
|
|
rawipOutDatagrams
|
=
|
0
|
|
rawipOutErrors
|
=
|
0
|
|
|
|
|
UDP
|
|
|
|
|
|
|
|
|
udpInDatagrams
|
=
|
295719
|
|
udpInErrors
|
=
|
0
|
|
udpOutDatagrams
|
=
|
295671
|
|
udpOutErrors
|
=
|
0
|
TCP
|
|
|
|
|
|
|
|
|
tcpRtoAlgorithm
|
=
|
4
|
|
tcpRtoMin
|
=
|
400
|
|
tcpRtoMax
|
=
|
60000
|
|
tcpMaxConn
|
=
|
-1
|
IPv4
|
….
|
|
|
|
|
|
|
|
ipForwarding
|
=
|
2
|
|
ipDefaultTTL
|
=
|
255
|
|
ipInReceives
|
=
|
17858585
|
|
ipInHdrErrors
|
=
|
0
|
ICMPv4
|
|
|
|
|
|
|
|
|
icmpInMsgs
|
=
|
17624914
|
|
icmpInErrors
|
=
|
0
|
|
icmpInCksumErrs
|
=
|
0
|
|
icmpInUnknowns
|
=
|
0
|
|
icmpInDestUnreachs
|
=
|
72
|
|
icmpInTimeExcds
|
=
|
0
|
IGMP:
|
|
|
|
|
2490
|
|
messages received
|
|
0
|
|
messages received with too few bytes
|
|
0
|
|
messages received with bad checksum
|
|
2490
|
|
membership queries received
|
|
0
|
|
membership queries received with invalid field(s)
|
|
0
|
|
membership reports received
|
|
0
|
|
membership reports received with invalid field(s)
|
|
0
|
|
membership reports received for groups to which we belong
|
|
|
|
|
|
0
|
|
membership reports sent
|
|
|
2.4.3.1 Field Descriptions:
The netstatoutput produced by OSWbb contains 2 sections. The first section containsinformation about all the network interfaces. The second section containsinformation about per-protocol statistics.
--netstat 输出包含两种类型,第一种包含所有network interfaces 的信息,第二种包含每个protocal 的统计信息。
(1)Section 1: Netstat -ain
Field
|
Description
|
name
|
Device name of interface
|
Mtu
|
Maximum transmission unit
|
Net
|
Network Segment Address
|
address
|
Network address of the device
|
ipkts
|
Input packets
|
Ierrs
|
Input errors
|
opkts
|
Output Packets
|
Oerrs
|
Output errors
|
collis
|
Collisions
|
queue
|
Number in the Queue
|
(2)Section 2: Protocol Statistics
The per-protocol statistics can be dividedinto several categories:
--per-protocal 统计信息可以分成如下几类:
(1) RAWIP (raw IP) packets
(2) TCP packets
(3) IPv4 packets
(4) ICMPv4 packets
(5) IPv6 packets
(6) ICMPv6 packets
(7) UDP packets
(8) IGMP packet
Each protocoltype has a specific set of measures associated with it. Network analysisrequires evaluation of these measurements on an individual level and alltogether to examine the overall health of the network communications.
The TCP protocolis used the most in Oracle database and applications. Some implementations forRAC use UDP for the interconnect protocol instead of TCP. The statistics cannotbe divided up on a per-interface basis, so these should be compared to the"-i" statistics above.
2.4.3.1 What to look for: --注意内容
(1)Section 1
The informationin Section 1 will help diagnose network problems when there is connectivity butresponse is slow.
--这种类型的数据可以用来诊断网络连接正常,但是反应慢的情况:
Values to look at:
(1) Collisions (Collis)
(2) Output packets (Opkts)
(3) Input errors (Ierrs)
(4) Input packets (Ipkts)
The above values will give information toworkout network collision rates as follows:
1)Network collision rate = Output collision / Output packets
For a switchednetwork, the collisions should be 0.1 percent or less (see the Cisco web site as a reference) of the output packets.Excessive collisions could lead to the switch port the interface is pluggedinto to segment, or pull itself off-line, amongst other switch-related issues.
2)For the input error statistics:
Input Error Rate = Ierrs / Ipkts.
If the inputerror rate is high (over 0.25 percent), the host is excessively droppingpackets. This could mean there is a mismatch of the duplex or speed settings of the interface card and switch. It could also imply a failedpatch cable.
If ierrs oroerrs show an excessive amount of errors, more information can be found byexamination of the netstat -s output.
For Sun systems,further information about a specific interface can be found by using the"-k" option for netstat. The output will give fuller statistics forthe device, but this option is not mentioned in the netstat man page. Moreinformation can be found at http://sunsolve.sun.com.
(2)Section 2
The informationin Section 2 contains the protocol statistics.
Many performanceproblems associated with the network involve the retransmission of the TCPpackets. For retransmission rate calculations click here.
To find the segment retransmission rate:
%segment-retrans=(tcpRetransSegs /tcpOutDataSegs) * 100
To find the byte retransmission rate:
%byte-retrans = ( tcpRetransBytes /tcpOutDataBytes ) * 100
Most networkanalyzers report TCP retransmissions as segments (frames) and not in bytes.
2.4.4 oswprvtnet
_prvtnet_YY.MM.DD:HH24.dat
These files willcontain output from the 'prvtnet' command that is obtained and archived byOSWatcher Black Box at specified intervals. These files will only existif 'prvtnet' is installed on the OS and if the OSWbb user has privileges to runthe utility.
--这个文件包含prvtnet 命令收集的信息。
Informationabout the status of RAC private networks should be collected. This requires theuser to manually add entries for these private networks into the private.netfile located in the base oswbb directory. Instructions on how to do this arecontained in the README file.
--如果是RAC private network的信息,那么需要在private.net 文件里添加相关的内容。这个前面有示例。
OSWbb uses thetraceroute command to obtain the status of these private networks. Eachoperating system uses slightly different arguments to the traceroute command.Examples of the syntax to use for each operating system are contained in the sampleExample private.net file located in the base oswbb directory. This will resultin the output appearing differently across UNIX platforms. OSWbb runs theprivate.net file at the specified interval and stores the data in theoswprvtnet subdirectory under the archive directory. The data is stored inhourly archive files. Each entry in the file contains a timestamp prefixed by*** embedded in the top output.
Sample file produced by OSWbb
|
***Fri Jan 28 12:50:36 EST 2005
|
traceroute to celdecclu2.us.oracle.com (138.2.71.112): 1-30 hops
(initial packetsize = 1500)
1 celdecclu2.us.oracle.com (138.2.71.112) 1.95ms 2.92 ms 1.95 ms
|
|
2.4.4.1 What to Look For
Example 1: Interface is up andresponding:
traceroute toX.X.X.X, (X.X.X.X) 30 hops max, 1492 byte packets
1 X.X.X.X 1.015 ms 0.766 ms 0.755 ms
Example 2: Target interface is not ona directly connected network, so validate that the address is correct or theswitch it is plugged in is on the same VLAN (or other issue):
traceroute to X.X.X.X, (X.X.X.X) 30 hopsmax, 40 byte packets
traceroute: host X.X.X.X is not on a directly-attached network
Example 3: Network is unreachable:
traceroute to X.X.X.X, (X.X.X.X) 30 hopsmax, 40 byte packets
Network is unreachable
2.4.5 oswps
_ps_YY.MM.DD:HH24.dat
These files willcontain output from the 'ps' command that is obtained and archive by OSWatcherBlack Box at specified intervals. These files will only exist if 'ps' isinstalled on the OS and if the OSWbb user has privileges to run the utility.
--这个文件包含ps命令的输出信息。
The ps (processstate) command list all the processes currently running on the system andprovides information about CPU consumption, process state, priority of theprocess, etc. The ps command has a number of options to control which processesare displayed, and how the output is formatted. OSWbb runs the ps command withthe -elf option.
The ps commandis fairly standard across UNIX platforms Each platform will have a slightlydifferent version of the ps utility. You should consult your operating systemman pages for specifics. The sample provided below is for Solaris.
OSWbb runs theps command at the specified interval and stores the data in the oswps subdirectoryunder the archive directory. The data is stored in hourly archive files. Eachentry in the file contains a timestamp prefixed by *** embedded in the psoutput.
Sample ps file produced by OSWbb
|
***Wed Feb 2 09:26:54 EST 2005
|
F
|
S
|
UID
|
PID
|
PPID
|
C
|
PRI
|
NI
|
ADDR
|
SZ
|
WCHAN
|
STIME
|
TTY
|
TIME
|
CMD
|
19
|
T
|
root
|
0
|
0
|
0
|
0
|
SY
|
?
|
0
|
|
Jan 31
|
?
|
0:13
|
sched
|
8
|
S
|
root
|
1
|
0
|
0
|
41
|
20
|
?
|
107
|
?
|
Jan 31
|
?
|
0:00
|
/etc
|
19
|
S
|
root
|
2
|
0
|
0
|
0
|
SY
|
?
|
0
|
?
|
Jan 31
|
?
|
0:00
|
page
|
19
|
S
|
root
|
3
|
0
|
0
|
0
|
SY
|
?
|
0
|
?
|
Jan 31
|
?
|
0:50
|
fsflu
|
8
|
S
|
root
|
355
|
1
|
0
|
41
|
20
|
?
|
232
|
?
|
Jan 31
|
?
|
0:00
|
/usr/
|
8
|
S
|
root
|
297
|
296
|
0
|
41
|
20
|
?
|
379
|
?
|
Jan 31
|
?
|
0:00
|
htt_s
|
8
|
S
|
cedavis
|
391
|
381
|
0
|
89
|
20
|
?
|
301
|
?
|
Jan 31
|
?
|
0:00
|
/usr/
|
|
2.4.5.1 Field Descriptions
Field
|
Description
|
f
|
Flags s State of the process
|
uid
|
The effective user ID number of the process
|
pid
|
The process ID of the process
|
ppid
|
The process ID of the parent process.
|
d
|
Processor utilization for scheduling (obsolete).
|
pri
|
The priority of the process.
|
ni
|
Nice value, used in priority computation.
|
addr
|
The memory address of the process.
|
sz
|
The total size of the process in virtual memory, including all mapped files and devices, in pages.
|
wchan
|
The address of an event for which the process is sleeping (if blank, the process is running).
|
stime
|
The starting time of the process, given in hours, minutes, and seconds.
|
tty
|
The controlling terminal for the process (the message ?, is printed when there is no controlling terminal).
|
time
|
The cumulative execution time for the process.
|
cmd
|
The command name process is executing.
|
2.4.5.2 What to look for
The informationin the ps command will primarily be used as supporting information for RACdiagnostics. If for example, the status of a process prior to a system crashmay be important for root cause analysis. The amount of memory a process isconsuming is another example of how this data can be used.
2.4.6 oswtop
_top_YY.MM.DD:HH24.dat
These files willcontain output from the 'top' command that is obtained and archive by OSWatcherat specified intervals. These files will only exist if 'top' is installedon the OS and if the OSWbb user has privileges to run the utility.
--这个文件包含top命令的信息。
Top is a programthat will give continual reports about the state of the system, including a listof the top CPU using processes. Top has three primary design goals:
(1) provide an accurate snapshot ofthe system and process state,
(2) not be one of the top processesitself,
(3) be as portable as possible.
Each operatingsystem uses a different version of the UNIX utility top. This will result inthe top output appearing differently across UNIX platforms. You should consultyour operating system man pages for specifics. The sample provided below is forSolaris.
OSWbb runs thetop utility at the specified interval and stores the data in the oswtopsubdirectory under the archive directory. The data is stored in hourly archivefiles. Each entry in the file contains a timestamp prefixed by *** embedded inthe top output.
Sample top file produced by OSWbb
|
***Fri Jan 28 12:50:36 EST 2005
load averages: 0.11, 0.07, 0.06 12:50:36
136 processes: 133 sleeping, 2 running, 1 on cpu
Memory: 2048M real, 1061M free, 542M swap in use, 1605M swap free
|
PID
|
USERNAME
|
THR
|
PRI
|
NICE
|
SIZE
|
RES
|
STATE
|
TIME
|
CPU
|
COMMAND
|
704
|
cedavis
|
16
|
49
|
0
|
346M
|
276M
|
sleep
|
222:33
|
3.51%
|
java
|
362
|
root
|
1
|
59
|
0
|
34M
|
75M
|
sleep
|
11:49
|
0.21%
|
Xsun
|
20675
|
cedavis
|
1
|
0
|
0
|
1584K
|
1064K
|
cpu
|
0:00
|
19%
|
top
|
20640
|
cedavis
|
1
|
0
|
0
|
1904K
|
1240K
|
sleep
|
0:00
|
0.14%
|
OSWatcher.sh
|
20657
|
cedavis
|
1
|
20
|
0
|
1904K
|
1240K
|
sleep
|
0:00
|
0.14%
|
oswsub.sh
|
16881
|
cedavis
|
1
|
59
|
0
|
199M
|
159K
|
sleep
|
23:04
|
0.10%
|
oracle
|
20671
|
cedavis
|
1
|
0
|
0
|
1904K
|
1240K
|
run
|
0:00
|
0.09%
|
oswsub.sh
|
20653
|
cedavis
|
1
|
0
|
0
|
1904K
|
1240K
|
sleep
|
0:00
|
0.09%
|
OSWatcherFM.sh
|
20665
|
cedavis
|
1
|
0
|
0
|
1904K
|
1240K
|
sleep
|
0:00
|
0.09%
|
oswsub.sh
|
20672
|
cedavis
|
1
|
0
|
0
|
1264K
|
1031K
|
sleep
|
0:00
|
0.09%
|
iostat
|
20659
|
cedavis
|
1
|
10
|
0
|
1904K
|
1240K
|
sleep
|
0:00
|
0.09%
|
oswsub.sh
|
20661
|
cedavis
|
1
|
30
|
0
|
1096K
|
880K
|
sleep
|
0:00
|
0.09%
|
vmstat
|
20668
|
cedavis
|
1
|
0
|
0
|
1904K
|
1240K
|
run
|
0:00
|
0.05%
|
oswsub.sh
|
20674
|
cedavis
|
1
|
0
|
0
|
968K
|
624K
|
sleep
|
0:00
|
0.05%
|
sleep
|
20663
|
cedavis
|
1
|
20
|
0
|
1080K
|
864K
|
sleep
|
0:00
|
0.05%
|
mpstat
|
|
2.4.6.1 Field Descriptions
(1)load averages: 0.11, 0.07, 0.0612:50:36
This linedisplays the load averages over the last 1, 5 and 15 minutes as well as thesystem time. This is quite handy as top basically includes a timestamp alongwith the data capture.
Load average isdefined as the average number of processes in the run queue. A runnable Unixprocess is one that is available right now to consume CPU resources and is notblocked on I/O or on a system call. The higher the load average, the more workyour machine is doing.
The threenumbers are the average of the depth of the run queue over the last 1, 5, and15 minutes. In this example we can see that .11 processes were on the run queueon average over the last minute, .07 processes on average on the run queue overthe last 5 minutes, etc. It is important to determine what the average load ofthe system is through benchmarking and then look for deviations. A dramaticrise in the load average can indicate a serious performance problem.
(2)136 processes: 133 sleeping, 2running, 1 on cpu
This linedisplays the total number of processes running at the time of the last update.It also indicates how many Unix processes exist, how many are sleeping (blockedon I/O or a system call), how many are stopped (someone in a shell hassuspended it), and how many are actually assigned to a CPU. This last numberwill not be greater than the number of processors on the machine, and the valueshould also correlate to the machine's load average provided the load averageis less than the number of CPUs. Like load average, the total number ofprocesses on a healthy machine usually varies just a small amount over time.Suddenly having a significantly larger or smaller number of processes could bea warning sign.
(3)Memory: 2048M real, 1061M free,542M swap in use, 1605M swap free
The"Memory:" line is very important. It reflects how much real and swapmemory a computer has, and how much is free. "Real" memory is theamount of RAM installed in the system, a.k.a. the "physical" memory."Swap" is virtual memory stored on the machine's disk.
Once a computerruns out of physical memory, and starts using swap space, its performancedeteriorates dramatically. If you run out of swap, you'll likely crash yourprograms or the OS.
(4)Individual process fields
Field
|
Description
|
PID
|
Process ID of process
|
USERNAME
|
Username of process
|
THR
|
Process thread PRI Priority of process
|
NICE
|
Nice value of process
|
SIZE
|
Total size of a process, including code and data, plus the stack space in kilobytes
|
RES
|
Amount of physical memory used by the process
|
STATE
|
Current CPU state of process. The states can be S for sleeping, D for uninterrupted, R for running, T for stopped/traced, and Z for zombied
|
TIME
|
The CPU time that a process has used since it started
|
%CPU
|
The CPU time that a process has used since the last update
|
COMMAND
|
The task's command name
|
2.4.6.2 What to Look For
(1) Large run queue. Large numberof processes waiting in the run queue may be an indication that your systemdoes not have sufficient CPU capacity.
(2) Process consuming lots of CPU.A process which is "hogging" CPU is always suspect. If this processis an oracle foreground process it's most likely running an expensive querythat should be tuned. Oracle background process should not hog CPU for longperiods of time.
(3) High load averages. Processesshould not be backed up on the run queue for extended periods of time.
(4) Low swap space. This is anindication you are running low on memory.
2.4.7 oswvmstat
_vmstat_YY.MM.DD:HH24.dat
These files willcontain output from the 'vmstat' command that is obtained and archive byOSWatcher Black Box at specified intervals. These files will only existif 'vmstat' is installed on the OS and if the OSWbb user has privileges to runthe utility.
--这个文件包含vmstat 命令的内容。
The name vmstatcomes from "report virtual memory statistics". The vmstatutility does a bit more than this, though. In addition to reporting virtualmemory, vmstat reports certain kernel statistics about processes, disk, trap,and CPU activity.
The vmstatutility is fairly standard across UNIX platforms. Each platform will have aslightly different version of the vmstat utility. You should consult youroperating system man pages for specifics. The sample provided below is forSolaris.
OSWbb runs thevmstat utility at the specified interval and stores the data in the oswvmstatsubdirectory under the archive directory. The data is stored in hourly archivefiles. Each entry in the file contains a timestamp prefixed by *** embedded inthe vmstat output. Notice there are 3 entries for each timestamp. You shouldalways ignore the first entry as this entry is always invalid. The second andthird entry will be valid but the second entry will be 1 sec later than thetimestamp and the third entry will be 2 seconds later than the timestamp.
Sample vmstat file produced by OSWbb
|
***Fri Jan 28 12:50:36 EST 2005
|
procs
|
memory
|
page
|
disk
|
faults
|
cpu
|
r
|
b
|
w
|
swap
|
free
|
re
|
mf
|
pi
|
po
|
fr
|
de
|
sr
|
dd
|
f0
|
s0
|
|
in
|
sy
|
cs
|
us
|
sy
|
id
|
0
|
0
|
0
|
1761344
|
1246520
|
1
|
6
|
0
|
0
|
0
|
0
|
0
|
2
|
0
|
0
|
0
|
380
|
1364
|
900
|
4
|
1
|
95
|
0
|
0
|
0
|
1643920
|
1086776
|
331
|
1485
|
8
|
16
|
16
|
0
|
0
|
31
|
0
|
0
|
0
|
447
|
4966
|
1315
|
15
|
31
|
54
|
0
|
0
|
0
|
1643872
|
1086728
|
6
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
389
|
1472
|
932
|
0
|
0
|
100
|
|
2.4.7.1 Field Descriptions
The vmstatoutput is actually broken up into six sections: procs, memory, page, disk,faults and CPU. Each section is outlined in the following table.
Field
|
Description
|
PROCS
|
r
|
Number of processes that are in a wait state and basically not doing anything but waiting to run
|
b
|
Number of processes that were in sleep mode and were interrupted since the last update
|
w
|
Number of processes that have been swapped out by mm and vm subsystems and have yet to run
|
MEMORY
|
swap
|
The amount of swap space currently available free The size of the free list
|
PAGE
|
re
|
page reclaims
|
mf
|
minor faults
|
pi
|
kilobytes paged in
|
po
|
kilobytes paged out
|
fr
|
kilobytes freed
|
de
|
anticipated short-term memory shortfall (Kbytes)
|
sr
|
pages scanned by clock algorithm
|
DISK
|
Bi
|
Disk blocks sent to disk devices in blocks per second
|
FAULTS
|
In
|
Interrupts per second, including the CPU clocks
|
Sy
|
System calls
|
Cs
|
Context switches per second within the kernel
|
CPU
|
Us
|
Percentage of CPU cycles spent on user processes
|
Sy
|
Percentage of CPU cycles spent on system processes
|
Id
|
Percentage of unused CPU cycles or idle time when the CPU is basically doing nothing
|
2.4.7.2 What to look for
The followinginformation should be used as a guideline and not considered hard and fastrules. The information documented below comes from Adrian Cockcroft's book, SunPerformance Tuning. Other operating systems like HP and Linux may havedifferent thresholds.
(1) Large run queue. AdrianCockcroft defines anything over 4 processes per CPU on the run queue as thethreshold for CPU saturation. This is certainly a problem if this last for anylong period of time.
(2) CPU utilization. The amount oftime spent running system code should not exceed 30% especially if idle time isclose to 0%.
(3) A combination of large runqueue with no idle CPU is an indication the system has insufficient CPUcapacity.
(4) Memory bottlenecks aredetermined by the scan rate (sr) . The scan rate is the pages scanned by theclock algorithm per second. If the scan rate (sr) is continuously over 200pages per second then there is a memory shortage.
(5) Disk problems may be identifiedif the number of processes blocked exceeds the number of processes on runqueue.
三. 配置OS Watcher 自启动
MOS:How To Start OSWatcher Black Box Every System Boot [ID 580513.1]
Oracle supportoften recommends that the OSWatcher Black Box(*) tool be run for an extendedperiod. Should the system reboot during this time, the systemadministrator must manually restart the OSWatcher, and allow it to run untilthe necessary data have been collected.
--OSW收集的信息越多,更有利用与系统的分析,所以我们可以设置OSW的自启动。
To automate thisprocedure, a simple shell script can be used. Care must be taken to avoidaccidentally overwriting the log data upon a restart. The scriptmust also ensure that the OSWatcher tool be run using the correct userprivileges.
--让OSW 自启动可以通过脚本来实现,但是要注意的问题就是要避免在故障启动后对原来日志的覆盖,因为这些数据对分析很重要,如果在OSW自动启
动时覆盖了这些历史数据,就不能帮助我们分析问题。
osw-service 包可以从MOS上下载,也可以从我的CSDN下载:
http://download.csdn.net/detail/tianlesoftware/4109807
Theosw-service RPM package provides a script to run the OSWatcher at system boot,and to stop it down gracefully at system shutdown. It provides an"osw" service that can be controlled using the standardLinux init(1) script controls:
--osw-service RPM 包提供了脚本让系统重启时运行OSWaterch,并且在系统shutdown时gracefully的stop。这个包提供了一个osw的服务来控制linux init(1)脚本:
# /sbin/chkconfig osw on
# /sbin/service osw start
The osw-service RPMpackage is available as an attachment to this note. Download and installit as any other RPM package. A source RPM is provided for completeness.
[root@rac1 OS Watcher Tool]# rpm -ivhosw_service_0_0_2_1_noarch.rpm
Preparing... ########################################### [100%]
1:osw-service ########################################### [100%]
Before startingthe service, first change the settings inthe /etc/sysconfig/osw configuration file to fit your situation:
--安装好osw service 后,在启动之前,需要修改/etc/sysconfig/osw的配置,具体如下:
# Set OSWHOME to the directory where yourOSWatcher tools are installed
OSWHOME=/u01/oswbb
# Set OSWINTERVAL to the number of secondsbetween collections
OSWINTERVAL=60
# Set OSRETENTION to the number of hours logs are to be retained
OSWRETENTION=1
# Set OSUSER to the owner of the OSWHOME directory
OSWUSER=oracle
Once this is done, the command:
--修改完毕就可以启动OSWatcher 自启动脚本:
# /sbin/service osw start
注意个问题:
[root@rac1 u01]# service osw start
Starting OSWatcher: bash: line 7:./startOSW.sh: No such file or directory
[FAILED]
因为OSWatcher 在4.0 以后做了修改,这里我们启动时报错,只需要将startOSWbb.sh 复制一份成startOSW.sh 就可以了。
rac1:/u01/oswbb> cp startOSWbb.sh startOSW.sh
will start the OSWatcher tool upon everyboot.
--之后每次系统重启,OSWatcher 都会自动启动。
The OSWatcherlogs will be stored in ${OSWHOME}/archive as normal. Whenthe osw-service is started, anyprior ${OSWHOME}/archive directory will be movedto ${OSWHOME}/archive- first.
--OSWatcher 的log 存储在${OSWHOME}/archive目录下,当osw-service 启动时,任何之前的${OSWHOME}/archive 目录都会先被移到${OSWHOME}/archive-目录,然后启动,这样就避免了日志被覆盖的可能型。
四.OS Watcher Black Box Analyzer安装配置
MOS:OS Watcher Black Box Analyzer User Guide [ID 461053.1]
我们用OSWatcher收集了数据存储到归档里,但是这些文件不利于分析,所以Oracle 提供了OSWbba工具,其可以分析OSWbb收集的数据并用图表展示出来。
OSWbba iswritten in java and requires as a minimum java version 1.4.2 or higher. OSWbbacan run on any Unix X Windows or PC Windows platform. An X Windows environmentis required because OSWbba uses Oracle Chartbuilder which requires it.
--OSWbba 是用java 写的,所以运行OSWbba 至少需要Java1.4.2 的版本。OSWbba 可以运行在任何平台下。
OSWbba parsesall the OSWbb vmstat, iostat and top utility log files contained in an archivedirectory. Once the data is parsed, the user is presented with a commandline menu which has options for both displaying graphs, creating binary giffiles of these graphs, generating an html report containing all the graphs withnarrative on what to look for, and new in this release, the ability toself-analyze the files OSWbb creates.
--OSWbb 通过vmstat,iostat等命令收集数据存放在归档目录里,OSWbba分析这些数据。 数据分析之后,用户就可以通过命令行目录来提取这些数据,可以选择图表或者生成图形的gif 文件,亦或html报告。
也就是说,OSWbba 对OSWbb 收集的数据进行一个图形的展现。
OSWbba is certified to run on the followingplatforms:
--OSWbba 可以在一下平台运行:
(1) AIX
(2) Solaris
(3) HP-UX
(4) Linux
(5) Windows XP
2.1 Installing OSWbba
OSWbba requiresno installation. It comes shipped as a standalone java jar file with OSWbbv4.0.0 and higher.
--OSWbba 不需要安装,其是一个独立的java 包。
2.2 Starting OSWbba
在启动OSWbba 工具之前,必须先安装java 1.4.2 或以上版本。 当然如果安装过了Oracle,那么oracle 安装目录里也有java。
[root@rac1oswbb]# su - oracle
rac1:/home/oracle>java -version
java version"1.6.0_20"
OpenJDK RuntimeEnvironment (IcedTea6 1.9.7) (rhel-1.39.1.9.7.el6-x86_64)
OpenJDK 64-BitServer VM (build 19.0-b09, mixed mode)
--我这里安装的java 是1.6 的版本。
如果使用Oracle的Java,那么需要修改一下环境变量,在Path里添加Java的路径,如:
PATH=$ORACLE_HOME/jdk/bin:$PATH
rac1:/u02/app/oracle/product/11.2.0/db_1/jdk/bin>./java -version
java version "1.5.0_30"
Java(TM) 2 Runtime Environment, StandardEdition (build 1.5.0_30-b03)
Java HotSpot(TM) 64-Bit Server VM (build1.5.0_30-b03, mixed mode)
--我这里的oracle是11.2.0.3,其自带的java 版本是1.5.
运行OSWbba 需要用-i 参数指定input 目录, 这里的目录是OSWbb log归档的全路径。这个归档目录必须和OSWbb 的目录结构相同,其必须包含其他的子目录,如oswvmstat,oswiostat, oswps, oswtop, oswnetstat 等。
--注意这里显示图片需要条用X windows,所以我们要在图形窗口中执行:
[root@rac1 u02]# xhost +
access control disabled, clients canconnect from any host
然后执行如下命令:
rac1:/u01/oswbb> java -jar oswbba.jar -i/u01/oswbb/archive
Starting OSW Black Box Analyzer V4.0
OSWatcher Black Box Analyzer Written byOracle Center of Expertise
Copyright (c) 2012 by Oracle Corporation
Parsing Data. Please Wait...
Parsing file rac1_iostat_12.03.03.2200.dat...
Parsing file rac1_vmstat_12.03.03.2200.dat...
Parsing file rac1_top_12.03.03.2200.dat ...
Parsing Completed.
Enter 1 to Display CPU Process Queue Graphs
Enter 2 to Display CPU Utilization Graphs
Enter 3 to Display CPU Other Graphs
Enter 4 to Display Memory Graphs
Enter 5 to Display Disk IO Graphs
Enter 6 to Generate All CPU Gif Files
Enter 7 to Generate All Memory Gif Files
Enter 8 to Generate All Disk Gif Files
Enter L to Specify Alternate Location ofGif Directory
Enter T to Specify Different Time Scale
Enter D to Return to Default Time Scale
Enter R to Remove Currently DisplayedGraphs
Enter P to Generate A Profile
Enter A to Analyze Data
Enter Q to Quit Program
Please Select an Option:2
这里按Q退出OSWbba。
相关分析的图形结果如下:
上面是在交互模式下进行,也可以使用命令行执行:
java -jar oswbba.jar -i -P -L -6 -7-8 -B -E
这里的参数,在上面有说明,6,7,8 是生成图片。
OSWbba parsesall the archive files in memory prior to generating graphs or performing ananalysis. If you have a large amount of files to parse you may need to allocatemore memory in the java heap. If you experience any error messages regardingout of memory such as java.lang.OutOfMemoryError, you may have to increase thesize of the java heap. To increase the size of the java heap use the -Xmx flag.
--OSWbba 解析所有的归档文件在内存中进行,然后生成图表,如果有大量的文件需要解析,可以指定java heap 大小。
$java -jar -Xmx512M OSWbba.jar -i /u01/oswbb/archive
Starting OSWbba V4.0.0
OSWatcher Black Box Analyzer Written by Oracle Center of Expertise
Copyright (c) 2012 by Oracle Corporation
Parsing Data. Please Wait...
OSWatcher(包括:[视频]) (文档 ID 1526578.1)
|
|
|
|
|
REFERENCE
|
|
PUBLISHED
|
|
2015-1-13
|
|
2015-6-23
|
|
English简体中文日本語???
|
|
|

文档内容
适用于:
Oracle Database - Enterprise Edition - 版本 6.0.0.0 和更高版本
Oracle Database - Personal Edition - 版本 7.1.4.0 和更高版本
Oracle Database - Standard Edition - 版本 7.0.16.0 和更高版本
本文档所含信息适用于所有平台
经证明,OSWatcher Black Box 可在 AIX、Solaris、HP-UX 和 Linux 上运行。
对于 Windows,推荐使用 Cluster Health Monitor。请参阅 Document 736752.1 了解更多信息。
用途
本文档旨在为 OSWatcher 收集的数据提供一个参考,同时介绍如何安装、运行和使用 OSWatcher 。
适用范围
目标受众:所有数据库管理员。
详细信息
OSWatcher 简介
OSWatcher (oswbb) 是一个可供用户下载的工具,可以用来抓取操作系统的性能指标。
作为性能诊断数据搜集最佳实践的一部分,安装和运行 oswbb 可以帮助 Oracle 技术支持和开发更快解决您的SR。
oswbb 由两个部分组成:
1. oswbb: 一个 unix 操作系统的 shell script,来搜集和存储数据。
2. oswbba: 一个 java 工具来自动分析数据,提供建议,并且生成一个包含图形的 html 文档。
这些组件都包含在一个可供下载的 tar 文件中。
OSWatcher 下载
点击以下链接来下载 OSWatcher
OSWatcher 用户手册
以下每个文档都包含一个用户手册,来介绍产品特性及安装使用说明。可以通过以下链接访问用户手册:
这个工具将会和 Exadata 中包含的 OSWatcher 版本区分开来。
注意:如果点击下载链接之后没有下载窗口弹出,您可能需要清理您的 web 浏览器的缓存,并且/或者重启您的 web 浏览器。
版本:最新版本 7.3.2 2014年9月17日
我们强烈建议所有的用户都升级到7.1版本,因为之前的版本上有一个 bug 会造成收集快照间隔随时间增长。
Release (7.3.2)解决了一个无害的bug..
Release (7.3.1) 解决了oswifconfig目录内的文件不能自动删除的问题. Analyzer解决了一个只有3个设备被列出在iostat的结果里的问题..
Release (7.3)包含了一个解决HP-UX上运行ifconfig相关的bug fix. Analyzer被进一步优化了,减少了分析使用的时间.
Release (7.2)包含了一些bug的fix以及功能增强.新增加了一个oswifconfig的子目录,这个目录包含了使用ifconfig检查网络接口的状态的结果.这在分析RAC相关的问题时尤其有用. 对Analyzer分析IO子系统做了一些增强,尤其是吞吐量. 在分析IO问题或者存储问题时,吞吐量是很有用的. 新版本加入了一些分析IO吞吐量及IO wait的CPU的图.
Release (7.1.3) 修复了一个分析iostat时出现的bug (只影响AIX).
Release (7.1.2) 包含了一个只影响 Solaris 用户的修复,用 prstat 替换 top 命令。
Release (7.1) 包含了一系列的补丁修复及功能增强。它修复了一个会造成收集快照间隔随时间增长的 bug。我们强烈建议所有的用户都升级到这个版本。它还包括一些功能增强,比如在分析时可以选择将 archive 中某些特定文件夹排除掉。
Release (7.0.3) 修复了一个 bug,当分析归档数据的子集而使用 -START / -STOP 参数时,需要追加一个-s 参数。/docs/The_Analyzer/oswbba_README.txt 包含了一个使用此语法的例子
Release (7.0.2) 修复了一个用 oswbba 分析早期版本 6 的 ps 输出文件时产生的 bug。
Release (7.0.1) 修复了一个 AIX 分析 top 输出的 bug。
Release (7.0) 可以分析比之前的版本更多的性能指标。可以按照进程分析内存使用,并且增加了按照指定时间窗来分析部分归档数据的功能。
并且,即将在这个版本追加一个功能,使得 Oracle Support 能够自动分析你上传到 SR上 的 oswbb,数据甚至可以在 SR 被分配到一个工程师之前就自动完成分析。
之前的 release (6.0.1) 修复了处理 extras.txt 中空行的问题,和 oswbba的损坏 profile 选项
之前的 release (6.0) 让用户可以自定义需要收集的信息,然后 oswbb 可以定时收集和管理这些信息。这个功能对于收集类似于 PeopleSoft 之类应用程序的信息非常有用。oswbb 提供了 API 扩展接口从而使之可以运行额外的 shell 脚本。同时引入的特性还有在启动时可以指定生成数据(archive)存放的路径,这个路径可以是任何的文件夹或设备。 oswbb analyzer 现在指定可以分析生成数据的某一部分。
版本 (5.2.0.1) 修复了在 AIX 中解释 iostat 输出的一个 bug。
版本 (5.2.0) 修复了一系列 bug,包括 vmstat 的输出间歇性损坏,OSWbba 对内存状态为 unknown 的解释以及其它格式的修复。
版本 (5.1.1) 中的新增功能是允许 Analyzer 拒绝压缩的文件。在以前的版本中,Analyzer 如果在归档中发现压缩的文件就会中止运行。如果需要对归档进行压缩,则应在压缩前对归档运行 Analyzer。
版本 (5.1.0) 中的新增功能是添加了仅适用于 Linux 的附加 nfs 集合,以及适用于 netstat analyzer.network Analyzer 的 bug 修正程序。归档目录现在可以驻留在所有磁盘上。此嵌入式 Analyzer 用于分析 OSWbb 收集的数据,以提供有关系统速度降低、挂起和其他 OS 性能问题的信息。请参阅 Document 461053.1 中包含的“OSWatcher Black Box Analyzer User Guide and Analyzer Overview PDF”部分内容
新增:OSWatcher 教学视频系列
一个名为: "Performance Analysis Using OS Watcher" 的视频 这里 介绍了如何使用OSWatcher分析 OS 性能问题
新增:OSWatcher Analyzer 教学视频系列
相关链接
OSWatcher 现在是可扩展的。你可以增加客户自定义数据搜集到 oswbb 中。查看如何收集类似于 PeopleSoft 之类应用程序的信息可以使用这个文档:
反馈/支持
如果您当前正在使用 Exadata 提供的 OSW 版本,请让您的支持分析人员向开发团队提交一个 bug。
如果您当前正在使用单机版(可在此处下载),在运行 OSWatcher 时遇到未在“User Guide(用户指南)”的“Known Issue(已知问题)”中列出的问题,或者希望提供与 OSWatcher 有关的评论/反馈(包括增强功能的要求),请在我们的社区发帖。
另外,如果您购买了Oracle Linux的Long Term Support,请您开一个 Service Request.
最佳实践
如何主动避免问题发生及做好诊断信息的收集
有些问题是无法预见的,但大部分其它的问题如果及早发现一些征兆其实是可以避免的。同时,如果问题确实发生了,那么收集问题发生时的信息就非常重 要。 OSWatcher 就是一种 support 推荐的收集诊断信息的工具。有关于如何主动避免问题及诊断信息的收集,请参见:
提出问题、获取帮助并分享您对本文章的感受
您愿意与其他 Oracle 客户、Oracle 员工及业内专家深入探讨本主题吗?
单击此处加入讨论,在这里您可以提出问题、获取他人的帮助,以及分享您对本文章的感受。
单击 此处 访问 My Oracle Support Community 页中的“Database Tuning(数据库优化)”部分,查看有关其他文章的讨论和对您有帮助的主题。
参考
NOTE:736752.1 - Introducing Cluster Health Monitor (IPD/OS)
NOTE:461053.1 - OSWatcher Analyzer User Guide
示例 5:这将启动该工具,将进程置于后台运行,允许工具在会话被终止后继续运行,以 60 秒间隔收集数据,将每个小时的数据记录到一个归档文件, 并自动删除10小时前的归档文件。
停止 OSWbb
要停止 OSWbb 实用程序,请从安装 OSWbb 的目录执行 stopOSWbb.sh 命令。这将终止与该工具关联的所有进程。
示例:
诊断数据输出
如上所述,第一次启动 OSWbb 时,它会在 OSWbb 安装目录下创建归档子目录。归档目录包含 7 个子目录,每个数据收集器对应一个。这些目录命名为 oswiostat、oswmpstat、oswnetstat、oswprvtnet、oswps、oswtop 和 oswvmstat。在 7 个 OS 实用程序的每个子目录中,除 oswprvtnet 之外(其取决于是否已配置了私有网络跟踪),其余均将每小时生成一个文件。在 OSWbb 运行过程中,将在每个小时开始时创建一个新文件。该文件将使用以下格式:
通过单击以下链接,可以查看每种类型数据文件的详细信息:
oswiostat
_iostat_YY.MM.DD:HH24.dat
这些文件将包含 'iostat' 命令的输出,结果将由 OSWatcher Black Box 按指定间隔获取和归档。仅当在 OS 上安装了 'iostat',并且 OSWbb 用户具有运行该实用程序的权限时才会有这些文件。请注意不同平台的 iostat 输出的含义是不一样的,这取决于您的具体平台。您应该在您的操作系统上使用 man iostat 来了解各个列的最新最准确的定义描述。
通过观察物理磁盘处于活动状态的时间及其平均传输比率,iostat 命令用于监视系统输入/输出设备负载。据此信息可更改系统配置,以便更好地平衡物理磁盘和适配器之间的输入/输出负载。
iostat 实用程序在 UNIX 平台中相当标准,但是对于支持扩展磁盘统计信息的下面这些平台的确非常有用:AIX、Solaris 和 Linux。此外,每个平台具有的 iostat 实用程序版本将略有差别。有关具体细节,请查阅操作系统的 ManPage。下面提供的示例是针对 Solaris 平台的。
OSWbb 按指定间隔运行 iostat 实用程序,并在归档目录下的 oswiostat 子目录中存储数据。数据存储在每小时归档的文件中。文件中的每个条目都包含一个时间戳,前缀为 ***,嵌入在 iostat 输出中。请注意,每个时间戳对应一个条目。
字段描述
iostat 输出包含所有设备的摘要信息。
关注内容
oswmpstat
_mpstat_YY.MM.DD:HH24.dat
这些文件将包含 'mpstat' 命令的输出,结果将由 OSWatcher Black Box 按指定间隔获取和归档。仅当在 OS 上安装了 'mpstat',并且 OSWbb 用户具有运行该实用程序的权限时才会有这些文件。请注意不同平台的 mpstat 输出的含义是不一样的,这取决于您的具体平台。您应该在您的操作系统上使用 man mpstat 来了解各个列的最新最准确的定义描述。
mpstat 命令收集和显示系统中所有逻辑 CPU 的性能统计信息。
mpstat 实用程序在 UNIX 平台中相当标准,但是,每个平台具有的 mpstat 实用程序版本将略有差别。有关具体细节,请查阅操作系统的 ManPage。下面提供的示例是针对 Solaris 平台的。
OSWbb 按指定间隔运行 mpstat 实用程序,并在归档目录下的 oswmpstat 子目录中存储数据。数据存储在每小时归档的文件中。文件中的每个条目都包含一个时间戳,前缀为 ***,嵌入在 mpstat 输出中。请注意,每个时间戳对应 2 个条目。您应该始终忽略第一个条目,因为该条目始终无效。
字段描述
关注内容
_netstat_YY.MM.DD:HH24.dat
这些文件将包含 'netstat' 命令的输出,结果将由 OSWatcher Black Box 按指定间隔获取和归档。仅当在 OS 上安装了 'netstat',并且 OSWbb 用户具有运行该实用程序的权限时才会有这些文件。请注意不同平台的 netstat 输出的含义是不一样的,这取决于您的具体平台。您应该在您的操作系统上使用 man netstat 来了解各个列的最新最准确的定义描述。
netstat 命令显示当前 TCP/IP 网络连接和协议统计信息。
netstat 实用程序在 UNIX 平台中相当标准,但是,每个平台具有的 netstat 实用程序版本将略有差别。有关具体细节,请查阅操作系统的 ManPage。下面提供的示例是针对 Solaris 平台的。
OSWbb 按指定间隔运行 netstat 实用程序,并在归档目录下的 oswnetstat 子目录中存储数据。数据存储在每小时归档的文件中。文件中的每个条目都包含一个时间戳,前缀为 ***,嵌入在 netstat 输出中。
netstat 实用程序有许多命令行标志,最常用于排除 RAC 故障的是 "ia(n)"(对于接口级别输出)和 "s"(对于协议级别统计信息)。下面是两个不同命令参数的示例。
命令行选项 "-ain" 具有以下效果:
OSWbb 生成的示例 netstat 文件:
字段描述:
OSWbb 生成的 netstat 输出包含两个部分。第一部分包含关于所有网络接口的信息。第二部分包含关于每个协议统计的信息。
第 1 部分:Netstat -ain
第 2 部分:协议统计信息
每个协议统计信息可以分为下面若干类:
每种协议类型都有与之关联的特定度量集。网络分析需要在单个级别对这些度量进 行评估,然后综合来检查网络通信的整体运行状况。
在 Oracle 数据库和应用程序中 TCP 协议使用最多。RAC使用UDP作为私网互联协议,而不使用 TCP。统计信息不能按接口划分,所以这些信息应与上面的 "-i" 统计信息进行比较。
关注内容:
第 1 部分
第 1 部分中的信息有助于诊断网络连接正常,但是响应速度慢的情况下的网络问题。要查看的值
Values to look at:
以上值将提供用于确定网络冲突率的信息,如下所示:
对于交换网络,冲突应该是输出数据包的百分之 0.1 或更少(相关参考信息,请参见 Cisco 网站)。大量的冲突可能会导致接口插入的交换机端口进行分段,或者使自身脱机,以及产生其他交换机相关的问题。
对于输入错误统计信息:
如果输入错误率较高(超过百分之 0.25),则主机会大量丢弃数据包。这可能意味着接口卡和交换机的双向或速度设置存在不匹配。另外还可能存在跳线故障。
如果 ierrs 或 oerrs 显示大量错误,则通过检查 netstat -s 输出可以发现更多信息。
对于 Sun 系统,通过对 netstat 使用 "-k" 选项可以发现有关特定接口的更多信息。输出将提供设备的更完整的统计信息,但是 netstat 的 Manpage 中未介绍此选项。
第 2 部分
第 2 部分中的信息包含协议统计信息。
与网络关联的许多性能问题都涉及 TCP 数据包的重新传输。
要查找段重新传输率:
要查找字节重新传输率:
大多数网络分析器以段数(帧数)报告 TCP 重新传输,而不是字节数。
oswprvtnet
_prvtnet_YY.MM.DD:HH24.dat
用户必须先创建'prvtnet.sh'脚本,这些文件包含了运行'prvtnet.sh'脚本的输出。oswbb 目录下有一个名为 Exampleprivate.net 的模板,作为这个文件应该如何创建的例子。用户应该基于这个模板新创建一个名为 prvtnet.sh 的文件,并且赋予它执行权限。你应该运行./prvtnet.sh 来测试它是否好用。oswbb 在运行其他的数据搜集器的同时来运行这个文件。
应该收集关于 RAC 私有网络状态的信息。这需要用户手动将这些专用网络的条目添加到基本 oswbb 目录中的 private.net 文件。README 文件中包含如何操作的说明。
OSWbb 使用 traceroute 命令获取这些私有网络的状态。每个操作系统对 traceroute 命令使用的参数都略有不同。基本 oswbb 目录中的示例Exampleprivate.net 文件中包含每个操作系统使用的语法。因此,这将导致在 UNIX 平台中的输出显示有所不同。OSWbb 按指定间隔运行 private.net 文件,并在归档目录下的 oswprvtnet 子目录中存储数据。数据存储在每小时归档的文件中。文件中的每个条目都包含一个时间戳,前缀为 ***,嵌入在顶部输出中。
关注内容
oswps
_ps_YY.MM.DD:HH24.dat
这些文件将包含 'ps' 命令的输出,结果将由 OSWatcher Black Box 按指定间隔获取和归档。仅当在 OS 上安装了 'ps',并且 OSWbb 用户具有运行该实用程序的权限时才会有这些文件。请注意不同平台的 ps 输出的含义是不一样的,这取决于您的具体平台。您应该在您的操作系统上使用 man ps 来了解各个列的最新最准确的定义描述。
ps(进程状态)命令列出系统中当前运行的所有进程,并提供关于 CPU 消耗、进程状态、进程优先级等的信息。ps 命令具有很多选项,用以控制显示哪些进程以及如何格式化输出。OSWbb 将 ps 命令与 -elf 选项一起运行。
ps 命令在 UNIX 平台中相当标准,但是,每个平台具有的 ps 实用程序版本将略有差别。有关具体细节,请查阅操作系统的 ManPage。下面提供的示例是针对 Solaris 平台的。
OSWbb 按指定间隔运行 ps 命令并在归档目录下的 oswps 子目录中存储数据。数据存储在每小时归档的文件中。文件中的每个条目都包含一个时间戳,前缀为 ***,嵌入在 ps 输出中。
字段描述
关注内容
oswtop
_top_YY.MM.DD:HH24.dat
这些文件将包含 'top' 命令的输出,结果将由 OSWatcher 按指定间隔获取和归档。仅当在 OS 上安装了 'top',并且 OSWbb 用户具有运行该实用程序的权限时才会有这些文件。请注意不同平台的 top 输出的含义是不一样的,这取决于您的具体平台。您应该在您的操作系统上使用 man top 来了解各个列的最新最准确的定义描述。
Top 是一种程序,用于提供有关系统状态的连续报告,包括使用进程的顶级 CPU 列表。Top 具有以下三个主要设计目标:
每个操作系统使用不同版本的 UNIX 实用程序 top因此,这将导致在 UNIX 平台中的 top 输出显示有所不同。有关具体细节,请查阅操作系统的 ManPage。下面提供的示例是针对 Solaris 平台的。
OSWbb 按指定间隔运行 top 实用程序,并在归档目录下的 oswtop 子目录中存储数据。数据存储在每小时归档文件中。文件中的每个条目都包含一个时间戳,前缀为 ***,嵌入在顶部输出中。
字段描述
此行显示在过去 1、5 和 15 分钟内的负载平均值以及系统时间。这非常方便,因为顶部输出基本包括了时间戳以及数据捕获。
负载平均值定义为运行队列中的平均进程数。可运行的 Unix 进程是指立即可消耗 CPU 资源且在 I/O 或系统调用中不被阻塞的进程。负载平均值越高,表明您的机器正在执行的进程越多。
以上三个数值是在过去 1、5 和 15 分钟内运行队列深度的平均值。在此示例中,我们可以看到在过去一分钟内运行队列中平均有 .11 个进程;在过去 5 分钟内运行队列中平均有 .7 个进程。通过确定基准然后查看偏差来确定系统的平均负载非常重要。负载平均值明显上升时,表明可能存在严重的性能问题。
此行显示在上次更新时正在运行的总进程数。另外,还表明存在多少 Unix 进程、多少进程处于休眠状态(在 I/O 或系统调用中被阻塞)、多少进程被停止(shell 中的某人已经将其暂停),以及多少进程被实际分配给 CPU。最后一个数值将不大于机器上的进程数,该值还应该与机器的负载平均值相关(如果负载平均值小于 CPU 数的话)。与负载平均值类似,正常运行机器上的进程总数在一段时间内通常变化量很小。进程数突然急剧增大或减小,这可能是一个警告信号。
"Memory:"行非常重要。它反映了计算机有多少实际和交换内存,以及多 少处于可用状态。“实际”内存是系统上安装的 RAM 量,也称为“物理”内存。“交换”是机器磁盘上存储的虚拟内存
一旦计算机耗尽物理内存,并开始使用交换空间,其性能会显著下降。如果继续耗 尽了交换空间,则将可能使程序或 OS 崩溃。
关注内容
oswvmstat
_vmstat_YY.MM.DD:HH24.dat
这些文件将包含 'vmstat' 命令的输出,结果将由 OSWatcher Black Box 按指定间隔获取和归档。仅当在 OS 上安装了 'vmstat',并且 OSWbb 用户具有运行该实用程序的权限时才会有这些文件。请注意不同平台的 vmstat 输出的含义是不一样的,这取决于您的具体平台。您应该在您的操作系统上使用 man vmstat 来了解各个列的最新最准确的定义描述。
名称 vmstat 来自 "report virtual memory statistics"(报告虚拟内存统计信息),但是 vmstat 实用程序的功能不止这一点。除了报告虚拟内存,vmstat 还报告关于进程、磁盘、陷阱/中断率和 CPU 活动的某些内核统计信息。
vmstat 实用程序在 UNIX 平台中非常标准,但是,每个平台具有的 vmstat 实用程序版本将略有差别。有关具体细节,请查阅操作系统的 ManPage。下面提供的示例是针对 Solaris 平台的。
OSWbb 按指定间隔运行 vmstat 实用程序,并在归档目录下的 oswvmstat 子目录中存储数据。数据存储在每小时归档文件中。文件中的每个条目都包含一个时间戳,前缀为 ***,嵌入在 vmstat 输出中。
字段描述
vmstat 输出实际分为六个部分:Procs、memory、page、disk、faults 和 CPU。下表中列出了每个部分。
关注内容
以下信息可以作为参考准则,但也不应视为是一成不变的规则。下面说明的信息来自 Adrian Cockcroft 的《Sun Performance Tuning(Sun 性能优化)》一书。HP 和 Linux 等其他操作系统可能具有不同的阈值。
绘制输出图形
示例图形
已知问题
未报告问题。
下载
当前 Unix 版本 7.0 2013年10月25日
通过单击以下文档中提供的下载链接来下载 OSWbb 的最新版本:301137.1。本文档中不再包含下载链接。如果您仍无法下载文件,可以要求我们将文件通过电子邮件发送给您: carl.davis@oracle.com