How Oracle databases collect execution plans for specified SQL and resolve ORA-00904 errors during the process

Source: Internet
Author: User
Oracle Database how to collect specific SQL Execution Plan and solve the ORA-00904 errors in the process (copyright statement, I Original or translated articles if you need to reprint, such as reproduced for personal learning, please indicate the source; otherwise, contact me. The attacker must know) how to collect the execution plan of the specified SQL statement is very important for developers. Here, the basic collection is recorded.

Oracle Database how to collect specific SQL Execution Plan and solve the ORA-00904 errors in the process (copyright statement, I Original or translated articles if you need to reprint, such as reproduced for personal learning, please indicate the source; otherwise, contact me. The attacker must know) how to collect the execution plan of the specified SQL statement is very important for developers. Here, the basic collection is recorded.

How Oracle databases collect execution plans for specified SQL and resolve ORA-00904 errors during the process

(Copyright statement: If your original or translated articles need to be reprinted, or if they are used for personal learning, please indicate the source; otherwise, please contact me. violators must investigate)

It is very important for developers to collect execution plans for specific SQL statements. The basic collection methods are recorded here for reference by others.

1. Link to sqlplus, as shown in figure

2. execute one of the following two Commands

Set autotrace on; (Description: Enable Automatic Analysis Statistics and display the running results of SQL statements)

3. Enter and execute the SQL statement to collect the execution plan.

4. The execution plan is printed. For example

   <喎�"" target="_blank" class="keylink"> VcD48cD7I57n71NrK1byvtcS5/bPM1tDT9rW9T1JBLTAwOTA0OiZxdW90O09USEVSX1RBRyZx

DW90Ozqx6sq2t/vO3tCntcTOyszio6zI58/Czbw8L3A + PHA + pgltzybzcm9"

20140403/201404030849428. jpg "alt =" "/>

So we need

1. drop the plan_table table first;

2. Use @ $ ORACLE_HOME/rdbms/admin/utlxplan. SQL to recreate plan_table. For example:

3. The effect of the collection execution plan after reconstruction is as follows.

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.