Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • shutdown linux Linux/Unix
  • Composite Index creation tip from Vivek Oracle
  • New OFA for 11g Oracle
  • DBMS_SQL for alter session. Oracle
  • Locally Managed Tablespace and Dictionary managed tablespace (LMT-DMT) Oracle
  • Oracle Statspack survival Guide Oracle
  • Goog notes on X$ tables Oracle
  • oradebug ipcrm ipcs Oracle
  • Some OS level threshold for performance. Linux/Unix
  • before_trunc.sql Before Truncate table needs to execute following: Oracle
  • checking redhat linux version Linux/Unix
  • 339939.1 Running Cluster Verification Utility to Diagnose Install Problems Oracle
  • Good notes on Oracle Events Oracle
  • V$transaction notes for finding XID composition. Oracle
  • How To Transfer Passwords Between Databases (ref note: 199582.1) 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

  • Find nth max and min. Oracle
  • How to see which patches are applied. Oracle
  • How To Resolve Stranded DBA_2PC_PENDING Entries ID 401302.1 (Very Good prooven) Oracle
  • 10g oem configuration Oracle
  • Benefits and Usage of RMAN with Standby Databases Oracle
  • V$CONTROLFILE_RECORD_SECTION reference notes. Oracle

Leave a Reply Cancel reply

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

Categories

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

Recent Posts

  • tracksqltime.sql05-Mar-2026
  • Complete Git Tutorial for Beginners25-Dec-2025
  • Postgres DB user and OS user.25-Dec-2025
  • Trace a SQL session from another session using ORADEBUG30-Sep-2025
  • 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

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Rman Notes -1 Oracle
  • Convert multiple rows to single column Oracle
  • Which environment is used by currently running process ( Very good) Linux/Unix
  • find the files that are 1 day old. Linux/Unix
  • exp syntax in oracle 10g Oracle
  • Directory wise folder wise space usage Linux/Unix
  • Backup and Recovery Scenarios Oracle
  • CPU speed on Linux Linux/Unix

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme