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

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