Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Drop tempfiles from database Oracle
  • Small sample shell program Linux/Unix
  • Jai Shree Ram Oracle
  • Recovering lost SYS password Oracle
  • Monitor Long Running Job Oracle
  • oracle 10g on linux Linux/Unix
  • Rename Tablespace Oracle
  • Good Oracle Architecture In Short and point to point Oracle
  • Multiple listeners Oracle
  • find_longsql.sql Oracle
  • Removing first line Linux/Unix
  • tblwopk.sql /* Find Tables Without PK */ Oracle
  • Histogram Overview Oracle
  • How to stop OCSSD Daemon Oracle
  • Find All internal Parameters Oracle

pvm_metric.sql for gathering report from vmstat tables

Posted on 10-May-2008 By Admin No Comments on pvm_metric.sql for gathering report from vmstat tables

col AVG_ACTIVE_USR format 999999.99

col AVG_TOT_USR format 9999.99

col AVG_USR_CPU format 9999.99

col AVG_SYS_CPU format 99.99

col AVG_IDLE_CPU format 99.99

col AVG_WAIT_CPU format 99.99

col TOT_ODR format 99999999

col AVG_ACT_USR format 999999.99

col RUNQ format 999.99

col CSW format 99999.99

set lines 120 pages 2000

accept start1 prompt ‘Enter Start Dare in DD-MON-RRRR:HH24:MI format : ‘

accept stop1 prompt ‘Enter Stop Dare in DD-MON-RRRR:HH24:MI format : ‘

set echo off

set feedback off

set verify off

select to_char(measured_date,’DD-MON-RRRR:HH24′) “Hour”, min(a.total_users) “Min Tot Usr”,

max(a.total_users) “Max Tot Usr”, avg(a.total_users) AVG_TOT_USR,

min(b.user_cpu+system_CPU) “MIN USG CPU”, max((b.user_cpu+system_CPU)) “Max USG CPU”,

avg((b.user_cpu+system_CPU)) “Avg Usg CPU”

from stats$totalusers a,stats$vmstat2 b

where a.measured_date=b.start_date

and a.measured_date between to_date(‘&start1’, ‘DD-MON-RRRR:HH24:MI’) and to_date(‘&stop1’, ‘DD-MON-RRRR:HH24:MI’)

group by to_char(measured_date,’DD-MON-RRRR:HH24′)

/

select to_char(b1.start_date, ‘DD-MON-RRRR:HH24’) peak_hr, (b1.user_cpu+b1.system_CPU) peak_cpu

from stats$vmstat2 b1

where (b1.user_cpu+b1.system_CPU) = (select max((b.user_cpu+system_CPU)) max_cpu

from stats$vmstat2 b

where b.start_date between to_date(‘&start1’, ‘DD-MON-RRRR:HH24:MI’)

and to_date(‘&stop1’, ‘DD-MON-RRRR:HH24:MI’))

and b1.start_date between to_date(‘&start1’, ‘DD-MON-RRRR:HH24:MI’)

and to_date(‘&stop1’, ‘DD-MON-RRRR:HH24:MI’) ;

select avg(XXX.avg_cpu) “Average-CPU”

from

(select to_char(measured_date,’DD-MON-RRRR:HH24′) “Hour”, avg((b.user_cpu+system_CPU)) avg_cpu

from stats$totalusers a,stats$vmstat2 b

where a.measured_date=b.start_date

and a.measured_date between to_date(‘&start1’, ‘DD-MON-RRRR:HH24:MI’) and to_date(‘&stop1’, ‘DD-MON-RRRR:HH24:MI’)

group by to_char(measured_date,’DD-MON-RRRR:HH24′)) XXX

/

Oracle, SQL scripts

Post navigation

Previous Post: ORA-4031 issue and solution on 09-MAY-2008
Next Post: get_ratio.sql get the ratio of users from v$session and this uses CASE-WHEN-THEN clause

Related Posts

  • How do I get Oracle to automatically start when my server boots up? Oracle
  • How to choose Driver table in SQL statement Oracle
  • TABLE SIZING WITH DB_BLOCK ARCHITECTURE Reference : Metalink note : 10640.1 Oracle
  • How to Make Trace Files Created by Oracle Readable by All Users ? Oracle
  • currwaitobj.sql SQl_ID and SQL statement you can get from currwaitobj.sql Oracle
  • get_vmstat_linux 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 (387)
  • PHP/MYSQL/Wordpress (10)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (336)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • 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
  • Reading config file from other folder inside class24-Sep-2024
  • Python class import from different folders22-Sep-2024
  • Transfer SQL Profiles from One database to other database.05-Sep-2024
  • Load testing on Oracle 19C RAC with HammerDB18-Jan-2024
  • Add new columns in dataframe30-Sep-2023

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Standby Database File Management in 10g with STANDBY_FILE_MANAGEMENT Oracle
  • rm_backup_arch_file.ksh Linux/Unix
  • Generating XML from SQLPLUS Oracle
  • How do I get Oracle to automatically start when my server boots up? Oracle
  • Move WordPress site from one hosting service to other. PHP/MYSQL/Wordpress
  • How to change hostname in Linux Linux/Unix
  • restarting network in linux Linux/Unix
  • longtx.sql with the flag whether session is blocking any DML locks or not. Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme