Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Add new columns in dataframe Python/PySpark
  • TRUNCATE Privs Oracle
  • ORA-1841 Error Connecting to Upgraded Database After Set PASSWORD_LIFE_TIME Oracle
  • Good RAC & Standby Notes Oracle
  • How to start CRS manually Oracle
  • Exadata Basics Oracle
  • PLSQL Table Syntax 2 Oracle
  • Export With Query Another Example. Oracle
  • dbinv.sql Oracle
  • Difference between SYNC and AFFIRM Oracle
  • Oracle Data Direct to TAPE Oracle
  • Oracle 10g for solaris 10 Oracle
  • DBMS_PROFILER for tuning PLSQL programs. Oracle
  • run this before doing any dbchange pvm_pre_change.sql Oracle
  • Renaming Oracle Instance Name 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

  • Alter procedure auditing Oracle
  • online_ts_bkup.sql Oracle
  • Drop database in Oracle 10g Oracle
  • Export With Query Another Example. Oracle
  • Wait.sql Oracle
  • Wait Based Tuning Step by step with SQL statement 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 (388)
  • PHP/MYSQL/Wordpress (10)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (337)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • 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
  • Reading config file from other folder inside class24-Sep-2024
  • Python class import from different folders22-Sep-2024
  • Transfer SQL Profiles from One database to other database.05-Sep-2024
  • Load testing on Oracle 19C RAC with HammerDB18-Jan-2024

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • how to find OS block size Oracle
  • Drop tempfiles from database Oracle
  • lck.sql Oracle
  • Rename Tablespace Oracle
  • 751131.1 New Article Error 2819 While Requesting a Systemstate Dump Oracle
  • database trigger failing Oracle
  • pvm_metric.sql for gathering report from vmstat tables Oracle
  • Adding a new disk and mount it automatically. on VMWARE LINUX Linux/Unix

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme