Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • How to Use DBMS_STATS to Move Statistics to a Different Database Oracle
  • Creating never expiring DB user accounts in Oracle Oracle
  • handling filenname with space Linux/Unix
  • All Hints for Oracle Databases Oracle
  • rm_backup_arch_file.ksh Linux/Unix
  • Drop tempfiles from database Oracle
  • For Search and replace unix command. Linux/Unix
  • set_env_dba Linux/Unix
  • _B_TREE_BITMAP_PLANS issue during 8.1.7 to 9.2.0.8 upgrade Oracle
  • compile_inv.sql Oracle
  • How can I tell if ASO is installed ? Oracle
  • TABLE SIZING WITH DB_BLOCK ARCHITECTURE Reference : Metalink note : 10640.1 Oracle
  • remove archfiles only when it is applied to DR rm_archfiles.sh Linux/Unix
  • export import with parameter file. Oracle
  • Rownum with Order by Oracle

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

  • Adding Datafile on Primary Server and Impact on Standby Server Oracle
  • Jai Shree Ram Oracle
  • Changing the Global Database Name Oracle
  • Export Oracle data and Compress at same time Oracle
  • SYSOPER Mystery Oracle
  • Proc Compilation 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
  • ext#.sql Oracle
  • login.sql Oracle
  • Locktree.sql Oracle
  • OPENING A STANDBY DATABASE IN READ-ONLY MODE Oracle
  • move_arch_files.ksh Linux/Unix
  • myfile Oracle
  • Rename Oracle Instance Name Oracle
  • scripts to take listener.log backup Linux/Unix

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme