How ORACLE gets the execution plan

Source: Internet
Author: User

6 ways to get the execution plan (detailed steps have been explained in the comments section at the beginning of each example):
1. Explain plan for acquisition;
2. Set autotrace on;
3. Statistics_level=all;
4. Direct access via Dbms_xplan.display_cursor input sql_id parameters
5.10046 Trace Trace
6. Awrsqrpt.sql

Two. Applicable occasions analysis
1. If a SQL executes for a very long time to produce results, even if it is too slow to return the results, then the execution plan can only be used in Method 1;
2. The simplest way to track a SQL is Method 1, followed by Method 2;
3. If it is to be observed that there are multiple execution plans for a single SQL, only method 4 and Method 6 can be used;
4. If SQL contains multiple functions, the function is nested in SQL and other multi-layer recursive call, want to accurately analyze, can only use method 5;
5. To ensure that real implementation plans are seen, methods 1 and 2 cannot be used;
6. To get the number of times the table is accessed, use Method 3 only;

How ORACLE gets the execution plan

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.