root 계정에서 pid.sh, pid.sql 생성하여 실행
1) pid.sh
========================================================================
su - oracle -c "sqlplus -S / as sysdba << EOF
@~/pid.sql $1
exit
EOF"
========================================================================
2) pid.sql
========================================================================
select /*+ use_hash(a,b,c) */
a.username, a.program, a.machine, a.module, b.spid, a.sid, a.serial#, a.sql_hash_value,
d.PHYSICAL_READS, d.BLOCK_GETS, c.sql_text
from v$session a, v$process b, v$sql c, v$sess_io d
where b.spid = '&pid'
and b.addr = a.paddr
and a.sid = d.sid
and a.sql_hash_value = c.hash_value(+)
and a.sql_address = c.address(+);
========================================================================
3) 실행
pid.sh [process no]
'Oracle' 카테고리의 다른 글
Prometheus + Grafana 를 활용한 Oracle 모니터링(oracledb exporter) (0) | 2023.04.21 |
---|---|
Linux 설치 후 Oracle RAC 환경 구성 절차 (0) | 2023.04.07 |
Oracle DB DBMS를 가상화(vmware) 환경에 구성할 경우 라이센스(license) 문제 (0) | 2023.04.06 |
Oracle 용도로 NAS를 마운트 할 때 옵션 (0) | 2023.03.10 |
oracleasm 구성 (0) | 2022.06.24 |
댓글