SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enable
SQL> set autotrace on
SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabled
SP2-0611: Error enabling STATISTICS report
第一反应是授予用用户plustrace角色
SQL> conn / as sysdba
Connected.
SQL> grant plustrace to oe;
grant plustrace to oe
*
ERROR at line 1:
plustrace角色在数据库创建时并不会创建
这个角色可通过运行下面的sql来创建
$@?/sqlplus/admin/plustrce.sql
SQL> drop role plustrace;
Role dropped.
SQL> create role plustrace;
Role created.
SQL> grant select on v_$sesstat to plustrace;
Grant succeeded.
SQL> grant select on v_$mystat to plustrace;
Grant succeeded.
SQL> grant plustrace to dba with admin option;
Grant succeeded.
SQL> set echo off
授予用户plustrace角色
SQL> grant plustrace to oe;
Grant succeeded.
至此问题解决
SP2-0611: Error enabling STATISTICS report
SQL> set autotrace on
SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabled
SP2-0611: Error enabling STATISTICS report
第一反应是授予用用户plustrace角色
SQL> conn / as sysdba
Connected.
SQL> grant plustrace to oe;
grant plustrace to oe
*
ERROR at line 1:
ORA-01919: role 'PLUSTRACE' does not exist
plustrace角色在数据库创建时并不会创建
这个角色可通过运行下面的sql来创建
$@?/sqlplus/admin/plustrce.sql
SQL> drop role plustrace;
Role dropped.
SQL> create role plustrace;
Role created.
SQL> grant select on v_$sesstat to plustrace;
Grant succeeded.
SQL> grant select on v_$statname to plustrace;Grant succeeded.
SQL> grant select on v_$mystat to plustrace;
Grant succeeded.
SQL> grant plustrace to dba with admin option;
Grant succeeded.
SQL> set echo off
授予用户plustrace角色
SQL> grant plustrace to oe;
Grant succeeded.
启用oe用户autotrace
SQL>conn oe/oe
SQL> set autotrace on至此问题解决
本文介绍了解决Oracle数据库中非sys用户使用Autotrace功能时出现的SP2-0618和SP2-0611错误的方法。通过创建并授予plustrace角色给用户,使用户能够成功启用Autotrace获取执行计划。
629

被折叠的 条评论
为什么被折叠?



