授权普通非DBA用户可以有权限查看执行计划的方法
drop table PLAN_TABLE;
删除原plan表
执行ORACLE自带的创建脚本
@?/rdbms/admin/utlxplan.sql
创建同义词
create or replace public synonym plan_table for plan_table;
授权
grant all on plan_table to public;
利用ORACLE自带的脚本创建角色
@?/sqlplus/admin/plustrce.sql
drop role plustrace;
删除角色
再新建该角色
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 select,update,insert,delete on plan_table to plustrace;
grant select,update,insert,delete on v_$mystat to plustrace;
grant plustrace to dba with admin option;
grant plustrace to public;
set echo off