Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • pvm_pre_change.sql Oracle
  • move_arch_files.ksh Linux/Unix
  • ORA-00064: object is too large to allocate on this O/S during startup Oracle
  • Rollback force for distributed transactions Oracle
  • How to collect CPU usage on Linux using Shell script Linux/Unix
  • Mutating Table Error while using database trigger Oracle
  • Deleting first line and lastline of a file using sed Linux/Unix
  • proc.sql Oracle
  • Alter procedure auditing Oracle
  • Oracle Recommended Patches — Oracle Database ID 756671.1 Oracle
  • db_status.sql Oracle
  • Find Command Linux/Unix
  • How To Limit The Access To The Database So That Only One User Per Schema Are Connected (One Concurrent User Per Schema) Oracle
  • Giving Grant on v$DATABASE Oracle
  • setting prompt display with .profile Linux/Unix

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

  • Multiple listeners Oracle
  • ORA-8031 issue and solution if it is occuring due to truncate. Oracle
  • Configure ssh authentications for RAC Oracle
  • oradebug ipcrm ipcs Oracle
  • get_vmstat.ksh for Solaris Oracle
  • Gather Stats manually using DBMS_STATS after disabling DBMS_SCHEDULER jobs as previous entry 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
  • Specify the Rollback segment to use in Transaction Oracle
  • fkwoind.sql fkwoindex.sql Oracle
  • find checksum of a file. Linux/Unix
  • Committing distributed transaction using commit force Oracle
  • good linux notes Linux/Unix
  • plan10g.sql good1 Oracle
  • Zip and unzip with tar Linux/Unix
  • Test Case for Inserting Multiple (2.3 Million rows in 26 Seconds) Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme