Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Changing unix system clock when Oracle database is running. Oracle
  • Oracle Recommended Patches — Oracle Database ID 756671.1 Oracle
  • Which environment is used by currently running process ( Very good) Linux/Unix
  • Mutating Table Error while using database trigger Oracle
  • How to hide author name in WordPress BLOG PHP/MYSQL/Wordpress
  • Transfer SQL Profiles from One database to other database. Oracle
  • db_status.sql Oracle
  • DBA_HIST_SQLSTAT contents Oracle
  • ORA-1841 Error Connecting to Upgraded Database After Set PASSWORD_LIFE_TIME Oracle
  • Database logon trigger issue Oracle
  • currwait.sql Oracle
  • Some useful Unix Commands Linux/Unix
  • Oracle Metalink useful notes Oracle
  • Roles and Stored Object behaviour Oracle
  • Configure ssh authentications for RAC 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

  • Rollback force for distributed transactions Oracle
  • DBMS_Shared_pool pinning triggers Oracle
  • tblwopk.sql tablewopk.sql Oracle
  • Import and export statements Oracle
  • Temporary Tablespsace Temp tablespace behaviour Oracle
  • oradebug ipcrm ipcs 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
  • create user with unlimited quota Oracle
  • CPU Core related projections AWS
  • Oracle Data Direct to TAPE Oracle
  • Very clear article about oracle dataguard Oracle
  • Temporary Tablespsace Temp tablespace behaviour Oracle
  • Metalink Note: Note:250655.1 : ADDM Basics USING THE AUTOMATIC DATABASE DIAGNOSTIC MONITOR Oracle
  • Jai Shree Ram Oracle
  • Python class import from different folders Python/PySpark

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme