在sqlplus中set autotrace on 出错的解决办法
上一篇 /
下一篇 2007-03-26 11:12:19
A:在sqlplus打开执行计划的时候出现如下问题
SQL> set autotrace on exp
SP2-0613: Unable to verify PLAN_TABLE format or existence
SP2-0611: Error enabling EXPLAIN report
Q:该错误的的主要原因是由于当前用户下没有PLAN_TABLE这张表及相应的PLUSTRACE角色权限,解决方法如下:
$sqlplus /as sysdba
SQL>@$?/rdbms/admin/utlxplan
SQL>create public synonym plan_table for plan_table
SQL>grant all on plan_table to public
SQL>@?/sqlplus/admin/plustrce
如果用户没有DBA权限,还需要将plustrace角色授予当前用户
SQL>grant plustrace to public
SQL>set autotrace on exp
SQL>set timing on
SQL>
eg:SET AUTOTRACE ON, set timing on, alter session set time_statistics=true;
注:set autotrace explain不会执行语句,所以不会显示statistic
set autotrace traceonly会执行语句,但是不输出结果
收藏
举报
TAG: