oracle 查看执行计划

1 connect / as sysdba

2.@?/rdbms/admin/utlxplan.sql

3.create public synonym plan_table for plan_table

4.grant select,update,insert,delete on plan_table to public

5.@?/sqlplus/admin/plustrce.sql

6.grant plustrace to public

7.set autotrace on;



explain PLAN [ SET STATEMENT_ID [=] < string literal > ] [ INTO < table_name > ]
FOR < sql_statement >
                                                                   explain plan set statement_id='T_TEST' for select * from t_test;            

在plan_table表里边会有一条记录记载刚才的执行计划。


set autotrace on traceonly;    不显示结果,只显示执行计划,统计信息。

你可能感兴趣的:(oracle,sql)