1. Create a table and run the utlxplan script SQL> @? /Rdbms/admin/utlxplantable created. 2. create a synonym so that multiple users can share one plan_table and authorize it to public SQL> Create public synonym plan_table for plan_table; synonym created. SQL> grant all on plan_table to public; grant succeeded. 3. create a plustrace role SQL> @? Run/sqlplus/admin/plustrce. SQL to execute this script.
SQL> drop role plustrace;
drop role plustrace
*
error at line 1:
ORA-01919: role 'plustrace 'does not existsql> Create role plustrace; role created. SQL>
SQL> grant select on V _ $ sesstat to plustrace; grant succeeded. SQL> grant select on V _ $ statname to plustrace; grant succeeded. SQL> grant select on V _ $ mystat to plustrace; grant succeeded. SQL> grant plustrace to DBA with admin option; grant succeeded. SQL>
SQL> set echo off 4. Grant the role permission to public SQL> grant plustrace to public; after completing the preceding steps, you can use the autotrace function set autotrace off. By default, set autotrace on is disabled to view the execution plan and query information. Set autotrace traceonly only displays the execution plan, but no query output is displayed.