您的位置:首页 > 其它

SP2-0618、SP2-0611 PLUSTRCE授权错误

2014-05-19 22:05 302 查看
SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enable

SP2-0611: Error enabling STATISTICS report

非sys用户使用autotrace来获得执行计划报如下错误

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

至此问题解决
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: