ITPub博客

首页 > 数据库 > Oracle > 数据库升级后‘PLAN_TABLE

数据库升级后‘PLAN_TABLE

原创 Oracle 作者:wzhalal 时间:2013-08-01 09:56:57 0 删除 编辑


解决 'PLAN_TABLE' is old version

分析sql执行计划时,遇到
'PLAN_TABLE' is old version
细想起来,数据库是从8I升级的,估计是这个原因

解决方法: 删除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.

对比一下,显示的内容也不一样了

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28894640/viewspace-767604/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2013-06-06

  • 博文量
    60
  • 访问量
    250209