Error Description: I log in with Scott to see if the statement uses the index, enable: Set autotrace traceonly error: SP2-0618: unable to find the session identifier. Enable exam plustrace role SP2-0611: An error occurred while enabling statistics reports
Solution:
SQL> conn sys/root as sysdba
Connected.
SQL> @ D: \ app \ Administrator \ product \ 11.2.0 \ dbhome_1 \ sqlplus \ admin \ plustrce. SQL
SQL>
SQL> drop role plustrace;
Drop role plustrace
*
Row 3 has an error:
ORA-01919: Role 'plustrace 'does not exist
Used time: 00: 00: 00.39
SQL> Create role plustrace;
The role has been created.
Used time: 00: 00: 01.15
SQL> grant select on V _ $ sesstat to plustrace;
Authorization successful.
Used time: 00: 00: 00.30
SQL> grant select on V _ $ statname to plustrace;
Authorization successful.
Used time: 00: 00: 00.03
SQL> grant select on V _ $ mystat to plustrace;
Authorization successful.
Used time: 00: 00: 00.00
SQL> grant plustrace to DBA with admin option;
Authorization successful.
Used time: 00: 00: 00.39
SQL> set echo off
SQL> drop role plustrace;
The role has been deleted.
Used time: 00: 00: 11.24
SQL> Create role plustrace;
The role has been created.
Used time: 00: 00: 00.00
SQL> grant select on V _ $ sesstat to plustrace;
Authorization successful.
Used time: 00: 00: 00.00
SQL> grant select on V _ $ statname to plustrace;
Authorization successful.
Used time: 00: 00: 00.04
SQL> grant select on V _ $ mystat to plustrace;
Authorization successful.
Used time: 00: 00: 00.01
SQL> grant plustrace to DBA with admin option;
Authorization successful.
Used time: 00: 00: 00.01
SQL> set echo off;
SQL> grant plustrace to public;
Authorization successful.
Used time: 00: 00: 00.00
SQL> conn Scott/root;
Connected.
SQL> set autotrace on;