[Oracle] viewing SQL Execution plans

Source: Internet
Author: User
SQLSETAUTOTRACEONSQLSELECTSYSDATEFROMDUAL; sysdate------------26- September-12 execution plan execution ERROR: anuncaughterrorinfunctiondisplayhashappened; pleasecontactOraclesupportPlease

SQL set autotrace on SQL SELECT SYSDATE FROM DUAL; SYSDATE -------------- 26-9 month-12 execution plan warning ERROR: anuncaughterror in function displayhashappened; pleasecontactOracle support Please

  1. SQL> SET AUTOTRACE ON
  2. SQL> SELECT SYSDATE FROM DUAL;
  3. SYSDATE
  4. --------------
  5. 26-9-12
  6. Execution Plan
  7. ----------------------------------------------------------
  8. ERROR: an uncaught error in function display has happened; please contact Oracle
  9. Support
  10. Please provide also a DMP file of the used plan table PLAN_TABLE
  11. ORA-00904: "OTHER_TAG": Invalid identifier
  12. Statistics
  13. ----------------------------------------------------------
  14. 0 recursive cballs
  15. 0 db block gets
  16. 0 consistent gets
  17. 0 physical reads
  18. 0 redo size
  19. 347 bytes sent via SQL * Net to client
  20. 338 bytes encoded ed via SQL * Net from client
  21. 2 SQL * Net roundtrips to/from client
  22. 0 sorts (memory)
  23. 0 sorts (disk)
  24. 1 rows processed



Solution:

Need to recreate or upgrade the plan table, it is still the 8i one.
Please drop the table and run

SQL> drop table PLAN_TABLE;

The table has been deleted.

SQL> @ C: \ oracle \ product \ 10.2.0 \ client_2 \ RDBMS \ ADMIN \ utlxplan. SQL

The table has been created.


  1. SQL> SET AUTOTRACE ON
  2. SQL> SELECT SYSDATE FROM DUAL;
  3. SYSDATE
  4. --------------
  5. 26-9-12
  6. Execution Plan
  7. ----------------------------------------------------------
  8. Plan hash value: 1388734953
  9. -----------------------------------------------------------------
  10. | Id | Operation | Name | Rows | Cost (% CPU) | Time |
  11. -----------------------------------------------------------------
  12. | 0 | select statement | 1 | 2 (0) | 00:00:01 |
  13. | 1 | fast dual | 1 | 2 (0) | 00:00:01 |
  14. -----------------------------------------------------------------
  15. Statistics
  16. ----------------------------------------------------------
  17. 0 recursive cballs
  18. 0 db block gets
  19. 0 consistent gets
  20. 0 physical reads
  21. 0 redo size
  22. 347 bytes sent via SQL * Net to client
  23. 338 bytes encoded ed via SQL * Net from client
  24. 2 SQL * Net roundtrips to/from client
  25. 0 sorts (memory)
  26. 0 sorts (disk)
  27. 1 rows processed
  28. SQL>


Ps: view the execution plan. You can also use [Oracle] to view the SQL Execution Plan-DBMS_XPLAN Package

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.