zoukankan      html  css  js  c++  java
  • 解决 执行计划看不到过滤条件 出现'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@]
  • 相关阅读:
    gulp备忘
    好文收藏
    妙味H5交互篇备忘
    [CSS3备忘] transform animation 等
    css选择器总结
    flexbox备忘
    函数
    继承2
    在 Swift 中实现单例方法
    浅谈 Swift 中的 Optionals
  • 原文地址:https://www.cnblogs.com/gtaxmjld/p/5216998.html
Copyright © 2011-2022 走看看