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