Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • ORA-1841 Error Connecting to Upgraded Database After Set PASSWORD_LIFE_TIME Oracle
  • Oracle Internal Good Websites 1 Oracle
  • Explain Plan Output 2 Oracle
  • Roles and Stored Object behaviour Oracle
  • oradebug ipcrm ipcs Oracle
  • How To Resolve Stranded DBA_2PC_PENDING Entries ID 401302.1 (Very Good prooven) Oracle
  • DBMS_STATS Metalinks Notes Oracle
  • Adding addidional hard drive and attach it to a linux box. Linux/Unix
  • How to Modify the statistics collection by MMON for AWR repository Oracle
  • How To Limit The Access To The Database So That Only One User Per Schema Are Connected (One Concurrent User Per Schema) Oracle
  • get_aix_vmstat.ksh Oracle
  • Rman Notes -1 Oracle
  • DBMS_SQL for alter session. Oracle
  • ORA-8031 issue and solution if it is occuring due to truncate. Oracle
  • All About oracle password and security from metalink Oracle

get_vmstat.ksh for Solaris

Posted on 17-Aug-2006 By Admin No Comments on get_vmstat.ksh for Solaris

#!/bin/ksh -x

# First, we must set the environment . . . .

ORACLE_SID=WEBP18F

export ORACLE_SID

ORACLE_HOME=`cat /var/opt/oracle/oratab|grep ^$ORACLE_SID:|cut -f2 -d’:’`

export ORACLE_HOME

PATH=$ORACLE_HOME/bin:$PATH

export PATH

SERVER_NAME=`uname -a|awk ‘{print $2}’`

typeset -u SERVER_NAME

export SERVER_NAME

# sample every five minutes (300 seconds) . . . .

SAMPLE_TIME=30

while true

do

vmstat ${SAMPLE_TIME} 2 > /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 %s %s %s %s %s %s %s %s %s %s %sn”, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12,

$17, $18, $19, $20, $21, $22) }’ | while read RUNQUE BUSY_WAITS RUNNABLE_WAITS SWAP FREE PAGE_RECLAIMS MINOR_FAULTS PAGE_IN PAGE_OUT PAGE_FREE DESTROYE

D SCAN_RATE DEVICE_INTERRUPT SYSTEM_CALLS CONTEXT_SWITCHES USER_CPU SYSTEM_CPU IDLE_CPU

do

echo $RUNQUE

echo $BUSY_WAITS

echo $RUNNABLE_WAITS

echo $SWAP

echo $FREE

echo $PAGE_RECLAIMS

echo $MINOR_FAULTS

echo $PAGE_IN

echo $PAGE_OUT

echo $PAGE_FREE

echo $DESTROYED

echo $SCAN_RATE

echo $DEVICE_INTERRUPT

echo $SYSTEM_CALLS

echo $CONTEXT_SWITCHES

echo $USER_CPU

echo $SYSTEM_CPU

echo $IDLE_CPU

$ORACLE_HOME/bin/sqlplus -s / as sysdba <execute PERFSTAT.VMSTAT3(SYSDATE,$SAMPLE_TIME,’$SERVER_NAME’,$RUNQUE,$BUSY_WAITS,$RUNNABLE_WAITS,$SWAP,$FREE,$PAGE_RECLAIMS,$MINOR_FAULTS,$PAGE_IN,$PAG

E_OUT,$PAGE_FREE,$DESTROYED,$SCAN_RATE,$DEVICE_INTERRUPT,$SYSTEM_CALLS,$CONTEXT_SWITCHES,$USER_CPU,$SYSTEM_CPU,$IDLE_CPU,0);

EXIT

EOF

done

done

rm /tmp/msg$$

Oracle, SQL scripts

Post navigation

Previous Post: Search and replace editor command in vi
Next Post: Passing from Unix to PLSQL using bind variables

Related Posts

  • Database logon trigger issue Oracle
  • Privilege to describe the table. Oracle
  • logminer and my_lbu Oracle
  • How can I tell if ASO is installed ? Oracle
  • How to connect to Oracle Database with Wallet with Python. Oracle
  • Oracle 10g Installation/Applying Patches Tips Oracle

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • AWS (2)
  • Azure (1)
  • Linux/Unix (149)
  • Oracle (392)
  • PHP/MYSQL/Wordpress (10)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (341)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • load SPM baseline from cursor cache05-Jun-2025
  • Drop all SPM baselines for SQL handle05-Jun-2025
  • Load SPM baseline from AWR05-Jun-2025
  • Drop specific SQL plan baseline – spm05-Jun-2025
  • findinfo.sql (SQL for getting CPU and Active session info)27-May-2025
  • SQL Tracker by SID sqltrackerbysid.sql22-Apr-2025
  • How to connect to Oracle Database with Wallet with Python.21-Mar-2025
  • JSON/XML Types in Oracle18-Mar-2025
  • CPU Core related projections12-Mar-2025
  • Exadata Basics10-Dec-2024

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • scp with ssh2 Linux/Unix
  • Updated LCK.SQL file. Oracle
  • database trigger failing Oracle
  • Ports used by Oracle Software Oracle
  • Windows based Command line mailing program like mailx (Sednmail for windows) PHP/MYSQL/Wordpress
  • DBMS_UTILITY PACKAGE Oracle
  • DBMS_PROFILER for tuning PLSQL programs. Oracle
  • Running some SQL on multiple databases connecting using monitoring userid and password Linux/Unix

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme