Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • runsql_once.ksh Linux/Unix
  • JSON/XML Types in Oracle Oracle
  • FRA Information. Oracle
  • Removing Ctrl-M from end of line using vi Linux/Unix
  • get_ratio.sql get the ratio of users from v$session and this uses CASE-WHEN-THEN clause Oracle
  • Set Role explaination. Oracle
  • DBMS_JOB all example Oracle
  • Goog notes on X$ tables Oracle
  • Changing the Global Database Name Oracle
  • restarting network in linux Linux/Unix
  • export import with parameter file. Oracle
  • Rownum with Order by Oracle
  • Finding locked objects Oracle
  • Display the top 5 salaries for each department using single SQL Oracle
  • Create type and Grant on it. 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

Related Posts

  • Metalink Note: Note:250655.1 : ADDM Basics USING THE AUTOMATIC DATABASE DIAGNOSTIC MONITOR Oracle
  • currwait.sql Oracle
  • Find nth max and min. Oracle
  • PLSQL Table Syntax 2 Oracle
  • SQL Tracker by SID sqltrackerbysid.sql Oracle
  • sess_server.sql 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 (388)
  • PHP/MYSQL/Wordpress (10)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (337)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • 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
  • Reading config file from other folder inside class24-Sep-2024
  • Python class import from different folders22-Sep-2024
  • Transfer SQL Profiles from One database to other database.05-Sep-2024
  • Load testing on Oracle 19C RAC with HammerDB18-Jan-2024

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • shr1.sql for MTS or Shared server configuration Oracle
  • Passing from Unix to PLSQL using bind variables Linux/Unix
  • First Entry in RAC Oracle
  • DBMS_Shared_pool pinning triggers Oracle
  • Linux CPU info. Linux/Unix
  • USE_NL and INDEX hints example Oracle
  • sid_wise_cursor.sql find open cursor basis on username or SID Oracle
  • cur_sql.sql Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme