Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Recovering lost SYS password Oracle
  • FGA Part-I Oracle
  • Explain Plan Output 2 Oracle
  • AWR settings- MMON is not taking snapshot. Oracle
  • useful dg links Oracle
  • Virtual Indexes in Oracle Oracle
  • Temporary tablespace explaination Oracle
  • configUOCIOTTO.ora Oracle
  • nfs mount command Linux/Unix
  • CTAS with LONG Column for 7.x and 8 and 8i Oracle
  • 10g RAC: Troubleshooting CRS Root.sh Problems Oracle
  • Logic to chech # of parameters command line parameters Linux/Unix
  • pvmehta.com SQL scripts
    Find which sessions is accessing object that prevent your session to have exclusive locks in Oracle Oracle
  • handling filenname with space Linux/Unix
  • Privileges Required to Create Procedures and Functions that uses objects from other schema. Oracle

Find sort details from Db find_sort.sql

Posted on 10-May-2008 By Admin No Comments on Find sort details from Db find_sort.sql

select sql_text,(executions-sorts) “Diff” from v$sqlarea where (executions-sorts) < 20
and executions > 100 order by 2 ;

SELECT S.sid || ‘,’ || S.serial# sid_serial, S.username,

T.blocks * TBS.block_size / 1024 / 1024 mb_used, T.tablespace,

T.sqladdr address, Q.hash_value, Q.sql_text

FROM v$sort_usage T, v$session S, v$sqlarea Q, dba_tablespaces TBS

WHERE T.session_addr = S.saddr

AND T.sqladdr = Q.address (+)

AND T.tablespace = TBS.tablespace_name

ORDER BY S.sid;

SELECT S.sid || ‘,’ || S.serial# sid_serial, S.username, S.osuser, P.spid,

S.module, S.program,

SUM (T.blocks) * TBS.block_size / 1024 / 1024 mb_used, T.tablespace,

COUNT(*) sort_ops

FROM v$sort_usage T, v$session S, dba_tablespaces TBS, v$process P

WHERE T.session_addr = S.saddr

AND S.paddr = P.addr

AND T.tablespace = TBS.tablespace_name

GROUP BY S.sid, S.serial#, S.username, S.osuser, P.spid, S.module,

S.program, TBS.block_size, T.tablespace

ORDER BY sid_serial;

Oracle, SQL scripts

Post navigation

Previous Post: runsql_once.ksh
Next Post: pvm_rbs1.sql (to collect rbs info from db)

Related Posts

  • Oracle Metalink useful notes Oracle
  • v$event_name Oracle
  • Jai Shree Ram Oracle
  • Histogram information Oracle
  • Oracle 11g RAC on OEL 5 and Vmware 2 Oracle
  • sql_plan9i.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
  • DBA_HIST_SQLSTAT contents Oracle
  • Reading parameter file and printing Linux/Unix
  • Sending SQLPLUS output in HTML format Oracle
  • how to find OS block size Oracle
  • The most important Tuning Notes Oracle
  • create database syntax Oracle
  • On solaris 10, “S” link is not part of $ORACLE_HOME/bin/oracle as default. ( For 9.2.0.8) Oracle
  • scripts to take listener.log backup Linux/Unix

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme