Get the App
SLTechnology News&Howtos  ›  Servers  › 

How does ORACLE view the script execution plan

Shulou Source: shulou.com Published: 2022-06-01 05:05:42 10月04日 Update

This article mainly shows you "ORACLE how to view the script execution plan", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "ORACLE how to view the script execution plan" this article.

There are three ways to view:

1. EXPLAIN

2. AUTOTRACE

3. PL/SQL tool

EXPLAIN:

1. Installation:

UNIX: $ORACLE_HOME/rdbms/admin\ ultxplan.sql

Windows:%ORACLE_HOME%\ rdbms\ admin\ ultxplan.sql

two。 Establish:

Set feedback on

Explain plan set statement_id='T_TEST' for select * from hr.employees

3. View:

Select * from plan_table

AUTOTRACE:

1. Installation:

UNIX: $ORACLE_HOME/rdbms/admin\ ultxplan.sql

Windows:%ORACLE_HOME%\ rdbms\ admin\ ultxplan.sql

two。 To establish a synonym or authorize:

Create public synonym plan_table for plan_table;-- establishes synonyms

Grant all on plan_table to public;-- authorizes all users

3. Run the script:

UNIX:$ORACLE_HOME/sqlplus/admin/plustrce.sql

Windows:%ORACLE_HOME%\ sqlplus\ admin\ plustrce.sql

Grant plustrace to public

4. Use:

View the execution plan:

Set autotrace on explain

Select * from hr.employees

View the statistical results:

Set autotrace on statictics

Select * from hr.employees

The above is all the contents of the article "how to check the script execution Plan for ORACLE". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Scripts content articles synonyms synonyms learning help tools ways easy to understand more organization users knowledge results editing industry information information channels channels Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple vpn Huawei Xiaomi Docker