Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Best approach for Oracle database patching sequence to latest/required patchset along with CPU/PSU/any-other-one-off patch ID 865255.1 Oracle
  • get_aix_vmstat.ksh Oracle
  • My Test Case On 21-OCT-2005 Oracle
  • To find all disk io ( EMC as well as local) Linux/Unix
  • Running select from V$ views from remote server Linux/Unix
  • Korn Shell Arithmatic Linux/Unix
  • oracle tips… from http://www.bijoos.com/oracle/douknow.htm Oracle
  • When to rebuld B-tree index Oracle
  • create user with unlimited quota Oracle
  • Goldengate Tutorial Oracle
  • DBA_HIST_SQLSTAT contents Oracle
  • create database syntax Oracle
  • Specify the Rollback segment to use in Transaction Oracle
  • eplan9i.sql Oracle
  • True Session Wait Activity in Oracle 10g Verygood 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

  • get_aix_vmstat.ksh Oracle
  • _B_TREE_BITMAP_PLANS issue during 8.1.7 to 9.2.0.8 upgrade Oracle
  • 10g RAC: Troubleshooting CRS Root.sh Problems Oracle
  • find_log_switch.sql Find log switches in graphical manner Oracle
  • Explain Plan Doesn’T Change For Sql After New Statistics Generated Oracle
  • Rman Notes -1 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
  • Linux CPU info. Linux/Unix
  • How to hide author name in WordPress BLOG PHP/MYSQL/Wordpress
  • oracle fast start failover best practice Oracle
  • Nice notes on wait events Oracle
  • create trigger syntax Oracle
  • OEM-Commnds Oracle
  • to see when crontab is changed. Linux/Unix
  • default permission on ~/.ssh/authorized_keys2 or authorized_keys Linux/Unix

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme