Oct 9, 2013

OS Watcher Black Box ( OSWBB) configuration - Oracle tool

Oracle OS watcher is especially useful for UNIX-based OS environments which will monitor the OS to identifying CPU, Memory or Network stress/ bottlenecks.  OS Watcher may invoke these popular UNIX/Linux utilities, depending on the platform (Solaris, HP/UX, Linux and IBM-AIX etc) and gives best output in case node eviction in RAC databases or system restarts. From my experience I will recommend to use by any DBA.

What OS Watcher monitors?

vmstat
iostat
top
netstat
traceroute

-- Starting Oracle OS Watcher (OSWatcher)

You can start Oracle OS Watcher with below command, with specifying the data collection interval (in seconds) and the max number of hours to keep archive files.

In this example we submit the collector as a background job to collect every 1 minute and keep 24 hours of archive files ( can be customized log duration and log retention), writing all messages to oswatcher.log:

Example:
nohup /home/oracle/scripts/oswbb/startOSW.sh 60 24 & > /home/oracle/scripts/oswbb/oswatcher.log

Installation :
1) Download OSwatcher.tar file from Oracle support.
e.g., oswbb701.tar (download from oracle metalink), Choose any higher version
Note: Time to time new osw versions are released.
2) Copy to Oracle DB server of any location
3) Xtract the .tar file
e.g., $ tar -xvf  oswbb701.tar
4) Give full permissions to the OSWBB folder.

Requirement:
1) GUI connection ( for graphical output generation)
2) Below rpm should be installed ( most of cases may not required)
       # rpm -ihv osw-service-0.0.6-1.noarch.rpm
3) software to be downloaded
    oswbb511.tar / oswbb601.tar / any higher version (download from oracle metalink)

Note: Always use OSW higher version

-- To Start OSWBB
$ export PATH=$ORACLE_HOME/jdk/jre/bin:$PATH
$ cd /u01/app/oswbb
$ nohup ./startOSWbb.sh 60 10 &  #1 minute interval and logs will be available for 10 hrs

Note : If you want to keep logs for 48 hours and log interval will be 15 seconds, then follow the below command:
$ nohup ./startOSWbb.sh 15 48 &  # 15 seconds interval and logs will be available for 2 days
OR
$ nohup ./startOSWbb.sh 15 48 /dev/null & > nohup.out ( to make null for nohup)

Cron job:

If you want to start as soon as server re-booted, then you can schedule same in cron job like below:

00 * * * * /u01/app/oswbb/start_oswatcher.sh 1>>/u01/app/oswbb/oswatcher.log 2>&1

$cat /u01/app/oswatcher/oswbb/start_oswatcher.sh
cd /u01/app/oswbb
nohup ./startOSWbb.sh 60 168 gzip &
$
--- To Stop OSWBB
$ export PATH=$ORACLE_HOME/jdk/jre/bin:$PATH
$ cd /u01/app/oswbb
$./stopOSWbb.sh

 -- Generating OSWatcher .html log for specific period:
$ export PATH=$ORACLE_HOME/jdk/jre/bin:$PATH
$ cd /u01/app/oswbb
$ java  -jar  oswbba.jar -i /u01/app/oswbb/archive/ -P osw_rpt  -6 -B JUNE 14 11:00:00 2013 -E JUNE 14 13:00:00 2013

Note: The above java call will generate a graphical based report which will cover 2 hrs data and kept in osw_rpt file.

$ java  -jar  oswbba.jar -i /u01/app/oswbb/archive/ -P osw_rpt  -6 -B JUNE 14 11:00:00 2013 -E JUNE 14 13:00:00 2013

-- To take anyalyze report

$ java  -jar  oswbba.jar -i /u01/app/oswbb/archive/ -P host1_rpt  -6 -B JUNE 15 10:00:00 2013 -E JUNE 15 13:00:00 2013

( Instead of -P , use -A  |<>| P - Profile; A - Analysis )


If you are getting below issues while generating GUI reports, then increase JAVA heap size. Follow the below command:

Issue came when heap memory specified:

$ export PATH=$ORACLE_HOME/jdk/jre/bin:$PATH

$ java -jar oswbba.jar -i /u01/app/oswbb/archive/ -P osw_rpt -6 -B JUN 22 09:00:00 2015 -E JUN 22 09:30:00 2015

 /u01/OSB_Reports/oswbb/javacore.20150622.151439.43122732.0003.txt
 JVMDUMP013I Processed dump event "systhrow", detail "java/lang/OutOfMemoryError".
 Exception in thread "main" java.lang.OutOfMemoryError
          at java.lang.reflect.Array.newArrayImpl(Native Method)
          at java.lang.reflect.Array.newInstance(Array.java:283)
          at java.util.ArrayList.toArray(ArrayList.java:328)
          at o.a(Unknown Source)
          at j.a(Unknown Source)
          at o.a(Unknown Source)
          at OSWGraph.OSWGraph.main(Unknown Source)

Now use below command which will work for you:

$java -jar -Xmx1024M oswbba.jar -i /u01/app/oswbb/archive/ -P osw_example01 -6 -B JUN 25 11:30:00 2013 -E JUN 25 11:45:00 2013

Thanks
Please feel free to post a comment...

3 comments:

  1. Hello, i use OSWatcher and i have the following problem in one of my servers:

    ServerA# java -jar -Xmx512M oswbba.jar -i /u3/oswbb/archive
    .......
    Parsing file serverA_ps_17.03.25.1500.dat ...
    Parsing file serverA_ps_17.03.25.1600.dat ...
    Parsing file serverA_ps_17.03.25.1700.dat ...
    Parsing file serverA_ps_17.03.25.1800.dat ...
    Parsing file serverA_ps_17.03.25.1900.dat ...
    Parsing file serverA_ps_17.03.25.2000.dat ...
    Parsing file serverA_ps_17.03.25.2100.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 Alter Graph Time Scale Only (Does not change analysis dataset)
    Enter D to Return to Default Graph Time Scale
    Enter R to Remove Currently Displayed Graphs
    Enter A to Analyze Data
    Enter S to Analyze Subset of Data(Changes analysis dataset including graph time scale)
    Enter P to Generate A Profile
    Enter X to Export Parsed Data to File
    Enter Q to Quit Program

    Please Select an Option:1
    Exception in thread "main" java.lang.ExceptionInInitializerError
    at G.a(Unknown Source)
    at F.a(Unknown Source)
    at F.a(Unknown Source)
    at g.a(Unknown Source)
    at OSWGraph.OSWGraph.main(Unknown Source)
    Caused by: java.util.MissingResourceException: Can't find bundle for base name oracle.charts.internal.Messages, locale en_US
    at java.util.ResourceBundle.throwMissingResourceException(Unknown Source)
    at java.util.ResourceBundle.getBundleImpl(Unknown Source)
    at java.util.ResourceBundle.getBundle(Unknown Source)
    at an.(Unknown Source)
    ... 5 more

    Its so strange, because if i execute the same sintaxis at my ServerB they work properly. For me there are some mistake in the data collected.

    java.util.MissingResourceException: Can't find bundle for base name oracle.charts.internal.Messages, locale en_US

    I contact with Carl Davis the inventor of OSWatcher, but they don't give me feedback after i explain the problem.

    Thanks for your time and for your work in the blog

    ReplyDelete

Translate >>