执行SCOTT@ORCL>set autotrace on statistics出错:
SP2-0618: 无法找到会话标识符。启用检查 PLUSTRACE 角色
解决方法:
1)以sys用户登录 C:\>sqlplus / as sysdba
输入 @C:\oracle\product\10.2.0\db_1\sqlplus\admin\plustrce.sql后出现以下信息:
SYS@ORCL>
SYS@ORCL>drop role plustrace;
角色已删除。
SYS@ORCL>create role plustrace;
角色已创建。
SYS@ORCL>
SYS@ORCL>grant select on v_$sesstat to plustrace;
授权成功。
SYS@ORCL>grant select on v_$statname to plustrace;
授权成功。
SYS@ORCL>grant select on v_$mystat to plustrace;
授权成功。
SYS@ORCL>grant plustrace to dba with admin option;
授权成功。
SYS@ORCL>
SYS@ORCL>set echo off
SYS@ORCL>
2)将plustrace 授予scott 用户:
grant plustrace to scott;
授权成功。
3)以scott登录:
SCOTT@ORCL>set autotrace on statistics;
即OK!
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/23847748/viewspace-662464/ ,如需转载,请注明出处,否则将追究法律责任。