SP2-0618: Cannot find&…

来源:互联网 发布:淘宝联盟推广没有图片 编辑:程序博客网 时间:2024/06/04 18:38

SP2-0618: Cannot find the SessionIdentifier.  Check PLUSTRACE roleis enable

 

以前一直用 SYS 用户使用 autotrace, 今天用其它用户使用 autotrace 来获得执行计划报如下错误

SQL> set autotrace on

SP2-0618: Cannot find the SessionIdentifier.  Check PLUSTRACE roleis enabled

SP2-0611: Error enabling STATISTICS repor

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

SQL> conn / as sysdba

Connected.

SQL>  grant plustrace tooak;

  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

0 0
原创粉丝点击