Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Global Unique Identifier Generation in Oracle 9.2 SYS_GUID() Oracle
  • How to collect CPU usage on Linux using Shell script Linux/Unix
  • Example of How To Resize the Online Redo Logfiles Note:1035935.6 Oracle
  • .profile Linux/Unix
  • switchlogfile.sh Linux/Unix
  • cold backup scripts to copy locally Linux/Unix
  • Search and Replace vi editor command. Linux/Unix
  • purge_trc.sh Linux/Unix
  • backspace in SQL Plus not working then..? Linux/Unix
  • Rename Tablespace Oracle
  • oracle fast start failover best practice Oracle
  • currwait.sql Oracle
  • Some OS level threshold for performance. Linux/Unix
  • get_aix_vmstat.ksh Oracle
  • How to connect to Oracle Database with Wallet with Python. Oracle

findinfo.sql (SQL for getting CPU and Active session info)

Posted on 27-May-2025 By Admin No Comments on findinfo.sql (SQL for getting CPU and Active session info)
set lines 120 pages 200
col dd format a20
col inst_id format 99
col metric_name format a30
col value format 99.99
select x.dd, x.inst_id, x.metric_name, x.value "%CPU", y.sess
from
(select to_char(sysdate, 'DD-MON-RRRR:HH24:MI') DD, inst_id, metric_name, value
from gv$sysmetric
where metric_name like 'Host CPU Utilization%' and group_id=2 ) x,
(select inst_id, count(1) sess from gv$session
where status = 'ACTIVE' and osuser != 'oracle'
group by inst_id) y
where x.inst_id = y.inst_id
order by x.inst_id;
Oracle, SQL scripts

Post navigation

Previous Post: SQL Tracker by SID sqltrackerbysid.sql
Next Post: Drop specific SQL plan baseline – spm

Related Posts

  • RMAN : Consistent Backup, Restore and Recovery using RMAN Oracle
  • ORA-1841 Error Connecting to Upgraded Database After Set PASSWORD_LIFE_TIME Oracle
  • Drop tempfiles from database Oracle
  • useful dg links Oracle
  • Updated LCK.SQL file. Oracle
  • cache buffer chain latch 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
  • Recovering lost SYS password Oracle
  • 284785.1 How to check RAC Option is currently linked into the Oracle Binary Oracle
  • 10g oem configuration Oracle
  • How to stop OCSSD Daemon Oracle
  • before_trunc.sql Before Truncate table needs to execute following: Oracle
  • Zip and unzip with tar Linux/Unix
  • RAC with RHEL4 and 11g Oracle
  • Find execution plan from dba_hist_sql_plan for a specific SQL_ID and PLAN_HASH_VALUE fplan.sql Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme