Rumah >pangkalan data >tutorial mysql >OSW监控使用
把下载后的osw.tar文件copy到合适的目录下,然后解压运行对应脚本就可以使用:
建议这个工具部署在root或者非Oracle用户下
1.软件准备,去https://support.oracle.com按照对应版本的oracle下载
2. osw安装与卸载
把下载后的osw.tar文件copy到合适的目录下,然后解压运行对应脚本就可以使用:
tar xvf osw.tar
卸载:只删除解压后的目录
rm -rf osw
3. 启动与停止ows(启动监控脚本)
启动:执行startOSW.sh脚本
配置两个参数:
ARG1 = snapshot interval in seconds. (间隔收集的秒数,默认是30秒)
ARG2 = the number of hours of archive data to store.(数据保留的小时数,默认是48秒)
./startOSW.sh
注:不写参数为默认值
Example 1:每30秒收集一次数据,保留10小时
./startOSW.sh 30 10
Example 2:每60秒收集一次数据,保留48小时,并让进程在后台运行。
nohup ./startOSW.sh 60 48 &
停止:执行startOSW.sh脚本
./stopOSW.sh
4. 生成监控数据,并采集制图
当启动osw后,在安装目录下会生成各种工具采集数据的子目录。
数据文件的格式为:
[root@ora11grac1 archive]# ll
total 36
drwxr-xr-x 2 root root 4096 Mar 28 04:23 oswiostat
drwxr-xr-x 2 root root 4096 Mar 28 04:23 oswmeminfo
drwxr-xr-x 2 root root 4096 Mar 28 04:23 oswmpstat
drwxr-xr-x 2 root root 4096 Mar 28 04:23 oswnetstat
drwxr-xr-x 2 root root 4096 Mar 28 04:23 oswprvtnet
drwxr-xr-x 2 root root 4096 Mar 28 04:23 oswps
drwxr-xr-x 2 root root 4096 Mar 28 04:23 oswslabinfo
drwxr-xr-x 2 root root 4096 Mar 28 04:23 oswtop
drwxr-xr-x 2 root root 4096 Mar 28 04:23 oswvmstat [oracle@tickettwo archive]$ pwd
[root@ora11grac1 archive]# cd oswiostat/
[root@ora11grac1 oswiostat]# ls -l
total 20
-rw-r--r-- 1 root root 20429 Mar 28 04:26 ora11grac1_iostat_14.03.28.0400.dat
5. 安装OSWg
Oswg也是运行的脚本,位于osw安装目录下,,是一个java jar文件:
[root@ora11grac1 osw]# ls oswg.jar
oswg.jar
6. 启动OSWg
启动oswg工具之前,要确保系统上安装的java为1.4.2或更高版本,放心吧正常安装了oracle 软件会自动找到的
查看java版本:
[oracle@ccdb ~]$ which java
/usr/bin/java
[oracle@ccdb ~]$ java -version
java version "1.4.2"
[oracle@ccdb bin]$ export PATH=$ORACLE_HOME/jre/1.4.2/bin:$PATH
[oracle@ccdb bin]$ which java
~/product/10.2.1/db_1/jre/1.4.2/bin/java
[oracle@ccdb bin]$ java -version
java version "1.4.2_08"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_08-b03)
Java HotSpot(TM) Client VM (build 1.4.2_08-b03, mixed mode)
启动osws之前,要先开启vnc工具,如下操作:
[root@ora11grac1 osw]
[root@ora11grac1 osw] java -jar oswg.jar -i /data/osw/archive/
Starting OSWg V3.0.1
OSWatcher Graph Written by OracleCenter of Expertise
Copyright (c) 2008 by Oracle Corporation
Parsing Data. Please Wait...
Parsing file ora11grac1_iostat_14.03.28.0400.dat...
Parsing file ora11grac1_vmstat_14.03.28.0400.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 of Gif Directory
Enter T to Specify Different Time Scale
Enter D to Return to Default Time Scale
Enter R to Remove Currently Displayed Graphs
Enter P to Generate A Profile
Enter Q to Quit Program
Please Select an Option:5