1,cd [oracle_home]\rdbms\admin;
2, run @utlxplan;
3, create public synonym plan_table to public; --no need to run in oracle10,oracle default
4, grant all on plan_table to public;--no need to run in oracle10,oracle default, here public can be any user;
----create role plustrace and grant it to user
1, cd [oracle_home]\sqlplus\admin;
2, conn sqlplus as sysdba;
3, run @plustrce;
4, grant plustrace to public;
---test
1, conn sqlplus with user scott;
1.1, set autotrace on;
2, run : select * from dual;
3, show stat info;
--1.1 可選項(xiàng): set autotrace off: 不生成報(bào)告,默認(rèn);
set autotrace on explain: 報(bào)告只顯示優(yōu)化器執(zhí)行路徑;
set autotrace on statistics: 報(bào)告只顯示sql語句執(zhí)行統(tǒng)計(jì)信息;
set autotrace on: 報(bào)告顯示優(yōu)化器執(zhí)行路徑,sql語句統(tǒng)計(jì)信息;
set autotrace traceonly: 報(bào)告顯示優(yōu)化器執(zhí)行路徑,sql語句統(tǒng)計(jì)信息,不顯示查詢輸出;
ref:oracle 9i、10g編程藝術(shù)。
posted on 2009-03-16 22:35
donnie 閱讀(106)
評論(0) 編輯 收藏 所屬分類:
database