SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabled
xixuefeng
ERR
2014-03-17 23:14:51
1,728 次浏览
SP2-0611, SP2-0618
SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabled已关闭评论
在scott用户使用set autotrace trace时,报如下错误:
1 2 3 4 |
SCOTT@PROD>set autot trace SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabled SP2-0611: Error enabling STATISTICS report SCOTT@PROD> |
这个错误描述的很清楚,检查plustrace角色是否启用,出现这个错误,要么是没有plustrace角色,要么就是没有将该角色赋予用户。
解决这个问题其实很容易:
1:利用Oracle自带的脚本重新创建以便这个角色(为了省事儿,不管数据库中是否存在这个角色,我都重新创建一次)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
SCOTT@PROD>conn / as sysdba Connected. SYS@PROD> SYS@PROD>@?/sqlplus/admin/plustrce.sql SYS@PROD> SYS@PROD>drop role plustrace; drop role plustrace * ERROR at line 1: ORA-01919: role 'PLUSTRACE' does not exist SYS@PROD>create role plustrace; Role created. SYS@PROD> SYS@PROD>grant select on v_$sesstat to plustrace; Grant succeeded. SYS@PROD>grant select on v_$statname to plustrace; Grant succeeded. SYS@PROD>grant select on v_$mystat to plustrace; Grant succeeded. SYS@PROD>grant plustrace to dba with admin option; Grant succeeded. SYS@PROD> |
2:将这个角色赋予某个用户(或者为了方便起见,直接赋予public)
1 2 3 4 5 |
SYS@CRM>grant plustrace to public; Grant succeeded. SYS@CRM> |
3:再次使用set autot trace,此时已经不报错了
1 2 3 4 5 6 |
SYS@PROD>conn scott/tiger Connected. SCOTT@PROD> SCOTT@PROD> SCOTT@PROD>set autot trace SCOTT@PROD> |