The following error message appears when viewing the program with Autotrace in Sqlplus:
SYS@CDB$ROOT> conn Scott/Tiger@pdborcl
Connected. The session has changed.
SCOTT @PDBORCL > set autotrace on;
SP2 - 0618 : The session identifier could not be found. Enable Check plustrace role
SP2 - 0611: Error enabling STATISTICS report
This is because the role plustrace does not exist, or is not created. Create the Plustrace role whenever you execute the $oracle_home/sqlplus/admin/plustrce.sql script:
SCOTT @PDBORCL > conn sys/orcl@pdborcl as sysdba
Connected.
The session has changed.
SYS @PDBORCL > @c: \app\oracle\product\12.1. 0 \dbhome_1\sqlplus\admin\plustrce.sql
SYS @PDBORCL > Grant plustrace to Scott;
This allows Scott users to track SQL execution plans with Autotrace.
SYS@CDB$ROOT>Conn Scott/Tiger@pdborclConnected.The session has changed. SCOTT@PDBORCL> SetAutotrace on; SP2-0618: The session identifier could not be found. Enable check plustrace role SP2-0611: EnableSTATISTICSError Reporting, Scott .@PDBORCL>Conn SYS/Orcl@pdborcl asSysdbaconnected. The session has changed. SYS@PDBORCL> @c: \app\oracle\product\12.1.0\dbhome_1\sqlplus\admin\plustrce.sqlsys@PDBORCL>SYS@PDBORCL> Droprole Plustrace; SYS@PDBORCL> Createrole plustrace; roles created. SYS@PDBORCL>SYS@PDBORCL> Grant Select onV_$sesstat toPlustrace; authorized success. SYS@PDBORCL> Grant Select onV_$statname toPlustrace; authorized success. SYS@PDBORCL> Grant Select onV_$mystat toPlustrace; authorized success. SYS@PDBORCL> GrantPlustrace toDba withAdminoption, Authorization is successful. SYS@PDBORCL>SYS@PDBORCL> SetEchooffSYS@PDBORCL> GrantPlustrace toScott; authorized success. SYS@PDBORCL>
:
Reference:
Resolve role Plustrace does not exist in Oracle
Resolve role Plustrace does not exist in Oracle