Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Creating never expiring DB user accounts in Oracle Oracle
  • How to find pinned objects from shared pool. (pinned via dbms_shared_pool.keep) Oracle
  • Building Our Own Namespaces with “Create Context” Oracle
  • longtx.sql Oracle
  • Checking SQL Server Version SQL Server
  • Goog notes on X$ tables Oracle
  • find_log_switch.sql Find log switches in graphical manner Oracle
  • runsql_once.ksh Linux/Unix
  • Jai Shree Ram Oracle
  • How does one overcome the Unix 2 Gig file limit? Linux/Unix
  • DBMS_Shared_pool pinning triggers Oracle
  • good linux notes Linux/Unix
  • Composite Index creation tip from Vivek Oracle
  • ORA-00064: object is too large to allocate on this O/S during startup Oracle
  • The most important Tuning Notes 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

  • ORA-4031 issue and solution on 09-MAY-2008 Oracle
  • Oracle Material from OTN Oracle
  • Good link for LIO in Oracle ( Logical IOs) Oracle
  • Temporary Tablespace Information and restriction. Oracle
  • Nice notes on wait events Oracle
  • Another Tuning Article for subheap of shared pool Oracle

Leave a Reply Cancel reply

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

Categories

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

Recent Posts

  • SQL Server Vs Oracle Architecture difference25-Jul-2025
  • SQL Server: How to see historical transactions25-Jul-2025
  • SQL Server: How to see current transactions or requests25-Jul-2025
  • T-SQL Vs PL/SQL Syntax25-Jul-2025
  • Check SQL Server edition25-Jul-2025
  • Checking SQL Server Version25-Jul-2025
  • Oracle vs MYSQL Architecture differences (For DBAs)24-Jul-2025
  • V$INSTANCE of Oracle in MYSQL24-Jul-2025
  • Day to day MYSQL DBA operations (Compared with Oracle DBA)24-Jul-2025
  • MYSQL and Oracle Comparison for Oracle DBA24-Jul-2025

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Jai Shree Ram Oracle
  • Goldengate Tutorial Oracle
  • Set Role explaination. Oracle
  • Search and Replace vi editor command. Linux/Unix
  • My Test Case On 21-OCT-2005 Oracle
  • sql_plan9i.sql Oracle
  • Renaming Global Name GLOBAL_NAME Oracle
  • Roles and Stored Procs II Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme