1.在执行查询的sql前加上 explain plan FOR

例如: explain plan FOR select sysdate from dual;

2.查看生成的执行计划

select plan_table_output from TABLE(DBMS_XPLAN.DISPLAY('PLAN_TABLE'));

注意:以上两步需要在同一个窗口下运行否则会报错:

Error: cannot fetch last explain plan from PLAN_TABLE

最后修改:2023 年 04 月 16 日
如果觉得我的文章对你有用,请随意赞赏