Äõ¸®¹®ÀÌ Á¦´ë·Î Index¸¦ Ÿ´ÂÁö È®ÀÎÇÏ´Â ¹æ¹ý
ÀÛ¼ºÀÚ °ü¸®ÀÚ ÀÛ¼º½Ã°£ 2007-07-04 17:49:17
 

ƯÁ¤ Å×À̺íÀ» »ç¿ëÇÏ´Â ¸¹Àº sql ¹®ÀåµéÀÌ ÀÖ°í, ÀÌ ¹®ÀåµéÀÌ index¸¦ Á¦´ë·Î Ÿ°í ÀÖ´ÂÁö ¾Æ´Ï¸é full scan ÇÏ´ÂÁö¸¦ ¾Æ´Â ¹æ¹ý.


1. »ç¿ë SQL¹® Á¶È¸
  - v$sql, v$sqlarea, v$sqltext ... etc ... ÀÌ¿ë

ex)  select *
      from v$sqlarea
      where sql_text like '%table_name%';

2. EXPLAIN PLAN »ç¿ë¹ý ¿¹Á¦ (sql script°æ·Î´Â OS ¶Ç´Â install °æ·Î¿¡ µû¶ó ´Ù¸§)

ex)

c:> sqlplus "/as sysdba"

sql> @c:/oracle/ora81/sqlplus/admin/plustrce.sql [plustrce.sql script ½ÇÇà]

sql> grant plustrace,dba to scott; [dba ±ÇÇѺο©]

sql> connect scott/tiger [DB connect]

sql> @c:/oracle/ora81/rdbms/admin/utlxplan.sql [utlxplan.sql script ½ÇÇà]


SQL> set autotrace traceonly; [autotrace ¼³Á¤]
-- traceonly: Ãâ·Â°á°ú µ¥ÀÌÅÍ´Â ¹èÁ¦

SQL> select * from big_emp where deptno = 10; [´ë»ó SQL¹® ½ÇÇà]

5001 °³ÀÇ ÇàÀÌ ¼±ÅõǾú½À´Ï´Ù.

Execution Plan
----------------------------------------------------------
  0      SELECT STATEMENT Optimizer=CHOOSE
  1    0  TABLE ACCESS (FULL) OF 'BIG_EMP'

Statistics
----------------------------------------------------------
          0  recursive calls
          4  db block gets
        534  consistent gets
          0  physical reads
          0  redo size
    521889  bytes sent via SQL*Net to client
      39830  bytes received via SQL*Net from client
        357  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
      5336  rows processed

SQL> set autotrace off; [autotrace ÇØÁ¦]


¸ñ·Ï | ÀÔ·Â | ¼öÁ¤ | ´äº¯ | »èÁ¦