View the oracle Execution Plan (command implementation)

Source: Internet
Author: User


View the oracle Execution Plan (command implementation). See the following small exercises to show you how to use oracle commands to view the execution plan. www.2cto.com 1. SQL statement to view the law enforcement plan: SQL code explain plan for select t. *, t. rowid from A5 t where t. l = '000000' and t. k like '% 8' order by I; 2. view the execution Plan of this SQL statement: SQL code select * from table (dbms_xplan.display); execution result: execution result code PLAN_TABLE_OUTPUT explain Plan hash value: 1156097717 Bytes | Id | Operation | Name | Rows | Bytes | Cost (% CPU) | Time | Bytes | 0 | select statement | 12 | 1524 | 71 (3) | 00:00:01 | 1 | sort order by | 12 | 1524 | 71 (3) | 00:00:01 | * 2 | table access full | A5 | 12 | 1524 | 70 (2) | 00:00:01 | notice Note ------'Plan _ table' is old version www.2cto.com 12 rows selected'plan _ table' is old version: This sentence tells us that the version of PLAN_TABLE is too old, need to be regenerated. 3. regenerate the PLAN_TABLE table: SQL code -- delete the table drop table PLAN_TABLE; -- create a table @ D: \ oracle \ product \ 10.2.0 \ db_1 \ RDBMS \ ADMIN \ utlxplan. SQL; 4. view execution Plan: SQL code select * from table (dbms_xplan.display); Result: www.2cto.com other code PLAN_TABLE_OUTPUT explain Plan hash value: 1156097717 Bytes | Id | Operation | Name | Rows | Bytes | Cost (% CPU) | Time | Bytes | 0 | select statement | 12 | 1524 | 71 (3) | 00:00:01 | 1 | sort order by | 12 | 1524 | 71 (3) | 00:00:01 | * 2 | table access full | A5 | 12 | 1524 | 70 (2) | 00:00:01 | identified by operation id: ----------------------------------------------------------------- 2-filter ("T ". "L" = '000000' AND "T ". "K" LIKE '% 8') 14 rows selected
 

Related Article

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.