Posts

Showing posts with the label force sql plan

Force SQL Plan

How to Force SQL PLAN: Find the old query plan for an sql_id ====================================== set long 90000 SET PAGESIZE 14 set lines 150 pages 50 column begin_interval_time format a25 alter session set nls_date_format='dd-mon-yy hh24:mi:ss'; select begin_interval_time,plan_hash_value,cpu_time_delta,elapsed_time_delta,iowait_delta,disk_reads_delta from dba_hist_sqlstat A,dba_hist_snapshot B where A.snap_id = B.snap_id and A.sql_id = '&sql_id' order by 1; Forcing a SQL Plan : ====================== Step 1: ---------- SPO coe_xfr_sql_profile.log; SET DEF ON TERM OFF ECHO ON FEED OFF VER OFF HEA ON LIN 2000 PAGES 100 LONG 8000000 LONGC 800000 TRIMS ON TI OFF TIMI OFF SERVEROUT ON SIZE 1000000 NUMF "" SQ LP SQL>; REM REM $Header: 215187.1 coe_xfr_sql_profile.sql 11.4.1.4 2010/07/12 csierra $ REM REM Copyright (c) 2000-2010, Oracle Corporation. All rights reserved. REM REM AUTHOR R...