explain plan的两种方式:
一、SQL方式:
explain plan for select count(*) from emp;
select * from table(dbms_xplan.display);
二、AUTOTRACE方式:
开启set autotrace on 后,提示:
Unable to gather statistics please unsure user has correct access.
The statistic feature requires that the user is granted select on v_$sesstat, v_$statname and v_$session.
The statistic feature requires that the user is granted select on v_$sesstat, v_$statname and v_$session.
按要求对三个视图grant select后,还是报错,还需对v_$mystat也grant select