Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Gather Stats manually using DBMS_STATS after disabling DBMS_SCHEDULER jobs as previous entry Oracle
  • SQL_PLAN.sql for checking real execution plan Oracle
  • tuning commmand for cpu, ip and memory stats Linux/Unix
  • Default User Profile Oracle
  • xargs use Linux/Unix
  • switchover for primary database Oracle
  • scripts to take listener.log backup Linux/Unix
  • All About oracle password and security from metalink Oracle
  • Important Script Method for tuning Oracle
  • Which environment is used by currently running process ( Very good) Linux/Unix
  • purge_trc.sh Linux/Unix
  • Resolving RMAN Hung Jobs Oracle
  • How to collect CPU usage on Linux using Shell script Linux/Unix
  • column level grant syntax Oracle
  • changing kernel parameter in Oracle Enterpise Linux Linux/Unix

Wait.sql

Posted on 04-Apr-202322-Apr-2025 By Admin No Comments on Wait.sql
/********************************************
Author: Paresh Mehta
Script Name : waitt.sql
waits order by sql start time
********************************************/
set feedback 1
set pages 2000
set lines 190
column event format a45
column machin format a12
column modul format a10
column prg format a10
column osuser1 format a10
column username format a10
column sesinfo format a15
column blockedby format a15
alter session set nls_date_format='DDMONRR:HH24:MI:SS';

select /*+ first_rows(100) */ a.sid || ',' || a.serial# || ',@' || a.inst_id sesinfo,
a.username, substr(a.osuser,1,10) osuser1, a.sql_id, sql_exec_start,
substr(substr(a.machine,instr(machine, '\')+1),1,12) machin, substr(program,1,10) prg, substr(module, 1,10) modul, a.event,
blocking_session || '@' || blocking_instance blockedBy
from gv$session a
where status = 'ACTIVE'
and wait_class != 'Idle'
order by blocking_session desc, sql_exec_start desc
/

Oracle, SQL scripts Tags:data, database, databases, DBA, OCI, oracle, performance, tuning

Post navigation

Previous Post: CPU speed on Linux
Next Post: Find_planinfo.sql

Related Posts

  • True Session Wait Activity in Oracle 10g Verygood Oracle
  • This is from Temi Oracle
  • Settting up get_vmstat.sh for colletinf CPU Usage. Oracle
  • tab.sql Oracle
  • Best approach for Oracle database patching sequence to latest/required patchset along with CPU/PSU/any-other-one-off patch ID 865255.1 Oracle
  • OPENING A STANDBY DATABASE IN READ-ONLY MODE 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
  • tuning commmand for cpu, ip and memory stats Linux/Unix
  • CPU speed on Linux Linux/Unix
  • Privilege to describe the table. Oracle
  • In Addition to previous note, following grants needed on PERFSTAT user. Oracle
  • currwait.sql Oracle
  • replace alphabets using sed Linux/Unix
  • Unix split command to split files Linux/Unix
  • Roles and Stored Object behaviour Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme