OSWatcher安装部署与使用


1. 软件下载与 官方Guide:

OSWatcher (Includes: [Video]) (文档 ID 301137.1)
https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=423419681198373&parent=DOCUMENT&sourceId=461053.1&id=301137.1&_afrWindowMode=0&_adf.ctrl-state=1bkjd4dvqy_102

OSWatcher User Guide
https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=512477130458995&id=1531223.1&_afrWindowMode=0&_adf.ctrl-state=1aew3qvgn6_55

OSWatcher Analyzer User Guide
https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=512476365018468&id=461053.1&_afrWindowMode=0&_adf.ctrl-state=1aew3qvgn6_14


在OSW 4.0 之前是:OSWatcher 和 OSWg的关系。
OSW 4.0 后变成了: OSWbb 与 OSWbba 的关系。
 
这样避免造成名称上的疑惑。OSWbb收集数据,OSWbba 分析数据。


系统性能是一个综合性结果的体现。对最终用户而言,使用系统的体验感可能就是系统是不是跑得快、在规定时间内完成作业、业务高峰期能否快速打开页面。但是,对系统设计、开发和运维人员来讲,系统性能是一个综合性的指标,涉及系统各个组成部分的软硬件配置和运行状态。
 
对于数据库端出现的问题,我们可以使用诸如AWR报告、ASH报告进行全方位的监控和诊断。但是对于操作系统,我们通常需要专门的监控工具,甚至专门的软件。实际上,各个操作系统(AIX、Linux)都提供了一些基本的性能监控检查工具,如topas、iostat等,我们需要做的就是周期性的进行工具调用和数据收集、分析。Oracle提供的免费工具OS Watcher就是这样的利器。

目前官方版本是7.33, 下载后压缩包名为oswbb733.tar

点击(此处)折叠或打开

  1. [oracle@cntlxxx ~]$ cd osw/
  2. [oracle@cntlxxx osw]$ ls -lrt
  3. total 6172
  4. -rw-r--r-- 1 oracle oinstall 6318080 Dec 11 10:51 oswbb733.tar

解压包里包含了所有涉及到的shell脚本,tar解压后可直接使用
  1. [oracle@cntl202 osw]$ tar xvf oswbb733.tar
  2. oswbb/
  3. oswbb/docs/
  4. oswbb/docs/The_Analyzer/
  5. oswbb/docs/The_Analyzer/OSWatcherAnalyzerOverview.pdf
  6. ...(省略部分)...
  7. oswbb/src/
  8. oswbb/src/Thumbs.db
  9. oswbb/src/OSW_profile.htm
  10. oswbb/src/tombody.gif
  11. oswbb/src/missing_graphic.gif
  12. oswbb/src/coe_logo.gif
  13. oswbb/src/watch.gif
  14. oswbb/src/oswbba_input.txt
  15. oswbb/oswrds.sh
  16. [oracle@cntl202 osw]$
  17. [oracle@cntl202 osw]$ cd oswbb

2. 运行程序与 数据收集

OS Watcher的本质就是借助操作系统自身的性能数据收集接口,定期以作业的方式调用程序,并且收集数据。OS Watcher基于的几个常用性能监控程序,如topas,vmstat,iostat。我们调用OS Watcher的时候,一定要注意调用用户的权限情况,要有权限执行这几个程序。
 
开启监控过程,我们需要调用startOSWbb.sh脚本,输入监控时间参数信息之后,监控过程就自动开始了。
 
startOSWbb.sh存在四个参数
参数一: 数据收集间隔(单位秒)
参数二:数据保存期限(单位小时) 用来控制日志文件只保留最后N个小时的信息,这个N由用户配置,默认是48小时。File Manager 每隔一小时被唤醒一次,用来删除超过N小时的日志。
参数三:压缩格式。
参数四:收集收集路径。(默认在 ./archive下)

 
下面是启动脚本 参数说明
  1. [oracle@cntl202 oswbb]$ more startOSWbb.sh
  2. #!/bin/sh

  3. ######################################################################
  4. # Copyright (c) 2005 by Oracle Corporation
  5. # startOSW.sh
  6. # This is the script that starts the OSWatcher program. It accepts 4
  7. # arguments which control the frequency that data is collected and the
  8. # number of hours worth of data to archive.
  9. #
  10. # $1 = snapshot interval in seconds.
  11. # $2 = the number of hours of archive data to store.
  12. # $3 = (optional) the name of the zip or compress utility you want
  13. # OSWbb to use to zip up the archive files upon completion. If
  14. # no zipping is desired set this parameter = NONE. This will
  15. # allow for the $4 parameter below to be recognized as both $3
  16. # and $4 are optional parameters.
  17. # $4 = (optional) the fully qualified name of the archive directory
  18. # where you want oswbb to save your data. This option can be used
  19. # instead of setting the UNIX environment variable OSWBB_ARCHIVE_DEST
  20. # If this parameter is not set oswbb will look for the UNIX
  21. # environment variable OSWBB_ARCHIVE_DEST. If neither are set
  22. # the archive directory will remain in the default location under
  23. # the oswbb directory
  24. #
  25. # If you do not enter any arguments the script runs with default values
  26. # of 30 and 48 meaning collect data every 30 seconds and store the last
  27. # 48 hours of data.
  28. ######################################################################

下面我们尝试启动程序。(收集间隔60秒,持续1小时,gzip压缩,数据存放在/home/oracle/osw/oswbb/archive下

  1. [oracle@cntl202 oswbb]$ ./startOSWbb.sh 60 1 gzip /home/oracle/osw/oswbb/archive
  2. [oracle@cntl202 oswbb]$ Info...Zip option IS specified.
  3. Info...OSW will use gzip to compress files.

  4. Testing for discovery of OS Utilities...
  5. VMSTAT found on your system.
  6. IOSTAT found on your system.
  7. MPSTAT found on your system.
  8. IFCONFIG found on your system.
  9. NETSTAT found on your system.
  10. TOP found on your system.

  11. Testing for discovery of OS CPU COUNT
  12. oswbb is looking for the CPU COUNT on your system
  13. CPU COUNT will be used by oswbba to automatically look for cpu problems

  14. CPU COUNT found on your system.
  15. CPU COUNT = 2

  16. Discovery completed.

  17. Starting OSWatcher v7.3.3 on Fri Dec 11 11:22:46 CST 2015
  18. With SnapshotInterval = 60
  19. With ArchiveInterval = 1

  20. OSWatcher - Written by Carl Davis, Center of Expertise,
  21. Oracle Corporation
  22. For questions on install/usage please go to MOS (Note:301137.1)
  23. If you need further assistance or have comments or enhancement
  24. requests you can email me Carl.Davis@Oracle.com

  25. Data is stored in directory: /home/oracle/osw/oswbb/archive

  26. Starting Data Collection...

 --osw开始收集
  1. oswbb heartbeat:Fri Dec 11 11:22:51 CST 2015
  2. oswbb heartbeat:Fri Dec 11 11:23:51 CST 2015
  3. oswbb heartbeat:Fri Dec 11 11:24:51 CST 2015
  4. oswbb heartbeat:Fri Dec 11 11:25:51 CST 2015
  5. oswbb heartbeat:Fri Dec 11 11:26:51 CST 2015

观察后台进程
  1. [oracle@cntl202 oswbb]$ ps -ef|grep osw
  2. oracle 3819 1 0 11:22 pts/0 00:00:00 /bin/sh ./OSWatcher.sh 60 1 gzip /home/oracle/osw/oswbb/archive
  3. oracle 3909 3819 0 11:22 pts/0 00:00:00 /bin/sh ./OSWatcherFM.sh 1 /home/oracle/osw/oswbb/archive

除了经过设置时间终止监控外,OS Watcher还可以通过stopOSWbb.sh脚本来终止执行

数据均保存在archive目录下
  1. [oracle@cntl202 archive]$ ls -lrt
  2. total 40
  3. drwxr-xr-x 2 oracle oinstall 4096 Dec 11 11:20 oswprvtnet
  4. drwxr-xr-x 2 oracle oinstall 4096 Dec 11 11:20 oswvmstat
  5. drwxr-xr-x 2 oracle oinstall 4096 Dec 11 11:20 oswmpstat
  6. drwxr-xr-x 2 oracle oinstall 4096 Dec 11 11:20 oswnetstat
  7. drwxr-xr-x 2 oracle oinstall 4096 Dec 11 11:20 oswiostat
  8. drwxr-xr-x 2 oracle oinstall 4096 Dec 11 11:20 oswifconfig
  9. drwxr-xr-x 2 oracle oinstall 4096 Dec 11 11:20 oswtop
  10. drwxr-xr-x 2 oracle oinstall 4096 Dec 11 11:20 oswps
  11. drwxr-xr-x 2 oracle oinstall 4096 Dec 11 11:20 oswslabinfo
  12. drwxr-xr-x 2 oracle oinstall 4096 Dec 11 11:20 oswmeminfo

3. OSWBBA 数据分析

OS Watcher的全名为Operation System Watcher Black Box(简称oswbb)。oswbb只负责收集数据,并不能够直接分析结果。Oracle在oswbb 4.0之后,提供了专门的分析图形化工具,oswbba(Operation System Watcher Black Box Analyzer)被加入到oswbb工具包中,对数据可以进行完全的分析和处理。
 
oswbba是一个基于java的软件,要求运行系统中必须安装单独的java程序,并且配置适当的处理空间。由于oswbb是一个纯绿色软件,我们甚至可以把数据拷贝到windows环境上进行处理。

oswbba的处理包oswbba.jar就保存在oswbb目录中。参数-i表示处理的数据目录。此外,我们还有-START和-STOP参数用于执行处理的时间范围。

 
下面是oswbba收集方法
  1. [oracle@cntl202 oswbb]$ java -jar oswbba.jar -i /home/oracle/osw/oswbb/archive

  2. Starting OSW Analyzer V7.3.3
  3. OSWatcher Analyzer Written by Oracle Center of Expertise
  4. Copyright (c) 2014 by Oracle Corporation

  5. Parsing Data. Please Wait...

  6. Scanning file headers for version and platform info...


  7. Parsing file cntl202_iostat_15.12.11.1100.dat ...


  8. Parsing file cntl202_vmstat_15.12.11.1100.dat ...


  9. Parsing file cntl202_netstat_15.12.11.1100.dat ...


  10. Parsing file cntl202_top_15.12.11.1100.dat ...


  11. Parsing file cntl202_ps_15.12.11.1100.dat ...


  12. Parsing Completed.



  13. Enter 1 to Display CPU Process Queue Graphs
  14. Enter 2 to Display CPU Utilization Graphs
  15. Enter 3 to Display CPU Other Graphs
  16. Enter 4 to Display Memory Graphs
  17. Enter 5 to Display Disk IO Graphs

  18. Enter 6 to Generate All CPU Gif Files
  19. Enter 7 to Generate All Memory Gif Files
  20. Enter 8 to Generate All Disk Gif Files

  21. Enter L to Specify Alternate Location of Gif Directory
  22. Enter T to Alter Graph Time Scale Only (Does not change analysis dataset)
  23. Enter D to Return to Default Graph Time Scale
  24. Enter R to Remove Currently Displayed Graphs

  25. Enter A to Analyze Data
  26. Enter S to Analyze Subset of Data(Changes analysis dataset including graph time scale)

  27. Enter P to Generate A Profile
  28. Enter X to Export Parsed Data to File
  29. Enter Q to Quit Program
oswbb是命令行式的结构,通过输入数字或者字母来进行控制。从上面提示中,我们输入1-5数字,就可以显示出对应参数的趋势变化曲线图 (需要调用X11)。6-8选项索性会直接将图像生成.gif格式文件保存下来,方便后续处理。L-Q主要是控制参数,用来修改处理位置和范围。
 
4、结论
 
OS Watcher及其分析工具,是非常方便的性能监控程序。在很多场合下,结合数据库原有的AWR报告,可以让我们更加全面的了解系统瓶颈,优化系统。


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/17086096/viewspace-1870433/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/17086096/viewspace-1870433/

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值