Oracle OS Watcher 工具 使用详解Oracle OS Watcher 工具 使用详解
aix系统netstat命令详解一.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
download.csdn/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 bundledwithOSWbb v4.0.0and 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) 工具说明
blog.csdn/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 issu
es. 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 inclu
ded 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 lastNhours of information are retained,whereNis a configurable integer defaulting to 48. File Manager willwake up once per hour to delete files older thanNhours. At anytime, the entire output file set will consist of one current hour file,plusNarchive files for each data co
llector 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 thei
requivalents, 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 PlatformsOSWbb is certified to run on the followingplatforms:
--OSWbb 支持如下平台:
(1)AIX
(2)Tru64
(3)Solaris
(4)HP-UX
(5)Linux
2.3 Gathering DiagnosticData2.3.1 Installing OSWbbOSWbb 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 OSWbbTo 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, iost
at, 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. An example of what this file should look like is named Exampleprivate with samples for each operating system: solaris, linux, aix, hp,etc. in the oswbb directory. This file can be edited and renamed private ora new file named private 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的可执行文件。 这个文件里的内容可以是用来验证RAC private network的traceroute命令。
下面是Solaris平台下private示例:
Example private entry on Solaris:
traceroute -r -F node1traceroute -r -F node2
Where node1 andnode2 are 2 nodes in addition to the hostnode of a 3 node RAC cluster. If thefile private 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, mpst
at,netstat,andtraceroute.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 la
st 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 前台 和 后台进程 说明
blog.csdn/tianlesoftware/article/details/6165753
2.3.5 Stopping OSWbbTo 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,因为其启动与否决定相关参数是否配置。 每个文件名的格式如下:
<node_name>_<OS_utility>_YY.MM.DD.HH24.dat
rac1:/u01/oswbb> cd archive
rac1:/u01/oswbb/archive> ls
oswiostatoswmeminfo oswmpstat oswnetstatoswprvtnet oswps oswslabinfooswtop 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:
oswiostatoswmpstatoswnetstatoswprvtnetoswpsoswtoposwvmstat
2.4.1 oswiostat<node_name>_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<node_name>_mpstat_YY.MM.DD:HH24.dat
These files willcontain output from the 'mpstat' command that is obtained and archive byOSWatcher Bl
ack 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
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论