【正文】
on set sort_area_size=0。SQL set autotrace traceonly statisticsSQL select * from t order by object_id。Statistics 0 recursive calls 24 db block gets 80 consistent gets 214 physical reads 0 redo size 219216 bytes sent via SQL*Net to client 767 bytes received via SQL*Net from client 26 SQL*Net roundtrips to/from client 0 sorts (memory) 1 sorts (disk) 6219 rows processedSQL /已選擇6219行。會話已更改。已選擇6219行。Statistics 0 recursive calls 59 db block gets 80 consistent gets 437 physical reads 0 redo size 219216 bytes sent via SQL*Net to client 767 bytes received via SQL*Net from client 26 SQL*Net roundtrips to/from client 0 sorts (memory) 1 sorts (disk) 6219 rows processedSQL alter session set sort_area_size=102400。SQL select * from t order by object_id。Statistics 0 recursive calls 19 db block gets 80 consistent gets 198 physical reads 0 redo size 219216 bytes sent via SQL*Net to client 767 bytes received via SQL*Net from client 26 SQL*Net roundtrips to/from client 0 sorts (memory) 1 sorts (disk) 6219 rows processedSQL alter session set sort_area_size=10240000。SQL select * from t order by object_id。Statistics 0 recursive calls 0 db block gets 80 consistent gets 0 physical reads 0 redo size 219216 bytes sent via SQL*Net to client 767 bytes received via SQL*Net from client 26 SQL*Net roundtrips to/from client 1 sorts (memory) 0 sorts (disk) 6219 rows processedSQL alter session set sort_area_size=0。SQL select * from t order by object_id。Statistics 0 recursive calls 22 db block gets 80 consistent gets 212 physical reads 0 redo size 219216 bytes sent via SQL*Net to client 767 bytes received via SQL*Net from client 26 SQL*Net roundtrips to/from client 0 sorts (memory) 1 sorts (disk) 6219 rows processed252。在歸檔模式下,要把表設(shè)置為nologging,insert數(shù)據(jù)時,加上append提示。insert /*+ append */ into test_redo select * from all_objects。如果表建有索引,則要把索引停用,否則依然有大量的redo:alter index idx_test unusable。alter index idx_test rebuild nologging。 sql*net statistics252。SQL alter system set timed_statistics=true。SQL conn scott/tigerSQL select * from dept。sessionid39。Cpu:語句執(zhí)行花費的cpu時間,以1/1000秒為單位。如果cpu超過elapsed,是因為計時精確度的不同所引起的誤差,實際是不可能存在這種情況的。Qurey:consistent reads(gets)。Rows:在select操作中,出現(xiàn)在fetch欄目,在修改操作中,出現(xiàn)在execute欄目中。5) 當(dāng)設(shè)置set event時,在報告的最后將出現(xiàn)wait events:alter session set events ‘10046 trace name context forever,level 12’15 /