Oracle Tkprof Program Detailed

Source: Internet
Author: User

Now the TKPROF program to do further explanation:

After the tracing function is turned on, Oracle collects the performance state data of the SQL that is being executed by the tracking session into a trace file. This trace file provides a number of useful information, such as the number of parse times, execution times, fetch times, physical reads, logical reads, CPU usage time, and so on, that can be used to diagnose your SQL problems and to optimize your system. Unfortunately, the data in the generated trace file is difficult to understand, so convert it using the Tkprof tool and convert it into a format that we can easily understand. Tkprof is a utility provided by Oracle, similar to Sql*plus, installed automatically on the system after the Oracle client is installed, and is available directly under the command character.

When recursive calls occurs when tracing is turned on, Tkprof also produces statistics for these recursive calls, and it is clear that they are recursive calls in the name of the formatted output file.

Note: The statistics for the recursive calls are contained on the recursive calls and are not included on the SQL statement that caused the recursive statement. So when you compute the resources that an SQL statement consumes, consider the resources that the SQL statement will incur for recursive calls statements. By setting the SYS parameter to no, we change the recursive calls information to be masked in the formatted output file.

(1) How to get tkprof Help information:

When you run Tkprof, you get help for the tool with no parameters.

Execution Plan:

---------------

The execution plan for a statement is a series of instructions that Oracle executes this SQL statement. By examining the execution plan, you can better understand how Oracle executes your SQL statement, which can help you decide if the SQL statement you wrote has already been indexed.

If the explain parameter is specified in Tkprof, Tkprof uses the explain plan command to generate an execution schedule for each SQL statement being tracked.

Instructions for use:

The Tkprof tool accepts a trace file as an input file, analyzes the trace file with multiple parameters provided to the command, and then places the formatted result in an output file.

Usage syntax for tkprof:

----------------

Tkprof command:: =

"--tkprof traced_file formatted_file---------------------------------------------->

| |

+-SORT =---------------------------------+

| |

+--OPTION--+

| |

| +---- , ----+   |

|  V | |

|__ (OPTION) __|

>----------------------------------------------------------------------------->

|  |            |  |         | |

+--PRINT = integer--+ +--INSERT = Filname3--+ +--SYS =---------+

| |

+-YES-+

| |

+-NO--+

>----------------------------------------------------------------------------->

| |

+----------------------------------------EXPLAIN = user/password------+

| |

+----TABLE = schema.table----+

>----------------------------------------------------------------------------><

| |

+----record = Filname----+

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.