set ver off

column table_owner format a20
column RATIO_MOD format 9999990.99

select * from (
select dtm.table_owner,dtm.table_name,dtm.inserts,dtm.updates,dtm.deletes,dt.num_rows,to_char(dt.last_analyzed,'ddmmyyyy hh24:mi:ss') last_analyzed,100*(dtm.inserts+dtm.updates+dtm.deletes)/decode(dt.num_rows,0,1,dt.num_rows) ratio_mod
from dba_tab_modifications dtm, dba_tables dt
WHERE dtm.table_owner NOT IN (SELECT OWNER FROM T_GESTION_STATS_OWNER_EXCLUDE) 
and dtm.TABLE_OWNER = dt.owner
and dtm.TABLE_NAME = dt.table_name
--and dt.PARTITIONED = 'NO'
and dtm.TABLE_OWNER like upper('%&1%')
and dtm.TABLE_NAME like upper('%&2%')
and dtm.PARTITION_NAME is null 
and dtm.subPARTITION_NAME is null 
order by 8 desc nulls last
)
where rownum <=&3;


