启用autorace 的两个要素

来源:互联网 发布:windows gcc编译器 编辑:程序博客网 时间:2024/06/05 01:12

autotrace 是DBA 对SQL分析的必要工具

它的启用必须具备两个要素

plustrace职责 -- 查看状态视图的权限

plan_table表--存储plan的表

plustrace

plustrace.sql 建立,分配给要使用autotrace的用户

@plustrace

grant plustrace to test

plan_table

utlplan.sql 建立 share to user who use autotrace

@utlplan.sql

grant all on plan_table to test;

create public synonym plan_table for plan_table;

SET AUTOTRACE OFF -- 不生成AUTOTRACE 报告,这是缺省模式
SET AUTOTRACE ON EXPLAIN --AUTOTRACE只显示优化器执行路径报告
SET AUTOTRACE ON STATISTICS -- 只显示执行统计信息
SET AUTOTRACE ON --包含执行计划和统计信息
SET AUTOTRACE TRACEONLY --同set autotrace on,但是不显示查询输出

原创粉丝点击