-- #############################################################################################
--
-- %Purpose: Monitor Sort Activities (Sorts in Memory, Sorts on Disk)
--
-- Use:      Needs Oracle DBA Access
--
-- #############################################################################################
--
set feed off;
set pagesize 10000;
set wrap off;
set linesize 200;
set heading on;
set tab on;
set scan on;
set verify off;
set termout on;

column  STATISTIC#  format 999      heading 'Id'
column  NA          format a32      heading 'Parameter'
column  NAME        format a32      heading 'Statistik'
column  VA          format a8       heading 'Value'
column  VALUE       format 9999999990

ttitle  left  'Monitor Sort Activities' skip 2

spool   monitor_sort_activities.log

select  rpad (NAME, 32, '.') as NA,
        VALUE                as VA
  from  V$PARAMETER
 where  NAME like '%sort%'
/

ttitle off

select NAME,
       VALUE
  from V$SYSSTAT
 where NAME in ('sorts (rows)',
                'sorts (memory)',
                'sorts (disk)')
/

spool off;
