How do I see the Oracle Query execution plan?

Source: Internet
Author: User
oracle| Statement | The autotrace that executes Sqlplus is a very simple and convenient tool for analyzing SQL's execution plan, execution efficiency, and, in most cases, a very useful tool.

1. How to set up and use Autotrace

Sql> Connect/as SYSDBA
Sql> @?/rdbms/admin/utlxplan.sql

Table created.

sql> create public synonym plan_table for plan_table;

Synonym created.

Sql> Grant Select,update,insert,delete on plan_table to public;

Grant succeeded.

Sql> @?/sqlplus/admin/plustrce.sql
Sql>grant plustrace to public.

2. Understanding and Using Autotrace
For SQL tuning, using Autotrace is the easiest way to do this, and we just need to do this:
Sql>set Autotrace on
We can see our SQL execution plan, execution cost (physical read/consistent READ ...)
Plus set Timing on or set time on, we can get a lot of the data we need.

Then you can see the execution plan for this statement by pressing the ctrl+e on a SQL statement inside the toad.


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.