Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Good Site for Oracle Internals Oracle
  • UTL_FILE test program Oracle
  • Roles and Stored Object behaviour Oracle
  • CTAS with LONG Column for 9i and higher Oracle
  • Validating ORACLE_SID againt oratab file. Linux/Unix
  • For Perl DBI installation and testing program PHP/MYSQL/Wordpress
  • Rownum with Order by Oracle
  • pvmehta.com SQL scripts
    Find which sessions is accessing object that prevent your session to have exclusive locks in Oracle Oracle
  • Follwoing korn shell is used to move files from source folder to destination folder and gzip it in destination folder. mv_iotto.ksh Linux/Unix
  • Postgres DB user and OS user. POSTGRESQL
  • grep multuple patterns Linux/Unix
  • Adding Datafile on Primary Server and Impact on Standby Server Oracle
  • Find all users who have DML privileges Oracle
  • adding new line after specific pattern using sed Linux/Unix
  • Which environment is used by currently running process ( Very good) 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

  • Good Oracle Architecture In Short and point to point Oracle
  • My Minimum Tuning Programs Oracle
  • How can I tell if ASO is installed ? Oracle
  • Good link for LIO in Oracle ( Logical IOs) Oracle
  • Locally Managed Tablespace and Dictionary managed tablespace (LMT-DMT) Oracle
  • Important Script Method for tuning Oracle

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Django (0)
  • GIT (1)
  • Linux/Unix (149)
  • MYSQL (5)
  • Oracle (394)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (343)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • tracksqltime.sql05-Mar-2026
  • Complete Git Tutorial for Beginners25-Dec-2025
  • Postgres DB user and OS user.25-Dec-2025
  • Trace a SQL session from another session using ORADEBUG30-Sep-2025
  • SQL Server Vs Oracle Architecture difference25-Jul-2025
  • SQL Server: How to see historical transactions25-Jul-2025
  • SQL Server: How to see current transactions or requests25-Jul-2025
  • T-SQL Vs PL/SQL Syntax25-Jul-2025
  • Check SQL Server edition25-Jul-2025
  • Checking SQL Server Version25-Jul-2025

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • ORACLE_SID in sqlplus Oracle
  • How to sort list of files on basis of their sizes. Linux/Unix
  • moving lob object to other tablespace lob_mvmt.sql Oracle
  • plan10g.sql good Oracle
  • block_ident.sql Oracle
  • Gathering statistics with DBMS_STATS Oracle
  • Gather Stats manually using DBMS_STATS after disabling DBMS_SCHEDULER jobs as previous entry Oracle
  • Oracle 11g Training on 29JAN1010 Oracle

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme