Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Check_recovery.sh program to run sqlplus and return its values remotely. Linux/Unix
  • default permission on ~/.ssh/authorized_keys2 or authorized_keys Linux/Unix
  • chk_space_SID.ksh Linux/Unix
  • Goog notes on X$ tables Oracle
  • DBMS_PROFILER for tuning PLSQL programs. Oracle
  • useful dg links Oracle
  • For Search and replace unix command. Linux/Unix
  • ORA-8031 issue and solution if it is occuring due to truncate. Oracle
  • Good Oracle Architecture In Short and point to point Oracle
  • Establishing trusted relationship between dbmonitor( central monitoring) and monitoring targets. Linux/Unix
  • telnet listening Linux/Unix
  • Jai Shree Ram Oracle
  • Generating XML from SQLPLUS Oracle
  • Renaming Oracle Instance Name Oracle
  • SQL Server: How to see current transactions or requests SQL Server

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

  • Explain Plan Doesn’T Change For Sql After New Statistics Generated Oracle
  • Backup and Recovery Scenarios Oracle
  • My Minimum Tuning Programs Oracle
  • How to find where datafile is created dbf_info.sql Oracle
  • shr1.sql for MTS or Shared server configuration Oracle
  • Example of How To Resize the Online Redo Logfiles Note:1035935.6 Oracle

Leave a Reply Cancel reply

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

Categories

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

Recent Posts

  • 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
  • Oracle vs MYSQL Architecture differences (For DBAs)24-Jul-2025
  • V$INSTANCE of Oracle in MYSQL24-Jul-2025
  • Day to day MYSQL DBA operations (Compared with Oracle DBA)24-Jul-2025
  • MYSQL and Oracle Comparison for Oracle DBA24-Jul-2025

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Zip and unzip with tar Linux/Unix
  • reset Sequence Oracle
  • Good Doc 28-JUN-2006 Oracle
  • Good link for LIO in Oracle ( Logical IOs) Oracle
  • Space padding in korn shell Linux/Unix
  • DBA_HIST_SQLSTAT contents Oracle
  • How to find where datafile is created dbf_info.sql Oracle
  • Vivek’s egrep commands to trace problem. (on linux x86-64) Linux/Unix

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme