解决 执行计划看不到过滤条件 出现'PLAN_TABLE' is old version的问题
解决 '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@]