Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Wait time tuning research Oracle
  • shutdown linux Linux/Unix
  • Find Time Consuming SQL Statements in Oracle 10g Oracle
  • Small sample shell program Linux/Unix
  • remove archfiles only when it is applied to DR rm_archfiles.sh Linux/Unix
  • All Hints for Oracle Databases Oracle
  • Find sort details from Db find_sort.sql Oracle
  • Running select from V$ views from remote server Linux/Unix
  • Find_stale_dr.sql finding stale physical DR.. Oracle
  • find_cons.sql Oracle
  • Renaming Global Name GLOBAL_NAME Oracle
  • newupload.html PHP/MYSQL/Wordpress
  • To find explain plan for a statement that occurred in past. Oracle
  • initUOCIOTTO.ora Oracle
  • How To Limit The Access To The Database So That Only One User Per Schema Are Connected (One Concurrent User Per Schema) Oracle

longtx.sql with the flag whether session is blocking any DML locks or not.

Posted on 18-May-2009 By Admin No Comments on longtx.sql with the flag whether session is blocking any DML locks or not.

col machine format a30

col sid format 99999

col serial# format 99999

col sid_info format a14

col Transaction_id format a20

col username format a8

col days format 99.99

col hours1 format 999999

col TX_HRS format 999

col USER_HRS format 999

col LOCK format a2

set lines 120 pages 200

select a.sid || ‘,’ || a.serial# sid_info, a.username, a.machine,

round((sysdate – to_date(b.start_time, ‘MM/DD/YY HH24:MI:SS’)) * 24) “TX_HRS”,

round((sysdate – a.logon_time) * 24) “USER_HRS”,

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

decode(UBAFIL,0, decode(UBABLK, 0, decode(UBASQN, 0, ‘N’, ‘Y’), ‘Y’), ‘Y’) “LOCK”

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

— and (UBAFIL != 0 and UBABLK != 0 and UBASQN != 0)

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

/

Oracle, SQL scripts

Post navigation

Previous Post: FRA Information.
Next Post: tar and untar a dolder with all its subfolder.

Related Posts

  • Histogram information Oracle
  • refre.sql for multitenant Oracle
  • Library cahe Latches and internal explaination Oracle
  • Oracle Internal Good Websites 1 Oracle
  • Oracle Support Metalink ID 161818.1 Oracle
  • Oracle GoldenGate lag monitoring shell script Linux/Unix

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
  • Deleting first line and lastline of a file using sed Linux/Unix
  • cold backup scripts to copy locally Linux/Unix
  • longtx.sql Oracle
  • All About oracle password and security from metalink Oracle
  • TOP-N Sql to find Nth max or Top N rows Oracle
  • For Search and replace unix command. Linux/Unix
  • Good Link from metalink 1 Oracle
  • Trace a SQL session from another session using ORADEBUG Oracle

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme