ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 查询25 个滥用磁盘读操作的最主要语句

查询25 个滥用磁盘读操作的最主要语句

原创 Linux操作系统 作者:golden_zhou 时间:2011-09-16 15:47:54 0 删除 编辑
set serverout on size 1000000
declare
top25 number;
text1 varchar2(4000);
x number;
len1 number;
cursor c1 is
select disk_reads, substr(sql_text,1,4000)
from v$sqlarea
order by disk_reads desc;
begin
dbms_output.put_line('Reads'||' '||'Text');
dbms_output.put_line('----------'||' '||'----------------------');
open c1;
for i in 1..25 loop
fetch c1 into top25, text1;
dbms_output.put_line(rpad(to_char(top25),9)||' '||substr(text1,1,66));
len1:=length(text1);
x:=66;
while len1 > x-1 loop
dbms_output.put_line('" '||substr(text1,x,66));
x:=x+66;
end loop;
end loop;
end;
/

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/25198367/viewspace-707731/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-03-09

  • 博文量
    238
  • 访问量
    344444