10.07.2015 Views

Expert Oracle Exadata - Parent Directory

Expert Oracle Exadata - Parent Directory

Expert Oracle Exadata - Parent Directory

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 12 MONITORING EXADATA PERFORMANCE#!/bin/bash# Name: oswextract.sh# Purpose: Extract a specific metric from OS Watcher cellsrvstat archives## Usage:# ./oswetract.sh "cellsrv metric to grep for" osw_archive_files_of_interest*.dat.bz2## Example:# ./oswextract.sh "Number of latency threshold warnings for redo log writes" \# cell01.example.com_cellsrvstat_11.05.25.*.dat.bz2METRIC=$1shiftbzcat -q $* |egrep "Current Time|$METRIC" |awk 'BEGIN{ printf("%-21s %20s %20s\n", "TIME", "CURRENT_VAL", "CUMULATIVE_VAL") }/Current/{ printf("%s %s %s %s", $3, $4, $5, $6, $7) }/Number of latency threshold warnings for redo log writes/{ printf("%20d %20d\n", $10, $11) }'# end of scriptWhile this script is meant to make extracting the desired metric history out of the OS Watcher logs easier,the main purpose of listing the script in this book is to show how easy extracting historical OS-level (andother) metrics can be. Investing a day into learning basic AWK or Perl text processing will likely pay offand save time when you need to do unconventional monitoring or troubleshooting tasks. Let’s see whatit does:# ./oswextract.sh "Number of latency threshold warnings for redo log writes" \enkcel03.enkitec.com_cellsrvstat_11.05.25.*.dat.bz2 | headTIME CURRENT_VAL CUMULATIVE_VALWed May 25 00:00:03 0 6564Wed May 25 00:00:08 0 6564Wed May 25 00:00:13 0 6564Wed May 25 00:00:18 0 6564Wed May 25 00:00:23 2 6566Wed May 25 00:00:28 0 6566Wed May 25 00:00:33 0 6566Wed May 25 00:00:38 0 6566Wed May 25 00:00:43 0 6566415

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!