Oracle 工具:tkprof

WBOY
Release: 2016-06-07 17:20:24
Original
982 people have browsed it

有一对参数非常重要,fetch的次数以及取得的记录的行数,一般来说,以尽可能少的fetch来取得尽可能多的记录数,也就是,fetch的值

1 定义

用于分析Oracle跟踪文件并且可按需产生一个更加清晰合理的输出结果的可执行工具

2 首选项

注释:

① fchela这是个比较有用的sort选项,在生成的.prf文件将把最消耗时间的sql放在最前面显示

② sys=no 以sys身份执行的sql不会被显示,增加可读性

3 tkprof输出文件中各列的含义

  • 注释:

    ㈠ call:

    每次sql的处理都分成3个部分

    ① parse:将sql语句转成执行计划,包括检查权限、表及其关联对象是否存在等

    ② execute:由sql引擎执行,因事务类型不同而异

    ③ fetch:这步只有select语句被执行,buffer cache是主战场

    ㈡ count:

    这条sql被parse、execute和fetch的次数

    ㈢ cpu:该sql语句所消耗的cpu的时间(单位:s)

    ㈣ elapsed:该sql语句在各个阶段的执行时间

    ㈤ disk:

    从磁盘上的数据文件中物理读取的块的数量

    ㈥ query:

    在一致性读的模式下,各阶段所获得的buffer的数量。一致性模式下,buffer是用于给一个长查询提供一致性

    读的快照

    ㈦ current:

    在当前读的模式下,各阶段所获得的buffer的数量。

    ㈧ rows:

    所有的sql返回的记录数目,但不包括子查询返回的记录。

    对于select语句,返回是在fetch这步

    对于DML语句,,返回是在execute这步

    linux

  • Related labels:
    source:php.cn
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!