Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Goldengate Tutorial Oracle
  • Renaming Global Name GLOBAL_NAME Oracle
  • Good Oracle Architecture In Short and point to point Oracle
  • find checksum of a file. Linux/Unix
  • How to change hostname in Linux Linux/Unix
  • Alter procedure auditing Oracle
  • Histogram Overview Oracle
  • How To Limit The Access To The Database So That Only One User Per Schema Are Connected (One Concurrent User Per Schema) Oracle
  • Find all users who have DML privileges Oracle
  • Paste command syntax Linux/Unix
  • How to set Processes Parameter Oracle
  • SQL_PLAN.sql for checking real execution plan Oracle
  • ORA-01220 Oracle
  • CPU speed on solaris Linux/Unix
  • compile_inv.sql 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

  • Library cahe Latches and internal explaination Oracle
  • Multiple listeners Oracle
  • Roles and Stored Procs II Oracle
  • oracle tips… from http://www.bijoos.com/oracle/douknow.htm Oracle
  • Roles and Stored Object behaviour Oracle
  • Consolidated Reference List Of Notes For Migration / Upgrade Service Requests -ID 762540.1 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
  • FRA Information. Oracle
  • Free conference number from http://www.freeconference.com Oracle
  • How to sort list of files on basis of their sizes. Linux/Unix
  • Oracle 10g Installation/Applying Patches Tips Oracle
  • Oracle 11g Environment Setup Oracle
  • Oracle Release Explaination Oracle
  • 284785.1 How to check RAC Option is currently linked into the Oracle Binary Oracle
  • sql_plan9i.sql Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme