conn / as sysdba

set timing off feedback off
column trace_name_col new_value trace_name

alter session set current_schema = acme;
alter session set workarea_size_policy=manual;
alter session set sort_area_size=500000000;

set timing on feedback on

select	a.acctype
,	count(i.dima)
from	accs a
,	txns t
,	itms i
where	t.accpkcol = a.pkcol
and	t.itmpkcol = i.pkcol
group by a.acctype;


select event,time_waited_micro / total_waits avg_wait_micro,total_waits,time_waited_micro from v$session_event
where sid = (select sid from v$mystat where rownum = 1)
and event like 'db%' order by time_waited ;

conn / as sysdba

set timing off feedback off
alter session set current_schema = acme;
alter session set workarea_size_policy=manual;
alter session set sort_area_size=500000000;

select value trace_name_col from v$diag_info where name = 'Default Trace File';
exec dbms_monitor.session_trace_enable(null,null,true,true);
set timing on feedback on

select	a.acctype
,	count(i.dima)
from	accs a
,	txns t
,	itms i
where	t.accpkcol = a.pkcol
and	t.itmpkcol = i.pkcol
group by a.acctype;

select event,time_waited_micro / total_waits avg_wait_micro,total_waits,time_waited_micro from v$session_event
where sid = (select sid from v$mystat where rownum = 1)
and event like 'db%' order by time_waited ;

conn / as sysdba

set timing off feedback off
alter session set current_schema = acme;
alter session set workarea_size_policy=manual;
alter session set sort_area_size=500000000;

select value trace_name_col from v$diag_info where name = 'Default Trace File';
prompt ln -s /dev/null &trace_name.
host ln -s /dev/null &trace_name.

exec dbms_monitor.session_trace_enable(null,null,true,true);
set timing on feedback on

select	a.acctype
,	count(i.dima)
from	accs a
,	txns t
,	itms i
where	t.accpkcol = a.pkcol
and	t.itmpkcol = i.pkcol
group by a.acctype;

select event,time_waited_micro / total_waits avg_wait_micro,total_waits,time_waited_micro from v$session_event
where sid = (select sid from v$mystat where rownum = 1)
and event like 'db%' order by time_waited ;
