Sql> SetAutotraceusage:SETAutot[RACE]{OFF | on |TRACE[ only]}[Exp[lain]][Stat[istics]]sql> SetAutotrace onSP2-0618: Cannot find the Session Identifier.CheckPlustrace role isenabledSP2-0611: Error EnablingSTATISTICSReportsql>Conn/ asSysdbaconnected.sql> Droprole Plustrace;Droprole Plustrace*ERROR at line1: ORA-01919: Role'Plustrace'Does notExistsql> Createrole Plustrace; Role created. SQL> Grant Select onV_$sesstat toPlustrace;Grantsucceeded. SQL> Grant Select onV_$statname toPlustrace;Grantsucceeded. SQL> Grant Select onV_$mystat toPlustrace;Grantsucceeded. SQL> GrantPlustrace toDba withAdminoption;Grantsucceeded. SQL> GrantPlustrace toScott;Grantsucceeded. SQL>Conn Scott/Tigerconnected.sql> SetAutotrace onSQL> Select Count(*) fromEMP; COUNT(*)---------- -ExecutionPlan----------------------------------------------------------PlanHash value:2937609675-------------------------------------------------------------------|Id|Operation|Name|Rows|Cost (%CPU)|Time|-------------------------------------------------------------------| 0 | SELECTSTATEMENT| | 1 | 1(0)| xx:xx: on || 1 |SORT AGGREGATE| | 1 | | || 2 | INDEX FullSCAN|Pk_emp| - | 1(0)| xx:xx: on |-------------------------------------------------------------------Statistics---------------------------------------------------------- 1Recursive calls0db block gets1consistent gets1Physical reads0Redo Size526Bytes sent via SQL*Net toClient520Bytes received via SQL*Net fromClient2Sql*Net roundtrips to/ fromClient0sorts (memory)0Sorts (Disk) 1rows Processedsql>
Oracle Set Autotrace prompt: Cannot find the Session Identifier. Check plustrace role is enabled