Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Very clear article about oracle dataguard Oracle
  • DETERMINING WHICH INSTANCE OWNS WHICH SHARED MEMORY & SEMAPHORE SEGMENTS Oracle
  • Gather Stats manually using DBMS_STATS after disabling DBMS_SCHEDULER jobs as previous entry Oracle
  • on IBM-AIX for display Linux/Unix
  • Very Good Oralce Internal Tuning Book Oracle
  • How to connect to Oracle Database with Wallet with Python. Oracle
  • rm_backup_arch_file.ksh Linux/Unix
  • How to find who is using which Rollback segment and how many rows or blocks in that rollback segments, Oracle
  • Roles and Stored Object behaviour Oracle
  • Another export with Query Oracle
  • Default User Profile Oracle
  • Test Case for Inserting Multiple (2.3 Million rows in 26 Seconds) Oracle
  • find_open_cur.sql Find open cursorts per session Oracle
  • Find Stale DR Physical Standby Oracle
  • Monitor Long Running Job Oracle

longtx.sql

Posted on 10-Jul-2008 By Admin No Comments on longtx.sql

Find long running transaction that are running for more than 5 minutes with transaction id.

col machine format a30

col sid format 99999

col Transaction_id format a20

col username format a10

col days format 99.99

col minutes format 999999

set lines 120 pages 200

select a.sid, a.username, a.machine,

round((sysdate – to_date(b.start_time, ‘MM/DD/YY HH24:MI:SS’)) * 1440) minutes,

round((sysdate – to_date(b.start_time, ‘MM/DD/YY HH24:MI:SS’)), 2) days,

a.status, b.status, b.xidusn||’.’||b.xidslot||’.’||b.xidsqn Transaction_id

from v$session a , v$transaction b

where a.SADDR = b.SES_ADDR

and (sysdate – to_date(b.start_time, ‘MM/DD/YY HH24:MI:SS’)) * 1440 > 5

order by (sysdate – to_date(b.start_time, ‘MM/DD/YY HH24:MI:SS’)) * 1440

/

Oracle, SQL scripts

Post navigation

Previous Post: V$transaction notes for finding XID composition.
Next Post: RAC with RHEL4 and 11g

Related Posts

  • create user with unlimited quota Oracle
  • Free conference number from http://www.freeconference.com Oracle
  • All About Trace Fils Oracle
  • Does DBMS_JOB recompute the NEXT_DATE interval after or before Oracle
  • Proc Compilation Oracle
  • moving lob object to other tablespace lob_mvmt.sql 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 (400)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (18)
  • rman-dataguard (26)
  • shell (150)
  • SQL scripts (348)
  • SQL Server (6)
  • Uncategorized (3)
  • Videos (0)

Recent Posts

  • Running PDB on single node in RAC09-Apr-2026
  • find_arc.sql09-Apr-2026
  • pvm_pre_change.sql08-Apr-2026
  • find_encr_wallet.sql08-Apr-2026
  • find_pdbs.sql08-Apr-2026
  • Creating a Container Database using dbaascli08-Apr-2026
  • track_autoupgrade_copy_progress.sql01-Apr-2026
  • refre.sql for multitenant01-Apr-2026
  • prepfiles.sh for step by step generating pending statistics files10-Mar-2026
  • tracksqltime.sql05-Mar-2026

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Python class import from different folders Python/PySpark
  • Read CSV File using Python Python/PySpark
  • normal maintenance for exp-imp and renaming table Oracle
  • sid_wise_cursor.sql find open cursor basis on username or SID Oracle
  • Removing Ctrl-M from end of line using vi Linux/Unix
  • find checksum of a file. Linux/Unix
  • My FTP Job Scheduling for www.pvmehta.com PHP/MYSQL/Wordpress
  • Vivek’s egrep commands to trace problem. (on linux x86-64) Linux/Unix

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme