如何获取或记录Oracle语句执行时间

王朝oracle·作者佚名  2008-05-31
窄屏简体版  字體: |||超大  

很多情况下我们需要获取或记录Oracle语句执行时间,其实简单的方法就能实现,具体代码如下:

OracleE语句的执行时间需要使用 SET TIMING ON,例如:

[oracle@jw ~]$ sqlplus "/as sysdba"

SQL*Plus: Release 9.2.0.4.0 - ProdUCtion on

星期二 8月 28 16:59:43 2007

Copyright (c) 1982, 2002, Oracle

Corporation. All rights reserved.

连接到:

Oracle9i Enterprise Edition

Release 9.2.0.4.0 - Production

With the Partitioning, Oracle Label Security,

OLAP and Oracle Data Mining options

JServer Release 9.2.0.4.0 - Production

SQL> set timing on;

SQL> select count(*) from tab;

COUNT(*)

----------

2447

已用时间: 00: 00: 00.12

SQL>

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航