1、使用scott用户登录,set autotrace on时提示:
SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabled
SP2-0611: Error enabling STATISTICS repor
2、用sysdba登录
SQL> grant plustrace to scott;
grant plustrace to scott
*
ERROR at line 1:
ORA-01919: role 'PLUSTRACE' does not exist
3、执行@/u01/oracle/sqlplus/admin/plustrce.sql来创建plustrace角色,文件内容如下:
set echo on
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;
4、登录scott,set autotrace on.
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/17016200/viewspace-691964/
,如需转载,请注明出处,否则将追究法律责任。