Oracle查看sql_id 的历史执行计划

来源:这里教程网 时间:2026-03-03 16:47:45 作者:

可以通过以下三个视图查看历史执行计划:DBA_HIST_SQL_PLANDBA_HIST_SQLSTATDBA_HIST_SNAPSHOT 通过以下sql 能查出对应sql_id 的历史执行计划及变化时间: select distinct SQL_ID,PLAN_HASH_VALUE,to_char(TIMESTAMP, 'yyyymmdd hh24:mi:ss') TIMESTAMPfrom dba_hist_sql_planwhere SQL_ID = '7wh3566763q49'order by TIMESTAMP; 通过以下sql 能查出执行计划哪些地方出现了变化: col options for a15col operation for a20col object_name for a20select distinct SQL_ID,PLAN_HASH_VALUE,to_char(TIMESTAMP, 'yyyymmdd hh24:mi:ss') TIMESTAMPfrom dba_hist_sql_planwhere SQL_ID = '7wh3566763q49'order by TIMESTAMP;

相关推荐