优化 TOOLS

--EXPLAIN PLAN 分析SQL语句
   explain plan for +目标SQL
   select * from table(dbms_xplan.display)
--DBMS_XPLAN 包
   select * from table(dbms_xplan.display)
   select * from table(dbms_xplan.display_cursor(null,nll,'advanced'))
   --select sql_id,hash_value,child_number from v$sql where sql_text like '目标SQL语句';
   select * from table(dbms_xplan.display_cursor('sql_id/hash_code',child_number,'advanced')
   select * from table(dbms_xplan.display_awr('sql_id')
--SET AUTOTRACE traceonly
    set autotrace [off|on|traceonly] explain|statistics
--10046事件


alter session set events '10046 trace name context forever,level 12'
alter session set events '10046 trace name context off'
--在 USER_DUMP_DEST的TRACE文件
开始语句 SQL>  ORADEBUG SETMYPID
oradebug event 10046 trace name context forever,level 12
oradebug event 10046 trace name context off
SQL>ORADEBUG TRACEFILE_NAME
$ TKPROF  TRACE文件目录  转换后的目录
   
--使用TKPROF工具

你可能感兴趣的:(优化 TOOLS)