Oracle查询执行时间 [英] Oracle query execution time

查看:116
本文介绍了Oracle查询执行时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获取Oracle中的查询执行时间.我不希望Oracle需要打印结果的时间-只是执行时间.

I would like to get the query execution time in Oracle. I don't want the time Oracle needs to print the results - just the execution time.

在MySQL中,很容易从shell中获取执行时间.

In MySQL it is easy to get the execution time from the shell.

如何在 SQL * Plus 中执行此操作?

推荐答案

一个人可以发出SQL * Plus命令SET TIMING ON来获取挂钟时间,但是例如,一个人不能从中获取时间琐碎的.

One can issue the SQL*Plus command SET TIMING ON to get wall-clock times, but one can't take, for example, fetch time out of that trivially.

AUTOTRACE设置(用作SET AUTOTRACE TRACEONLY时)将禁止输出,但仍将执行所有工作来满足查询并将结果发送回SQL * Plus,从而将其禁止.

The AUTOTRACE setting, when used as SET AUTOTRACE TRACEONLY will suppress output, but still perform all of the work to satisfy the query and send the results back to SQL*Plus, which will suppress it.

最后,人们可以跟踪SQL * Plus会话,并手动计算花费在等待客户端等待的事件上的时间,例如向客户端发送的SQL * Net消息",来自客户端的SQL * Net消息".

Lastly, one can trace the SQL*Plus session, and manually calculate the time spent waiting on events which are client waits, such as "SQL*Net message to client", "SQL*Net message from client".

这篇关于Oracle查询执行时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆