Using AUTOTRACE in SQL*Plus
1. Creating the PLUSTRACE ROLE
sys@DEMO> @$ORACLE_HOME/sqlplus/admin/plustrce.sql
sys@DEMO>
sys@DEMO> drop role plustrace;
drop role plustrace
*
ERROR at line 1:
ORA-01919: role 'PLUSTRACE' does not exist
sys@DEMO> create role plustrace;
Role created.
sys@DEMO> grant select on v_$sesstat to plustrace;
Grant succeeded.
sys@DEMO> grant select on v_$statname to plustrace;
Grant succeeded.
sys@DEMO> grant select on v_$mystat to plustrace;
Grant succeeded.
sys@DEMO> grant plustrace to dba with admin option;
Grant succeeded.
sys@DEMO> set echo off
2. Granting the PLUSTRACE ROLE to the user
3. Using autotrace
sqlplus hr/hr
Ø set autotrace
Ø Usage: SET AUTOT[RACE] {OFF | ON | TRACE[ONLY]} [EXP[LAIN]] [STAT[ISTICS]]
Hope this helps. Regards Rupam