본문 바로가기

Oracle/admin

batch 파일중 SQL 부하 찾기

1)module name으로 찾기(모듈지정시 사용가능)
select t1.module,t1.substr_sqltext,t1.executions,t1.buffer_gets
from (
select parsing_schema_name schema,
module,
sql_id,
hash_value,substr(sql_text,1,37) substr_sqltext,
executions,
buffer_gets,
disk_reads,
rows_processed,
round(buffer_gets/executions,1) lio,
round(elapsed_time/executions/1000000,1) elapsed_sec,
round(cpu_time/executions/1000000,1) cpu_sec
from v$sqlarea s
where s.module = 'BatchTest'  --module name
order by 7 desc
)t1
where rownum <=50;



2)object_name 으로 찾기
select sql_text,sql_fulltext,module,program_id,buffer_gets
from v$sqlarea
where program_id in (
select object_id
from dba_objects
where object_name in ('PLSQL_BATCH_1','PLSQL_BATCH_2')) ; --object_name

'Oracle > admin' 카테고리의 다른 글

패스워드 verify 설정 및 해제  (0) 2016.06.14
Oracle TDE  (0) 2016.06.14
Migration Step  (0) 2016.06.13
rman  (0) 2016.06.13
Oracle option  (0) 2016.06.13