Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Remove DOS CR/LFs (^M) Linux/Unix
  • V$CONTROLFILE_RECORD_SECTION reference notes. Oracle
  • Gather Stats manually using DBMS_STATS after disabling DBMS_SCHEDULER jobs as previous entry Oracle
  • oradebug ipcrm ipcs Oracle
  • SQLPLUS COPY command Precautions. Oracle
  • grep multuple patterns Linux/Unix
  • Sending SQLPLUS output in HTML format Oracle
  • Insert cause enqueue locks Oracle
  • Important Solaris Commands Linux/Unix
  • column level grant syntax Oracle
  • Consolidated Reference List Of Notes For Migration / Upgrade Service Requests -ID 762540.1 Oracle
  • fuser to check who is using diretory Linux/Unix
  • find_du.ksh to find # of files, their sizes in current folder and its subdolder Linux/Unix
  • How to calculate PROCESSES parameter Oracle
  • Unix command for system configuration Linux/Unix

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

  • pvm_rbs1.sql (to collect rbs info from db) Oracle
  • How to Decide upto what level you can decrement your datafile size. ( Shrink Datafile) Oracle
  • How to set Processes Parameter Oracle
  • v$backup.status information Oracle
  • Find Multiple levels of object dependencies : depen.sql Oracle
  • Committing distributed transaction using commit force 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 (393)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (0)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (342)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • Trace a SQL session from another session using ORADEBUG30-Sep-2025
  • 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

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Jai Shree Ram Oracle
  • get_vmstat.ksh Linux/Unix
  • Passing from Unix to PLSQL using bind variables Linux/Unix
  • DBMS_STATS Metalinks Notes Oracle
  • avail.sh ( find filesystem spae usage) Linux/Unix
  • Database link password in user_db_links Oracle
  • More info about /proc folder and its relation with processes. Linux/Unix
  • How do I get Oracle to automatically start when my server boots up? Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme