How to enable the execution plan in Oracle

Source: Internet
Author: User
Tags sorts

1. Enable autotrace

1.1 run utlxplan. SQL as a sys user

Sqlplus/As sysdba

SQL> @ $ ORACLE_HOME/rdbms/admin/utlxplan. SQL

1.2 execute the plustrce. SQL script to create the plustrace role

SQL> @ $ ORACLE_HOME/sqlplus/admin/plustrce. SQL

1.3 authorization

Grant the plustrace role to the current user (a user without the DBA role) or grant the plustrace to public;

2. Set the autotrace command

Serial number

Command

Explanation

1

Set autotrace off

This is the default value, that is, disable autotrace.

2

Set autotrace on

Generate result set and explain Plan and list statistics

3

Set autotrace on explain

Show result set and explain Plan not show statistics

4

Set autotrace traceonly

Displays explain plans and statistics. Even if you execute this statement, you cannot see the result set.

5

Set autotrace traceonly statistics

Show statistics only

Eg: Set autotrace on, set timing on, alter session set time_statistics = true;

3 Meanings of columns in the autotrace execution plan

Serial number

Column name

Explanation

1

Id_plus_exp

The row number of each step.

2

Parent_id_plus_exp

Level Number of the parent in each step

3

Plan_plus_exp

Actual steps

4

Object_node_plus_exp

Dblink or parallel query

4Autotrace statistics common column explanations

Serial number

Column name

Explanation

1

Db block gets

Number of blocks read from buffer cache

2

Consistent gets

Number of Undo data blocks read from buffer cache

3

Physical reads

Number of blocks read from the disk

4

Redo size

Size of the redo generated by DML

5

Sorts (memory)

Sorting amount executed in memory

6

Sorts (Disk)

Number of orders executed on the disk

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.