Monday, January 13, 2014

How to find old performance statistics in the storage cell ?

In December last year we've finished one testing on the Exadata and go to long holidays ...
... New Year ...

This year customer asked us about the system load during its tests.

Its tests were about a month ago ...

In DB nodes the information was saved by sar which save the history for the last 30 days.
But in the storage cell we got:

[root@ed01cel02 ~]# sar -f /var/log/sa/sa30 -u -s 15:48:01 -e 17:49:01
Cannot open /var/log/sa/sa30: No such file or directory


 The sar statistics is keeping 7 days in storage cell, because

[root@ed01cel02 ~]# cat /etc/sysconfig/sysstat
# How long to keep log files (days), maximum is a month
HISTORY=7


 What to do ?
And we decided to look into OSWather.
It is installed into Exadata by default, and keep its files in

[root@ed01cel03 ~]# ls -l /opt/oracle.oswatcher/osw/archive/
total 972
drwxr-s--- 2 root cellusers  32768 Jan 13 16:00 ExadataDiagCollect
drwxr-s--- 2 root cellusers  28672 Jan 13 16:00 ExadataOSW
drwxr-s--- 2 root cellusers  24576 Jan 13 16:03 ExadataRDS
drwxr-s--- 2 root cellusers 630784 Jan 13 16:00 oswcellsrvstat
drwxr-s--- 2 root cellusers  20480 Jan 13 16:03 oswdiskstats
drwxr-s--- 2 root cellusers  24576 Jan 13 16:01 oswiostat
drwxr-s--- 2 root cellusers  24576 Jan 13 16:00 oswmeminfo
drwxr-s--- 2 root cellusers  20480 Jan 13 16:02 oswmpstat
drwxr-s--- 2 root cellusers  24576 Jan 13 16:04 oswnetstat
drwxr-s--- 2 root cellusers   4096 Apr  4  2013 oswprvtnet
drwxr-s--- 2 root cellusers  20480 Jan 13 16:00 oswps
drwxr-s--- 2 root cellusers  28672 Jan 13 16:00 oswslabinfo
drwxr-s--- 2 root cellusers  24576 Jan 13 16:09 oswtop
drwxr-s--- 2 root cellusers  24576 Jan 13 16:01 oswvmstat


We jump to oswvmstat directory, because it has information we need: runqueue, idle and so on.

But each file contain many rows. How to calculate the average load or somathing like that ?
The solution is:

cat file |
awk '{if(min==""){min=max=$1}; if($1>max) {max=$1}; if($1<min) {min=$1}; total+=$1; count+=1} END {print total/count, max, min}'


For example:

[root@ed01cel01 oswvmstat]# cat ed01cel01.distr.fors.ru_vmstat_13.12.30.1600.dat| grep -v id|grep -v procs|grep -v zzz|awk '{if(min==""){min=max=$15}; if($15>max) {max=$15}; if($15<min) {min=$15}; total+=$15; count+=1} END {print total/count, max, min}'

97.0653 99 87





No comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Does DEALLOCATE UNUSED or SHRINK SPACE will free space occupied by LOB segment?

Lets check how it works. My env is DB 19.20@Linux-x64 1) I created the table with 4 LOB columns of 4 different LOB types: BASICFILE BLOB, BA...