oracle explain plan

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.

 按要求对三个视图grant select后,还是报错,还需对v_$mystat也grant select

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章