Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Oracle Data Direct to TAPE Oracle
  • send attachment from unix-shell script Linux/Unix
  • Removing Ctrl-M from end of line using vi Linux/Unix
  • How To Limit The Access To The Database So That Only One User Per Schema Are Connected (One Concurrent User Per Schema) Oracle
  • Good Site for Oracle Internals Oracle
  • Jai Shree Ram Oracle
  • rm_backup_arch_file.ksh Linux/Unix
  • handling filenname with space Linux/Unix
  • online_ts_bkup.sql Oracle
  • perf_today.sql Oracle
  • How To Resolve Stranded DBA_2PC_PENDING Entries ID 401302.1 (Very Good prooven) Oracle
  • AWR settings- MMON is not taking snapshot. Oracle
  • When to rebuld B-tree index Oracle
  • fkwoind.sql fkwoindex.sql Oracle
  • Another Tuning Article for subheap of shared pool 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

  • DETERMINING WHICH INSTANCE OWNS WHICH SHARED MEMORY & SEMAPHORE SEGMENTS Oracle
  • Specify the Rollback segment to use in Transaction Oracle
  • V$ROLLSTAT status is Full Oracle
  • Facts about SCN and Rollback Segment Oracle
  • Database link password in user_db_links Oracle
  • Gather Stats manually using DBMS_STATS after disabling DBMS_SCHEDULER jobs as previous entry 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 (402)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (18)
  • rman-dataguard (26)
  • shell (150)
  • SQL scripts (350)
  • SQL Server (6)
  • Uncategorized (5)
  • Videos (0)

Recent Posts

  • SAT Mathematics 10 questions and answer at the end.30-Apr-2026
  • top 10 AI news today30-Apr-2026
  • runon_allpdbs_show_conname.sh23-Apr-2026
  • runon_allcdbs_find_pdbs.sql23-Apr-2026
  • 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

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Identical Dblink Issue… Oracle
  • Good Link from metalink 1 Oracle
  • V$INSTANCE of Oracle in MYSQL MYSQL
  • SQL Server: How to see current transactions or requests SQL Server
  • How can I tell if ASO is installed ? Oracle
  • To find all disk io ( EMC as well as local) Linux/Unix
  • purge_trc.sh Linux/Unix
  • .profile Linux/Unix

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme