Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • find_log_switch.sql Find log switches in graphical manner Oracle
  • To Find Orphan OS processes. Linux/Unix
  • Adding Datafile on Primary Server and Impact on Standby Server Oracle
  • ORA-8031 issue and solution if it is occuring due to truncate. Oracle
  • Disbaling DBA_SCHEDULER_JOBS Oracle
  • Does DBMS_JOB recompute the NEXT_DATE interval after or before Oracle
  • xargs use Linux/Unix
  • How to Use DBMS_STATS to Move Statistics to a Different Database Oracle
  • upload.html PHP/MYSQL/Wordpress
  • Parallel DML Oracle
  • sid_wise_cursor.sql find open cursor basis on username or SID Oracle
  • before_trunc.sql Before Truncate table needs to execute following: Oracle
  • tuning commmand for cpu, ip and memory stats Linux/Unix
  • Restoring a user’s original password 1051962.101 Oracle
  • nfs mount command Linux/Unix

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

  • find_open_cur.sql Find open cursorts per session Oracle
  • SQLPLUS COPY command Precautions. Oracle
  • Load SPM baseline from AWR Oracle
  • Oracle Recommended Patches — Oracle Database ID 756671.1 Oracle
  • Adding or Dropping Online Redo Log Files When Physical Standby in place Oracle
  • DBA_HIST_SQLSTAT contents 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
  • Very Good Oralce Internal Tuning Book Oracle
  • My Test Case On 21-OCT-2005 Oracle
  • Getting started with notebook Python/PySpark
  • Histogram Overview Oracle
  • Test Case for Inserting Multiple (2.3 Million rows in 26 Seconds) Oracle
  • replace alphabets using sed Linux/Unix
  • Running some SQL on multiple databases connecting using monitoring userid and password Linux/Unix
  • TRUNCATE table and disabling referential constraints. Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme