Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • How To Resolve Stranded DBA_2PC_PENDING Entries ID 401302.1 (Very Good prooven) Oracle
  • How to connect to Oracle Database with Wallet with Python. Oracle
  • setting prompt display with .profile Linux/Unix
  • adding new line after specific pattern using sed Linux/Unix
  • find checksum of a file. Linux/Unix
  • VIvek Encryption Package and Its Usage Oracle
  • database trigger failing Oracle
  • How to know current SID Oracle
  • get_vmstat_solaris Oracle
  • ORA-01220 Oracle
  • fkwoindex.sql /* Find FK without Index */ Oracle
  • .profile Linux/Unix
  • create PLAN_TABLE command. Oracle
  • oracle 11g RAC on vmware Oracle
  • Remove duplicate rows from table 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

  • Find_table_size.sql Oracle
  • How to Use DBMS_STATS to Move Statistics to a Different Database Oracle
  • 10g oem configuration Oracle
  • create user with unlimited quota Oracle
  • UNderstand and eliminate Latch contention. Oracle
  • v$event_name 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
  • Goldengate Tutorial Oracle
  • Check_recovery.sh program to run sqlplus and return its values remotely. Linux/Unix
  • True Session Wait Activity in Oracle 10g Verygood Oracle
  • For Search and replace unix command. Linux/Unix
  • Sending SQLPLUS output in HTML format Oracle
  • create database syntax Oracle
  • Roles and Stored Procs II Oracle
  • chk_space_SID.ksh Linux/Unix

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme