Sql> SET AUTOTRACE on
Sp2-0618:cannot find the Session Identifier. Check plustrace role is enabled
Sp2-0611:error Enabling STATISTICS Report
Sql> Conn System/oracle
Connected.
Sql> Grant Plustrace to Adela;
Grant Plustrace to Adela
*
ERROR at line 1:
Ora-01919:role ' plustrace ' does not exist
Solve:
Drop role C # #plustrace; Create role C # #plustrace; Grant Select on V_$sesstat to C # #plustrace; Grant Select on V_$statname to C # #plustrace; Grant Select on V_$mystat to C # #plustrace; Grant C # #plustrace to C # #adela with admin option;conn C # #adela/orac Leset Autotrace on
View the effects below
Sql> set line 100sql> select cname from c where cno in (select cno from sc where sno in (select sno from s where sname= ' Adela ')); CNAME--------------------osc++javadbexecution Plan----------------------------------------------------------plan hash value: 2310661688------ --------------------------------------------------------------------------------------| id | Operation | Name | Rows | Bytes | Cost (%CPU) | time |--------------------------------------------------------------- -----------------------------| 0 | select statement | | 1 | 22 | 5 (0) | 00:00:01 | | 1 | NESTED LOOPS | | | | | | | 2 | NESTED LOOPS | | 1 | 22 | 5 (0 ) | 00:00:01 | | 3 | view | vw_nso_1 | 2 | 10 | 4 (0) | 00:00:01 | | 4 | HASH UNIQUE | | 1 | 48 | | | | 5 | NESTED LOOPS | | 2 | 48 | 4 (0) | 00:00:01 | | * 6 | table access full | s | 1 | 13 | 3 (0) | 00:00:01 | | * 7 | index range scan | SC_PK | 2 | 22 | 1 (0) | 00:00:01 | | * 8 | index unique scan | SYS_C009862 | 1 | | 0 (0) | 00:00:01 | | 9 | table access BY INDEX ROWID| C | 1 | 17 | 1 (0) | 00:00:01 |-------------------------------------------------------------------------------------------- predicate information (identified by operation id):---------------------------------- ----------------- 6 - filter ("SNAME" = ' adela ') 7 - access ("SNO" = "SNO") 8 - access ("CNO" = "CNO") Note----- - dynamic statistics used: dynamic sampling (level=2) - this is an adaptive planstatistics---------------------------------------------------------- 0 recursive calls 0 db block gets 16 consistent gets 0 physical reads 0 redo size 612 bytes sent via SQL*Net to client 543 bytes received via sql*net from client 2 sql*net roundtrips to/from client 0 sorts (memory) 0 sorts (disk) 4 rows processed
Ok!
This article is from the "Adela" blog, make sure to keep this source http://adelazhu.blog.51cto.com/9455045/1680892
sp2-0618 sp2-0611 ORA-01919 Open Execution Plan error (ORACLE12C)