As a cross-check, you need to compare the redo
from using a GTT with the redo from using a
normal table.
The answer to your puzzle is that changes to the GTT do not generate redo, but they do generate undo, and the undo generates redo.
Arguably, the undo has to be generated, as you may want to do a rollback to savepoint part way through the transaction. Since you have a GTT with no indexes, and 'on commit preserve' you might also like to try a very large insert with an /*+ append */ hint - this gets rid of the undo as well. (Note - there are various reasons why both the undo and redo volume generated can be much more than you expect - foreign keys, row-level triggers, and referential integrity constraints are all features that disable various of the special undo/redo optimisations).
Regards
Jonathan Lewis http://www.oracle.com/technology/community/oracle_ace/ace1.html#lewis
The Co-operative Oracle Users' FAQ http://www.jlcomp.demon.co.uk/faq/ind_faq.html
Cost Based Oracle: Fundamentals http://www.jlcomp.demon.co.uk/cbo_book/ind_book.html
Here is the proof:
Table dropped.
Table created.
NAME VALUE ---------------------------------------------------------------- ---------- redo size 23212
PL/SQL procedure successfully completed.
SQL> commit;
Commit complete.
NAME VALUE ---------------------------------------------------------------- ---------- redo size 937172
SQL> spool off;
In another session:
1 select t.username,s.sid,t.tablespace,(t.blocks*8192)/1048576 "MB" 2 from v$sort_usage t,v$session s 3* where t.session_addr=s.saddr SQL> /
USERNAME SID TABLESPACE MB -------------------- ---------- ------------------------------- --------- SCOTT 59 TEMP 4.00
-- Mladen Gogala http://www.mgogala.com
-- //www.freelists.org/webpage/oracle-l
-- //www.freelists.org/webpage/oracle-l