1:建立plan_table:
@$ORACLE_HOME/rdbms/admin/utlxplan.sql
2:建立plustrace的role;
@$ORACLE_HOME/sqlplus/admin/plustrce.sql
3:Grant需要trace的user权限;
sql〉grant plustrace to scott;
4:进入sqlplus中执行下列命令;
set autotrace on;
显示执行结果,execution plan and statistics;
set autotrace on explain;
只显示执行结果和execution plan
set autotrace statictics;
只显示执行结果和statistics,
set autotrace tranceonly;
不显示执行结果,只显示execution Plan 和statistics
set autotrace traceonly explain
不显示执行结果,只显示execution Plan
set autotrace traceonly statistics
不显示执行结果,只显示statistics
set autotrace off
关闭autotrace
5:执行sql Scripts;
阅读(730) | 评论(0) | 转发(0) |