解決 'PLAN_TABLE' is old version

beautychina發表於2011-02-17

解決 'PLAN_TABLE' is old version

分析sql執行計劃時,遇到
'PLAN_TABLE' is old version
細想起來,資料庫是從低版本升級的,估計是這個原因

解決方法: 刪除plan_table重建

SQL>explain plan for select * from users;

Explained.

SQL>select * from table(dbms_xplan.display);

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------

-----------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
-----------------------------------------------------------
| 0 | SELECT STATEMENT | | 455 | 19565 | 4 |
| 1 | TABLE ACCESS FULL| USERS | 455 | 19565 | 4 |
-----------------------------------------------------------

Note
-----
- 'PLAN_TABLE' is old version

11 rows selected.

SQL> drop table plan_table purge;

Table dropped.

SQL> @/home/ora10g/product/10.2.0/rdbms/admin/utlxplan.sql

Table created.
SQL>explain plan for select * from users;

Explained.

SQL>select * from table(dbms_xplan.display);

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
Plan hash value: 3461732445

---------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
---------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 2406 | 86616 | 4 (0)| 00:00:01 |
| 1 | TABLE ACCESS FULL| USERS | 2406 | 86616 | 4 (0)| 00:00:01 |
---------------------------------------------------------------------------

8 rows selected.

對比一下,顯示的內容也不一樣了

[@more@]

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

相關文章