经过baidu一番,原来是这个版本的plustrce.sql里有bug,少了对一个系统表的grant授权。
执行
grant select on v_$sesstat to plustrace;
grant select on v_$statname to plustrace;
grant select on v_$mystat to plustrace;
后即可
-------------------
btw:打开set autotrance功能的脚本
1.用sys用户运行脚本ultxplan.sql
建立这个表的脚本是:(UNIX:$ORACLE_HOME/rdbms/admin, Windows:%ORACLE_HOME%rdbmsadmin)ultxplan.sql。
SQL> connect sys/sys@colm2 as sysdba;
SQL> @C:oracleora92rdbmsadminutlxplan.sql;
SQL> create public synonym plan_table for plan_table; --建立同义词
SQL> grant all on plan_table to public;--授权所有用户
2.要在数据库中建立一个角色plustrace,用sys用户运行脚本plustrce.sql来创建这个角色,这个脚本在目录(UNIX:$ORACLE_HOME/sqlplus/admin, Windows:%ORACLE_HOME%sqlplusadmin)中;
SQL> @C:oracleora92sqlplusadminplustrce.sql;
3.然后将角色plustrace授予需要autotrace的用户;
SQL>grant plustrace to public;
* plustrace角色只是具有以下权限:
grant select on v_$sesstat to plustrace;
grant select on v_$statname to plustrace;
grant select on v_$mystat to plustrace;
grant plustrace to dba with admin option;
plustrce.sql脚本如下
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;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/8193225/viewspace-1007230/ ,如需转载,请注明出处,否则将追究法律责任。