database.sarang.net
UserID
Passwd
Database
DBMS
MySQL
PostgreSQL
Firebird
ㆍOracle
Informix
Sybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
Oracle Q&A 2533 게시물 읽기
No. 2533
Response time 이 10초 이상인 SQL source
작성자
나그네
작성일
2000-12-30 16:23
조회수
2,199

Doc

Name: SQL_10SEC.sql

Author: Mahnho Han

List all SQL statements that have a response time more than 10 seconds

#

column nl newline;

set heading off

set pagesize 9999

set linesize 80

set echo off

set feedback off

set verify off

column runt format 999,999.99 newline;

spool diskread.sql

 

select ' ' nl,'doc' nl,translate(sql_text,'&',':') nl,

' Expected Run Time = '||

DISK_Reads / decode(executions,0,1,executions) / 50 runt,

' Executions = ' || executions nl,

'#' nl,

'delete sys.han_table;' nl,

'explain plan into sys.han_table for ' nl,

sql_text ||';' nl,

'@$HOME/mhan/plan '

from v$sqlarea

where disk_reads / decode(executions,0,1,executions) / 50 > 10

and upper(sql_text) not like '%BEGIN%'

and upper(sql_text) not like '%SQLAREA%'

and upper(sql_text) not like '%DBA_%'

and upper(sql_text) not like '%USER_%'

and upper(sql_text) not like '%ALL_%'

order by executions desc

/

spool off

spool bufget.sql

select ' ' nl,

'doc' nl,

translate(sql_text,'&',':') nl,

' Expected Run Time = '||

buffer_gets / decode(executions,0,1,executions) / 500 runt,

' Executions = ' || executions nl,

'#' nl,

'delete sys.han_table;' nl,

'explain plan into sys.han_table for ' nl,

sql_text ||';' nl,

'@$HOME/mhan/plan '

from v$sqlarea

where buffer_gets / decode(executions,0,1,executions) / 500 > 10

and upper(sql_text) not like '%BEGIN%'

and upper(sql_text) not like '%SQLAREA%'

and upper(sql_text) not like '%DBA_%'

and upper(sql_text) not like '%USER_%'

and upper(sql_text) not like '%ALL_%'

order by executions desc

/

spool off

spool badstmt.lis

doc

got an excessive number of disk reads

#

@diskread.sql

doc

got an excessive number of scan through the buffer cache.

#

@bufget.sql

spool off

[Top]
No.
제목
작성자
작성일
조회
2537[Q]리스너가 한번 연결연결후 끊고 나면 다음부터는 아답터 에러발생합니다!
중짜
2001-01-01
1876
2535오라클과 asp를 연결할려구 하는데...
한은석
2000-12-30
2051
2534Explain plain
나그네
2000-12-30
2716
2533Response time 이 10초 이상인 SQL source
나그네
2000-12-30
2199
2532현재 running 중인 SQL 의 조회
나그네
2000-12-30
2283
2531어떤 object 에 어떤 lock 이 진행중인가?
나그네
2000-12-30
2226
2530Rollback segment 는 충분한가?
나그네
2000-12-30
1850
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.018초, 이곳 서비스는
	PostgreSQL v16.4로 자료를 관리합니다