Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • get_vmstat.ksh for Solaris Oracle
  • cp_filesystem.sql Oracle
  • First Entry in RAC Oracle
  • Removing first line Linux/Unix
  • PLSQL Table Syntax 1 Oracle
  • Oracle 10g for solaris 10 Oracle
  • RMAN : Consistent Backup, Restore and Recovery using RMAN Oracle
  • perf_today.sql Oracle
  • V$CONTROLFILE_RECORD_SECTION reference notes. Oracle
  • EXTPROC Oracle
  • xargs use Linux/Unix
  • Process Map for CPU and Memory for OS processes Linux/Unix
  • proper cpu stats Linux/Unix
  • New OFA for 11g Oracle
  • get_ratio.sql get the ratio of users from v$session and this uses CASE-WHEN-THEN clause 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

  • Jai Shree Ram Oracle
  • Sequence Resetting Oracle
  • findx.sql /* Find Indexes on specified USER.TABLE_NAME */ Oracle
  • Insert cause enqueue locks Oracle
  • DBMS_Shared_pool pinning triggers Oracle
  • Configure ssh authentications for RAC Oracle

Leave a Reply Cancel reply

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

Categories

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

Recent Posts

  • 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
  • Oracle vs MYSQL Architecture differences (For DBAs)24-Jul-2025
  • V$INSTANCE of Oracle in MYSQL24-Jul-2025
  • Day to day MYSQL DBA operations (Compared with Oracle DBA)24-Jul-2025

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Physical Standby switchover with session active Oracle
  • Check_recovery.sh program to run sqlplus and return its values remotely. Linux/Unix
  • cold backup scripts to copy locally Linux/Unix
  • Good link for LIO in Oracle ( Logical IOs) Oracle
  • How to change hostname in Linux Linux/Unix
  • Building Our Own Namespaces with “Create Context” Oracle
  • Wait Based Tuning Step by step with SQL statement Oracle
  • Sending email with file attachment. Linux/Unix

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme