用帐户scott登录sqlplus后启用autotrace功能报错
SQL> set autotrace on exp stat
SP2-0618: 无法找到会话标识符。启用检查PLUSTRACE角色
SP2-0611: 启用STATISTICS报告时出现错误
********************************************
解决方法:
1.以SYS用户登录:
SQL> connect sys/manager123@orcl as sysdba
2.运行utlxplan.sql(...\10.2.0\db_1\RDBMS\ADMIN下)脚本建立plan_table
3.运行plustrace.sql(...\10.2.0\db_1\sqlplus\admin下)脚本穿件plustrace角色
drop role plustrace;
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 plustrace to dba with admin option;
将plustrace角色授予public用户(或指定scott用户)
grant plustrace to public;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10314474/viewspace-659751/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/10314474/viewspace-659751/