|
½ÇÇà°èȹÀ» º¼¼ö ÀÖ´Â ¹æ¹ýÀº ¾Æ·¡¿Í °°ÀÌ ¼¼°¡Áö°¡ ÀÖ´Ù
1. autotrace
2. explain plan
3. tkprof
1. autotrace »ç¿ë¹æ¹ý
SQL> set autotrace on;
=> sqlÀ» ½ÇÇàÇÑ ÈÄ¿¡ Ç×»ó ½ÇÇà°èȹÀÌ Ç¥½ÃµÈ´Ù.
2. explain plan
1) utlxplan.sql ÆÄÀÏ ½ÇÇà
SQL> @?/rdbms/admin/utlxplan.sql
2) Role ºÎ¿©
drop role plustrace;
create role plustrace;
grant select on v_$sesstat to plustrace;
grant select on v_$statname to plustrace;
grant select on v_$session to plustrace
grant plustrace to dba with admin option;
3) trace¸¦ »ç¿äÇÒ »ç¿ëÀÚ¿¡°Ô plustrace RoleÀ» ºÎ¿©ÇÑ´Ù
SQL> grant plustrace to scott;
4) autotrace¸ðµå¸¦ on»óÅ·ΠÀüÀÌÇÑ´Ù.
SQL> set autotrace on;
5) ½ÇÇàÇÒ sql¹®ÀÇ ½ÇÇà °èȹÀ» plan_table ¿¡ ÀúÀåÇÑ´Ù.
SQL> explain plan set statement_id = 'test1'
for select * from emp;
6) plan_tableÀ» Á¶È¸ÇÏ¿© ½ÇÇà °èȹÀ» Á¶È¸ÇÏ·Á¸é
SQL> select id, parent_id, operation, options, object_name
from plan_table
where statement_id ='TEST1'
ÀÌ·¸°Ô ¼³Á¤À» ÇسõÀ¸¸é select * from emp SQL¹® »ç¿ë¿¡ ´ëÇÑ
excute planÀ» »ìÆì º¼¼ö ÀÖ´Ù.
3. tkprofÀÇ »ç¿ë¹æ¹ý
1) trace ÆÄÀÏÀº admin/udump¿¡ °¡º¸¸é º¼¼ö ÀÖ´Ù.(ORA01455.trc)
2) tkprof ORA01455.trc emp.txt ÀÌ·± Çü½ÄÀ¸·Î ÆÄÀÏÀ» º¯È¯ÇÑ´Ù
|