SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enable
以前一直用 SYS 用户使用 autotrace,
今天用其它用户使用 autotrace 来获得执行计划报如下错误
SQL> set autotrace on
SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabled
SP2-0611: Error enabling STATISTICS repor
授予用户 plustrace 角色
SQL> conn / as sysdba
Connected.SQL> grant plustrace to scott;
grant plustrace to scott
*ERROR at line 1:ORA-01919: role 'PLUSTRACE' does not exist
报角色不存在错误
plustrace 角色在数据库,创建时并不会创建这个角色
运行$ORACLE_HOME/sqlplus/admin/plustrce.sql
授予用户 plustrace 角色
SQL> grant plustrace to scott;
autotraceSQL> set autotrace on