Contents

1 蟆暑り鍵
2 PLAN_TABLE, 蠍磯蠍
3 企 糾 覿


1 蟆暑り鍵 #

1. 襾殊..螳 殊 曙 ろ.
$ORACLE_HOME/admin/rdbms/utlxplan.sql

2. DBA蟠 螳讌 襦 襦蠏語
$ORACLE_HOME/sqlplus/admin/plustrce.sql ろ

-> V$れ select蟠 螳
-> DBA蟆 plustrace 螳

grant plustrace to scott;
set autotrace on

2 PLAN_TABLE, 蠍磯蠍 #

  1. EXPLAIN PLAN SET STATEMENT_ID = 'TEST' FOR
  2. SELECT * FROM EMP;
  3.  
  4. SELECT LPAD(OPERATION, LENGTH(OPERATION) + 2 * (LEVEL -1)) ||
  5.        DECODE(ID, 0, 'Cost Estimate:' || DECODE(POSITION, '0', 'N/A', POSITION), NULL) || ''|| OPTIONS || 
  6.        DECODE(OBJECT_NAME, NULL, NULL, ':') || RPAD(OBJECT_OWNER, LENGTH(OBJECT_NAME) + 1, ',') || OBJECT_NAME ||
  7.        DECODE(OBJECT_TYPE, 'UNIQUE', ' (U) ', 'NIN_UNIQUE', '(NU)', NULL) ||
  8.        DECODE(OBJECT_INSTANCE, NULL, NULL, '('|| OBJECT_INSTANCE || ')') PLAN
  9. FROM PLAN_TABLE
  10. START WITH ID = 0 AND STATEMENT_ID = 'TEST'
  11. CONNECT BY PRIOR ID = PARENT_ID AND STATEMENT_ID = 'TEST';  
  12.  
* IE拭辞 社什 差紫獣 匝郊嘩 照喫. MS-Word 去拭 細食 隔生室推. 匝郊嘩 鞠澗 崎虞酔煽: Chrome, Opera, Safari

3 企 糾 覿 #

  1. BEGIN
  2. DBMS_STATS.gather_table_stats(ownname=> 'SCOTT', tabname=> 'EMP', partname=> NULL);
  3. END; 
  4.  
* IE拭辞 社什 差紫獣 匝郊嘩 照喫. MS-Word 去拭 細食 隔生室推. 匝郊嘩 鞠澗 崎虞酔煽: Chrome, Opera, Safari