create table 
as
select 
    rownum ID
  , dbms_random.string('U', 10) 
  , mod(rownum, 10) + 1 
  , to_char(to_date('20090101','yyyymmdd') + (rownum-1), 'yyyymmdd') 
from   dual
connect by level <= 1000;

exec dbms_stats.gather_table_stats(user, '');


set autotrace traceonly exp;

select /*+ full() parallel( 2) */
       ID, , 
from   
order by  ;

set autotrace off;

select /*+ full() parallel( 2) */
       ID, , 
from   
order by  ;

break on dfo_no on tq_id on server_type;

select tq_id, server_type, process, num_rows, bytes, waits
from   v$pq_tqstat
order by
    dfo_number
  , tq_id
  , decode(substr(server_type, 1, 4),'Rang', 1, 'Prod', 2, 'Cons', 3)
  , process;


set autotrace traceonly exp;

select /*+ full() parallel( 2) */
       , count(*)
from   
group by  ;


set autotrace off;

select /*+ full() parallel( 2) */
       , count(*)
from   
group by  ;

select tq_id, server_type, process, num_rows, bytes, waits
from   v$pq_tqstat
order by
    dfo_number
  , tq_id
  , decode(substr(server_type, 1, 4),'Rang', 1, 'Prod', 2, 'Cons', 3)
  , process;

set autotrace traceonly exp;

select /*+ full() parallel( 2) */
       , count(*)
from   
group by  ;


set autotrace off

select column_name
     , num_distinct
     , num_nulls
     , 1/num_distinct selectivity
     , round(1/num_distinct * t.num_rows, 2) cardinality
from   user_tables t, user_tab_columns c
where  t.table_name = ''
and    c.table_name = t.table_name
order by column_id ;


select /*+ full() parallel( 2) */
       , count(*)
from   
group by  ;


select tq_id, server_type, process, num_rows, bytes, waits
from   v$pq_tqstat
order by
    dfo_number
  , tq_id
  , decode(substr(server_type, 1, 4),'Rang', 1, 'Prod', 2, 'Cons', 3)
  , process;