ORACLE 10.2.0.1下启用autotrace。

ORACLE 10.2.0.1下启用autotrace。
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 可选项: set autotrace off: 不生成报告,默认;
                           set autotrace on explain: 报告只显示优化器执行路径;
                           set autotrace on statistics: 报告只显示sql语句执行统计信息;
                           set autotrace on: 报告显示优化器执行路径,sql语句统计信息;
                            set autotrace traceonly: 报告显示优化器执行路径,sql语句统计信息,不显示查询输出;

                          
ref:oracle 9i、10g编程艺术。

                         


你可能感兴趣的:(ORACLE 10.2.0.1下启用autotrace。)