|
 |
|
Oracle OS watcher (OSWatcher) tips
Oracle Tips by Burleson Consulting |
The new Oracle OS watcher (OSWatcher) reports
CPU, RAM and Network stress, and is a new alternative for monitoring
Oracle servers. OS Watcher complements the
Ion tool for proactive
Oracle monitoring.
Also see my Oracle
file watcher tips.
Oracle does not run in a vacuum, and it’s
important to monitor stress on your server, disk, RAM and network. Oracle
provides several tools for monitoring the external environment, including:
For those who do not have a
license to
access the AWR dba_hist tables (Oracle performance pack), Oracle OS
watcher is a free solution for UNIX/Linux RAC shops:
MetaLink note 301137.1 has the users guide for
Oracle OS Watcher (OSW), a collection of UNIX C shell scripts that
help diagnose server and network bottlenecks. The Oracle OS watcher
is nicknamed OSWatcher, and it is user-configurable, collecting one
hour worth of OS data at one minute intervals, and then writing the
hour’s data to an archive flat file...
Actually the sample interval is configurable down to 1 second as
opposed to one minute. Default value is 30 seconds.
Oracle OS watcher is especially useful for
Linux/UNIX-based RAC systems where monitoring the OS is important
for identifying CPU, RAM or network stress. Oracle OS Watcher may
invoke these popular UNIX/Linux utilities, depending on the platform
(Solaris, HP/UX, Linux and Tru64):
- vmstat
- iostat
- top
- netstat
- traceroute
Starting Oracle OS Watcher
(OSWatcher)
You can start Oracle OS Watcher with this
command, 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 5 minutes
and keep 24 hours of archive files, writing all messages to
oswatcher.log:
nohup
/u01/app/oracle/scripts/startOSW.sh 300 24 & >
/u01/app/oracle/scripts//oswatcher.log
Downloading OSWatcher
You can
download Oracle OSWatcher here:
Using Oracle OS Watcher requires knowledge of
UNIX and Linux C shell commends syntax, but it removes much of the
tedium from OS monitoring for those who are not licensed to use AWR
automatic OS statistics collection.
You can write your own vmstat collection
scripts very easily:
# run
vmstat and direct the output into the Oracle table . . .
cat /tmp/msg$$|sed 1,3d | awk '{ printf("%s %s %s %s %s %s\n", $1,
$8, $9,
14, $15, $16) }' | while read RUNQUE PAGE_IN PAGE_OUT USER_CPU
SYSTEM_CPU
DLE_CPU
do
$ORACLE_HOME/bin/sqlplus -s perfstat/perfstat@testsys1<<EOF
insert into perfstat.stats\$vmstat
values (
sysdate,
$SAMPLE_TIME,
'$SERVER_NAME',
$RUNQUE,
$PAGE_IN,
$PAGE_OUT,
$USER_CPU,
$SYSTEM_CPU,
$IDLE_CPU,
0
);
EXIT
EOF
done
 |
I have exhaustively documented the OS
monitoring on Oracle 10g OEM and AWR in our new book "Oracle
Tuning, the Definitive Reference", highly
recommended.
You can buy it
direct from the publisher for 30% off at the link, and
download a comprehensive code depot of AWR scripts. |
|