---
title: "TOPSQL查询"
author: "hotjava"
date: "2008-05-06T11:06:25Z"
tags: []
slug: "topsql"
draft: false
lastmod: "2008-05-06T11:06:25Z"
id: 190078
url: "https://hotjava.iteye.com/blog/190078"
---

select rownum as rank, a.*  
from (  
   select elapsed\_Time,  
       executions,  
       buffer\_gets,  
       disk\_reads,  
       cpu\_time  
       hash\_value,  
      sql\_text  
   from  v$sqlarea  
   where elapsed\_time &gt; 20000  
   order by elapsed\_time desc) a  
where rownum &lt; 11