아래 문장은 1000 byte 이상을 차지하는 문장을 찾아 내는 SQL 입니다. 참고하세요~
SQL> select deptno, sum(sal)
2 from emp
3 group by deptno
4 having sum(sal) > 1000;
DEPTNO SUM(SAL)
---------- ----------
10 8750
20 10875
30 9400
SQL> conn / as sysdba
연결되었습니다.
SQL> select substr(sql_text,1,60) "Statement",
2 count(*),
3 sum(sharable_mem) " Memory",
4 sum(users_opening) "Open",
5 sum(executions) "Exec"
6 from v$sql
7 where sql_text like '%emp%'
8 group by substr(sql_text,1,60)
9 having sum(sharable_mem) > 1000
10 /
Statement
--------------------------------------------------------------------------------
COUNT(*) Memory Open Exec
---------- ---------- ---------- ----------
select deptno, sum(sal) from emp group by deptno having sum(
1 8636 0 1
SQL> select deptno, sum(sal)
2 from emp
3 group by deptno
4 having sum(sal) > 1000;
DEPTNO SUM(SAL)
---------- ----------
10 8750
20 10875
30 9400
SQL> conn / as sysdba
연결되었습니다.
SQL> select substr(sql_text,1,60) "Statement",
2 count(*),
3 sum(sharable_mem) " Memory",
4 sum(users_opening) "Open",
5 sum(executions) "Exec"
6 from v$sql
7 where sql_text like '%emp%'
8 group by substr(sql_text,1,60)
9 having sum(sharable_mem) > 1000
10 /
Statement
--------------------------------------------------------------------------------
COUNT(*) Memory Open Exec
---------- ---------- ---------- ----------
select deptno, sum(sal) from emp group by deptno having sum(
1 8636 0 1
'DB' 카테고리의 다른 글
[QUERY] Role (0) | 2006.07.16 |
---|---|
Oracle의 메모리 구조 – SGA(요약 (0) | 2006.07.16 |
[SQL튜닝]EXISTS 와 DISTINCT (0) | 2006.07.16 |
WHERE versus HAVING (0) | 2006.07.16 |
오라클에서 제공하는 작업 스케쥴링 사용하기 (0) | 2006.07.16 |