Re: vmstat to perfstat

David,

If it helps, I have a script named "sp_vmstat.sh" that I just posted to
"http://www.EvDBT.com/tools.htm"; that does pretty much what you want to do.
I had written it last year and had actually uploaded it to the site some
time ago, but had forgotten/neglected to update the HTML page to let people
know it was there (sorry!)...

Hope this helps...

-Tim


on 7/26/04 12:29 PM, David at thump@xxxxxxxxxxxxxxxx wrote:

> I'm having issue with writing vmstat output to the perfstat account and
> would like some advice, or better ideas in how to do this:
> 
> It appears to work just fine, but then eventually it contines to write top
> /tmp, but not to the database.
> 
> get_vmstat_solaris.ksh:
> 
> #!/usr/bin/ksh
> 
> # First, we must set the environment . . . .
> #ORACLE_SID=ahap
> #export ORACLE_SID
> #ORACLE_HOME=/u01/app/oracle/product/8.1.7
> #export ORACLE_HOME
> #PATH=$ORACLE_HOME/bin:$PATH
> #export PATH
> 
> for SID in $1
> do
> cd /m1/homes/oracle
> . ./$SID
> 
> SERVER_NAME=`uname -a|awk '{print $2}'`
> typeset -u SERVER_NAME
> export SERVER_NAME
> 
> # sample every 15 minutes (900 seconds) . . . .
> SAMPLE_TIME=300
> 
> while true
> do
>  vmstat ${SAMPLE_TIME} > /tmp/msg$$
> 
> 
> # Note that Solaris does not have a wait CPU column
> cat /tmp/msg$$|sed 1,3d | awk  '{ printf("%s %s %s %s %s %s %s\n", $1, $8,
> $9, $12, $20, $21, $22) }' | while read RUNQUE PAGE_IN PAGE_OUT SR
> USER_CPU SYSTEM_CPU IDLE_CPU
>  do
> 
>     $ORACLE_HOME/bin/sqlplus -s "/ as sysdba" <<EOF
>     insert into perfstat.stats\$vmstat
>                          values (
>                            SYSDATE,
>                            $SAMPLE_TIME,
>                            '$SERVER_NAME',
>                            $RUNQUE,
>                            $PAGE_IN,
>                            $PAGE_OUT,
>                            $SR,
>                            $USER_CPU,
>                            $SYSTEM_CPU,
>                            $IDLE_CPU,
>                            0
>                                 );
>     EXIT
> EOF
>  done
> done
> 
> rm /tmp/msg$$
> done

----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: