【原創】autotrace中statistics為0的問題的解決

木頭一個發表於2008-05-11

環境:AIX 5.2

資料庫版本:10.2.0.2

在對資料庫進行autotrace的時候,發現所有SQL的結果中statistics除了行數外都是0

fgos@FGOSDB>set autotrace traceonly statistics

fgos@FGOSDB>select leg from fgos.VIEW_LEG_TIMESTAMP where PLEG_AP_THR_ARR='DAX' or PLEG_AP_THR_ARR='KWE';

Statistics
----------------------------------------------------------
          0  recursive calls
          0  db block gets
          0  consistent gets
          0  physical reads
          0  redo size
          0  bytes sent via SQL*Net to client
          0  bytes received via SQL*Net from client
          0  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
         16  rows processed

在網上查詢,說可能是因為使用sys使用者進行autotrace造成的,但是我使用的並非sys使用者

最後嘗試重建plan_table後問題解決

fgos@FGOSDB>@?/rdbms/admin/utlxplan.sql
create table PLAN_TABLE (
             *
ERROR at line 1:
ORA-00955: name is already used by an existing object

fgos@FGOSDB>drop table plan_table;

Table dropped.

fgos@FGOSDB>@?/rdbms/admin/utlxplan.sql

Table created.

fgos@FGOSDB>select leg from fgos.VIEW_LEG_TIMESTAMP where PLEG_AP_THR_ARR='DAX' or PLEG_AP_THR_ARR='KWE';

Statistics
----------------------------------------------------------
          0  recursive calls
          0  db block gets
         20  consistent gets
          0  physical reads
          0  redo size
      11162  bytes sent via SQL*Net to client
        479  bytes received via SQL*Net from client
          3  SQL*Net roundtrips to/from client
          1  sorts (memory)
          0  sorts (disk)
         16  rows processed

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/498744/viewspace-264991/,如需轉載,請註明出處,否則將追究法律責任。

相關文章