Chinaunix首页 | 论坛 | 博客
  • 博客访问: 90342900
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类: Oracle

2008-03-31 22:41:06

来源:赛迪网    作者:30341

很多情况下我们需要获取或记录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>
阅读(558) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~