SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabled
SP2-0611: Error enabling STATISTICS report
在asktom网上的回复可以使用如下方法设置:
I believe you have slightly mismatched versions of SQLPlus and database.
9203 and up use v$mystat
9202 and before use v$session
9201 client and lower queries v$session
9203 client and higher queries v$mystat
make sure plustrace has select on v$mystat and v$session or use the same version
of sqlplus as database.
我的Oracle server和SQL*Plus的版本都是 Release 11.2.0.1.0,找到原因了
查看sqlpplus的版本的方法如下:
[weiywang@slc00bjg ~]$ sqlplus -v
SQL*Plus: Release 11.2.0.1.0 Production
查看Database的方法如下:
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
SQL> select * from v$version;
SQL> connect system/manager as sydba
Connected.
SQL> grant select on v_$mystat to plustrace;
Grant succeeded.
SQL> connect system/password as sysdba
Connected.
SQL> set autotrace on
成功!