Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • find_du.ksh to find # of files, their sizes in current folder and its subdolder Linux/Unix
  • Finding Oracle Patches with opatch Oracle
  • Database logon trigger issue Oracle
  • avail.sh ( find filesystem spae usage) Linux/Unix
  • cur_sql.sql Oracle
  • Gather Stats manually using DBMS_STATS after disabling DBMS_SCHEDULER jobs as previous entry Oracle
  • Find average Row Length and other table size calculation. metalink notes Oracle
  • AWR settings- MMON is not taking snapshot. Oracle
  • Gather Stats manually using DBMS_STATS after disabling DBMS_SCHEDULER jobs as previous entry Oracle
  • Sort with ASCII order and Numeric Order Linux/Unix
  • age_alert.ksh aging out alert.log Linux/Unix
  • Good Link from metalink 1 Oracle
  • Vivek’s egrep commands to trace problem. (on linux x86-64) Linux/Unix
  • Order by with ROWNUM Oracle
  • create trigger syntax Oracle

find_longsql.sql

Posted on 06-May-2010 By Admin No Comments on find_longsql.sql

–Ref: http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1198012113596

column dur format a20

set lines 120 pages 200

select a.sid, a.serial#, a.username,

to_char(sysdate-a.last_call_et/24/60/60,’hh24:mi:ss’) started,

trunc(a.last_call_et/60) || ‘ mins, ‘ || mod(a.last_call_et,60) ||’ secs’ dur,

b.sql_text

from v$sql b, v$session a

where a.username is not null

and a.last_call_et > 10

and a.status = ‘ACTIVE’

and a.sql_address = b.address;

Oracle, SQL scripts

Post navigation

Previous Post: Display the top 5 salaries for each department using single SQL
Next Post: ORA-3136

Related Posts

  • Oracle Recommended Patches — Oracle Database ID 756671.1 Oracle
  • Library cahe Latches and internal explaination Oracle
  • OEM-Commnds Oracle
  • Find_table_size.sql Oracle
  • sid_wise_sql.sql Further explaination Oracle
  • Jai Shree Ram 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
  • Monitor and Trace Unix processes using truss Linux/Unix
  • Explain Plan Doesn’T Change For Sql After New Statistics Generated Oracle
  • VIvek Encryption Package and Its Usage Oracle
  • CTAS with LONG Column for 7.x and 8 and 8i Oracle
  • Good Doc 28-JUN-2006 Oracle
  • good linux notes Linux/Unix
  • Nice Article about semaphores and init.ora Processes parameter relations Linux/Unix
  • perf_today.sql Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme