SP2-0613: Unable to verify PLAN_TABLE format or existence
SP2-0611: Error enabling EXPLAIN report
SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabled
SP2-0611: Error enabling STATISTICS report
create role plustrace;
grant select on v_$sesstat to plustrace;
grant select on v_$statname to plustrace;
grant select on v_$session to plustrace;
grant plustrace to dba with admin option;D.将 plustrace 角色授予当前用户(无 DBA 角色的用户)。
序号
|
命令
|
解释
|
1
|
SET AUTOTRACE OFF
|
此为默认值,即关闭Autotrace
|
2
|
SET AUTOTRACE ON
|
产生结果集和解释计划并列出统计
|
3
|
SET AUTOTRACE ON EXPLAIN
|
显示结果集和解释计划不显示统计
|
4
|
SETAUTOTRACE TRACEONLY
|
显示解释计划和统计,尽管执行该语句但您将看不到结果集
|
5
|
SET AUTOTRACE
TRACEONLY STATISTICS
|
只显示统计
|
序号
|
列名
|
解释
|
1
|
ID_PLUS_EXP
|
每一步骤的行号
|
2
|
PARENT_ID_PLUS_EXP
|
每一步的Parent的级别号
|
3
|
PLAN_PLUS_EXP
|
实际的每步
|
4
|
OBJECT_NODE_PLUS_EXP
|
Dblink或并行查询时才会用到
|
序号
|
列名
|
解释
|
1
|
db block gets
|
从buffer cache中读取的block的数量
|
2
|
consistent gets
|
从buffer cache中读取的undo数据的block的数量
|
3
|
physical reads
|
从磁盘读取的block的数量
|
4
|
redo size
|
DML生成的redo的大小
|
5
|
sorts (memory)
|
在内存执行的排序量
|
7
|
sorts (disk)
|
在磁盘上执行的排序量
|
SQL> connect / as sysdba
create role plustrace;
grant select on v_$sesstat to plustrace;
grant select on v_$statname to plustrace;
grant select on v_$mystat to plustrace;
grant select on v_$session to plustrace;
grant plustrace to dba with admin option;D.将 plustrace 角色授予当前用户(无 DBA 角色的用户)。
或grant plustrace to public;
问题解