首页 > 其他 > 详细

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

时间:2019-03-13 22:35:25      阅读:152      评论:0      收藏:0      [点我收藏+]
SQL> conn scott/oracle
Connected.
SQL> set autotrace traceonly;
SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabled
SP2-0611: Error enabling STATISTICS report
SQL> conn / as sysdba 
Connected.
SQL> @$ORACLE_HOME/sqlplus/admin/plustrce.sql
SQL> 
SQL> drop role plustrace;
drop role plustrace
*
ERROR at line 1:
ORA-01919: role PLUSTRACE does not exist


SQL> create role plustrace;

Role created.

SQL> 
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> 
SQL> set echo off
SQL> su - oracle
SP2-0734: unknown command beginning "su - oracl..." - rest of line ignored.
SQL> 
SQL> 
SQL> conn scott/oracle
Connected.
SQL> 
SQL> 
SQL> 
SQL> set linesize 2000 pagesize 2000
SQL> 
SQL> 
SQL> set autotrace traceonly;
SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabled
SP2-0611: Error enabling STATISTICS report
SQL> 
SQL> 
SQL> conn / as sysdba
Connected.
SQL> grant PLUSTRACE to scott;

Grant succeeded.

SQL> conn scott/oracle
Connected.
SQL> set linesize 2000 pagesize 2000
SQL> set autotrace traceonly;





==========================================================================



平常都用sys,system用户使用autotrace,今天使用其他用户执行set autotrace 的时候报错:
SP2-0618: Cannot find the Session Identifier.  Check PLUSTRACE role is enabled
SP2-0611: Error enabling STATISTICS report

是该用户没有授予PLUSTRACE这个角色的权限。
SYS AS SYSDBA@oemrep>grant PLUSTRACE to test2;
grant PLUSTRACE to test2
      *
ERROR at line 1:
ORA-01919: role PLUSTRACE does not exist

授权发现PLUSTRACE角色不存在,查看官方文档后执行以下sql
SYS AS SYSDBA@oemrep>@$ORACLE_HOME/sqlplus/admin/plustrce.sql
SYS AS SYSDBA@oemrep>
SYS AS SYSDBA@oemrep>drop role plustrace;
drop role plustrace
          *
ERROR at line 1:
ORA-01919: role PLUSTRACE does not exist

SYS AS SYSDBA@oemrep>create role plustrace;

Role created.
SYS AS SYSDBA@oemrep>
SYS AS SYSDBA@oemrep>grant select on v_$sesstat to plustrace;

Grant succeeded.
SYS AS SYSDBA@oemrep>grant select on v_$statname to plustrace;

Grant succeeded.
SYS AS SYSDBA@oemrep>grant select on v_$mystat to plustrace;

Grant succeeded.
SYS AS SYSDBA@oemrep>grant plustrace to dba with admin option;

Grant succeeded.
SYS AS SYSDBA@oemrep>grant PLUSTRACE to test2;

Grant succeeded.

问题解决。
  

 

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

原文:https://www.cnblogs.com/chendian0/p/10527005.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!