您的位置:首页 > 数据库 > Oracle

Oracle OS Watcher 工具 使用详解  

2012-10-31 11:08 489 查看

一.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) 工具说明
/article/1448905.html

二.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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: