SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is

SP2-0618: Cannot find the Session Identifier.Check PLUSTRACE role is enablesql

之前一直用SYS用户使用autotrace,今天用其它用户使用autotrace来得到执行计划报以下错误数据库

SQL> set autotrace onide

SP2-0618: Cannot find the Session Identifier.Check PLUSTRACE role is enabledspa

SP2-0611: Error enabling STATISTICS reporget

第一反应是授予用用户plustrace角色it

SQL> conn / as sysdbaio

Connected.class

SQL>grant plustrace to oak;im

grant plustrace to oak数据

*

ERROR at line 1:

ORA-01919: role 'PLUSTRACE' does not exist

报角色不存在错误

plustrace角色在数据库建立时并不会建立

这个角色可经过运行下面的sql来建立

$ORACLE_HOME/sqlplus/admin/plustrce.sql

授予用户plustrace角色

SQL> grant plustrace to oak;

Grant succeeded.

启用autotrace

SQL> set autotrace on

至此问题解决
相关文章
相关标签/搜索