{"id":269,"date":"2017-02-21T08:00:36","date_gmt":"2017-02-21T14:00:36","guid":{"rendered":"http:\/\/www.aamirharoon.com\/?p=269"},"modified":"2020-12-25T17:34:09","modified_gmt":"2020-12-25T23:34:09","slug":"apply-execution-plan-from-graveyard","status":"publish","type":"post","link":"http:\/\/www.aamirharoon.com\/?p=269","title":{"rendered":"Apply Execution Plan From Graveyard"},"content":{"rendered":"<p>&#8230;.yes, that is correct. \ud83d\ude42<\/p>\n<p>You can apply an execution plan even if it has been aged out from your local Automatic Workload Repository (AWR). But first you&#8217;ll need a graveyard \ud83d\ude42 , in other words AWR Warehouse Repository. AWR Warehouse can keep history of your database metrics longer than your local database.<\/p>\n<p>AWR Warehouse came in really handy when a monthly job changed the execution plan. Using AWR Warehouse I was able to figure out the execution plan I wanted to force.<\/p>\n<p>But how can I create a SQL Profile or SQL Plan Baseline for a plan that is in a different database? That is where <a href=\"http:\/\/kerryosborne.oracle-guy.com\/2010\/07\/sqlt-coe_xfr_sql_profilesql\/\" target=\"_blank\" rel=\"noopener noreferrer\">Kerry Osborne scripts<\/a> came in handy.<\/p>\n<p>To force any plan, you need OUTLINE_DATA. Outline Data is nothing more than bunch of Optimizer Hints that Oracle uses to figure out execution plan and it is stored in OTHER_XML column of v$SQL_PLAN or DBA_HIST_SQL_PLAN view.<\/p>\n<p>In our environment, AWR Snapshot are kept for 30 days in local database, but you can query AWR Warehouse Repository database to get information older than 30 days (depending on the retention set in AWR Warehouse).<br \/>To force a plan from AWR Warehouse Repository, you&#8217;ll need to extract information from OTHER_XML column.<\/p>\n<p>First I used following query in AWR Warehouse Database to find the plan I want.<\/p>\n<pre><pre class=\"brush: sql; gutter: false; highlight: [9,16,17,29,30]; title: ; notranslate\" title=\"\">\nSELECT STAT.SQL_ID,\n  PLAN_HASH_VALUE,\n  PARSING_SCHEMA_NAME,\n  ROUND (SUM (ELAPSED_TIME_DELTA) \/ 1000000 \/ 60, 2)   elapsed_time_mins,\n  TRUNC (SS.END_INTERVAL_TIME)\n FROM DBA_HIST_SQLSTAT       STAT,\n      DBA_HIST_SQLTEXT       TXT,\n      DBA_HIST_SNAPSHOT      SS,\n      dbsnmp.caw_dbid_mapping m\n  WHERE   STAT.SQL_ID = TXT.SQL_ID\n      AND STAT.DBID = TXT.DBID\n      AND SS.DBID = STAT.DBID\n      AND SS.INSTANCE_NUMBER = STAT.INSTANCE_NUMBER\n      AND STAT.SNAP_ID = SS.SNAP_ID\n      AND UPPER (STAT.SQL_ID) = 'F2P5QTHSZVXQJ'\n      AND LOWER (M.TARGET_NAME) = 'db1.example.com'\n      AND SS.DBID = M.NEW_DBID\n      AND PLAN_HASH_VALUE &amp;gt; 0\n GROUP BY STAT.SQL_ID,\n          PLAN_HASH_VALUE,\n          PARSING_SCHEMA_NAME,\n          TRUNC (SS.END_INTERVAL_TIME)\nORDER BY TRUNC (SS.END_INTERVAL_TIME);\n\nSQL_ID\t\t\tPLAN_HASH_VALUE\tPARSING_SCHEMA_NAME\tELAPSED_TIME_MINS\tTRUNC(SS.END_INTERVAL_TIME)\nf2p5qthszvxqj\t593130478\t\tUSER1\t\t\t\t102.51\t\t\t\t11\/14\/2016\nf2p5qthszvxqj\t593130478\t\tUSER1\t\t\t\t82.78\t\t\t\t11\/21\/2016\nf2p5qthszvxqj\t593130478\t\tUSER1\t\t\t\t99.18\t\t\t\t11\/28\/2016\nf2p5qthszvxqj\t593130478\t\tUSER1\t\t\t\t104.54\t\t\t\t12\/5\/2016\nf2p5qthszvxqj\t2168570097\t\tUSER1\t\t\t\t122.2\t\t\t\t12\/12\/2016\nf2p5qthszvxqj\t2168570097\t\tUSER1\t\t\t\t157.34\t\t\t\t12\/19\/2016\nf2p5qthszvxqj\t2168570097\t\tUSER1\t\t\t\t196.52\t\t\t\t12\/26\/2016\nf2p5qthszvxqj\t2168570097\t\tUSER1\t\t\t\t184.88\t\t\t\t1\/9\/2017\nf2p5qthszvxqj\t3004456317\t\tUSER1\t\t\t\t271.19\t\t\t\t1\/16\/2017\nf2p5qthszvxqj\t2168570097\t\tUSER1\t\t\t\t184.04\t\t\t\t1\/23\/2017\nf2p5qthszvxqj\t54869993\t\tUSER1\t\t\t\t539.46\t\t\t\t1\/30\/2017\n<\/pre><\/pre>\n<p>As you can see Plan Hash Value, 593130478 was same until 12\/5\/2016. This plan changed after 12\/5\/2016 and it is not available in local database. So to force this plan I need information from OTHER_XML column. Running following query against AWR Warehouse Repository gave me the OUTLINE_DATA I needed to create a SQL Profile.<\/p>\n<pre><pre class=\"brush: sql; gutter: false; title: ; notranslate\" title=\"\">\nSET PAGES 1000 LINES 200 TRIM ON TRIMS ON HEAD OFF\nSELECT 'q''&#x5B;' || EXTRACTVALUE (VALUE (D), '\/hint') || ']'',' AS OUTLINE_HINTS\n  FROM XMLTABLE (\n       '\/*\/outline_data\/hint'\n       PASSING (SELECT XMLTYPE (OTHER_XML) AS XMLVAL\n     FROM SYS.DBA_HIST_SQL_PLAN\n       WHERE     SQL_ID = 'f2p5qthszvxqj'\n          AND PLAN_HASH_VALUE = 593130478\n          AND OTHER_XML IS NOT NULL)) D;\n\nq'&#x5B;IGNORE_OPTIM_EMBEDDED_HINTS]',\nq'&#x5B;OPTIMIZER_FEATURES_ENABLE('12.1.0.2')]',\nq'&#x5B;DB_VERSION('12.1.0.2')]',\nq'&#x5B;OPT_PARAM('optimizer_index_cost_adj' 50)]',\nq'&#x5B;OPT_PARAM('optimizer_index_caching' 50)]',\nq'&#x5B;OPT_PARAM('optimizer_dynamic_sampling' 11)]',\nq'&#x5B;ALL_ROWS]',\nq'&#x5B;OUTLINE_LEAF(@&quot;SEL$A1BD89B9&quot;)]',\nq'&#x5B;MERGE(@&quot;SEL$5B8A663B&quot;)]',\nq'&#x5B;OUTLINE_LEAF(@&quot;SEL$2&quot;)]',\nq'&#x5B;OUTLINE_LEAF(@&quot;SEL$1&quot;)]',\nq'&#x5B;OUTLINE_LEAF(@&quot;INS$1&quot;)]',\nq'&#x5B;OUTLINE(@&quot;SEL$7&quot;)]',\nq'&#x5B;OUTLINE(@&quot;SEL$5B8A663B&quot;)]',\nq'&#x5B;MERGE(@&quot;SEL$6A1B73E7&quot;)]',\nq'&#x5B;OUTLINE(@&quot;SEL$6&quot;)]',\nq'&#x5B;OUTLINE(@&quot;SEL$6A1B73E7&quot;)]',\nq'&#x5B;MERGE(@&quot;SEL$37633EB5&quot;)]',\nq'&#x5B;OUTLINE(@&quot;SEL$5&quot;)]',\nq'&#x5B;OUTLINE(@&quot;SEL$37633EB5&quot;)]',\nq'&#x5B;MERGE(@&quot;SEL$3&quot;)]',\nq'&#x5B;OUTLINE(@&quot;SEL$4&quot;)]',\nq'&#x5B;OUTLINE(@&quot;SEL$3&quot;)]',\nq'&#x5B;FULL(@&quot;INS$1&quot; &quot;ACCUM_DTL_OUT&quot;@&quot;INS$1&quot;)]',\nq'&#x5B;NO_ACCESS(@&quot;SEL$1&quot; &quot;ACCUM&quot;@&quot;SEL$1&quot;)]',\nq'&#x5B;NO_ACCESS(@&quot;SEL$2&quot; &quot;from$_subquery$_003&quot;@&quot;SEL$2&quot;)]',\nq'&#x5B;GBY_PUSHDOWN(@&quot;SEL$2&quot;)]',\nq'&#x5B;USE_HASH_AGGREGATION(@&quot;SEL$2&quot;)]',\nq'&#x5B;FULL(@&quot;SEL$A1BD89B9&quot; &quot;CDLM&quot;@&quot;SEL$5&quot;)]',\nq'&#x5B;INDEX(@&quot;SEL$A1BD89B9&quot; &quot;BUCKETS&quot;@&quot;SEL$6&quot; (&quot;ACCUM_BUCKETS&quot;.&quot;IS_INBOUND&quot; &quot;ACCUM_BUCKETS&quot;.&quot;ACC_TYPE&quot; &quot;ACCUM_BUCKETS&quot;.&quot;ACAC_ACC_NO&quot;))]',\nq'&#x5B;INDEX(@&quot;SEL$A1BD89B9&quot; &quot;CDML&quot;@&quot;SEL$3&quot; (&quot;CMC_CDML_CL_LINE&quot;.&quot;CLCL_ID&quot; &quot;CMC_CDML_CL_LINE&quot;.&quot;CDML_SEQ_NO&quot;))]',\nq'&#x5B;FULL(@&quot;SEL$A1BD89B9&quot; &quot;MEME&quot;@&quot;SEL$4&quot;)]',\nq'&#x5B;INDEX(@&quot;SEL$A1BD89B9&quot; &quot;CLCL&quot;@&quot;SEL$3&quot; (&quot;CMC_CLCL_CLAIM&quot;.&quot;CLCL_ID&quot;))]',\nq'&#x5B;LEADING(@&quot;SEL$A1BD89B9&quot; &quot;CDLM&quot;@&quot;SEL$5&quot; &quot;BUCKETS&quot;@&quot;SEL$6&quot; &quot;CDML&quot;@&quot;SEL$3&quot; &quot;MEME&quot;@&quot;SEL$4&quot; &quot;CLCL&quot;@&quot;SEL$3&quot;)]',\nq'&#x5B;USE_HASH(@&quot;SEL$A1BD89B9&quot; &quot;BUCKETS&quot;@&quot;SEL$6&quot;)]',\nq'&#x5B;USE_NL(@&quot;SEL$A1BD89B9&quot; &quot;CDML&quot;@&quot;SEL$3&quot;)]',\nq'&#x5B;NLJ_BATCHING(@&quot;SEL$A1BD89B9&quot; &quot;CDML&quot;@&quot;SEL$3&quot;)]',\nq'&#x5B;USE_HASH(@&quot;SEL$A1BD89B9&quot; &quot;MEME&quot;@&quot;SEL$4&quot;)]',\nq'&#x5B;USE_NL(@&quot;SEL$A1BD89B9&quot; &quot;CLCL&quot;@&quot;SEL$3&quot;)]',\nq'&#x5B;NLJ_BATCHING(@&quot;SEL$A1BD89B9&quot; &quot;CLCL&quot;@&quot;SEL$3&quot;)]',\nq'&#x5B;PQ_DISTRIBUTE(@&quot;SEL$A1BD89B9&quot; &quot;BUCKETS&quot;@&quot;SEL$6&quot; NONE BROADCAST)]',\nq'&#x5B;PX_JOIN_FILTER(@&quot;SEL$A1BD89B9&quot; &quot;BUCKETS&quot;@&quot;SEL$6&quot;)]',\nq'&#x5B;PQ_DISTRIBUTE(@&quot;SEL$A1BD89B9&quot; &quot;CDML&quot;@&quot;SEL$3&quot; NONE BROADCAST)]',\nq'&#x5B;PQ_DISTRIBUTE(@&quot;SEL$A1BD89B9&quot; &quot;MEME&quot;@&quot;SEL$4&quot; BROADCAST NONE)]',\nq'&#x5B;PX_JOIN_FILTER(@&quot;SEL$A1BD89B9&quot; &quot;MEME&quot;@&quot;SEL$4&quot;)]',\nq'&#x5B;PQ_DISTRIBUTE(@&quot;SEL$A1BD89B9&quot; &quot;CLCL&quot;@&quot;SEL$3&quot; NONE BROADCAST)]',\nq'&#x5B;SWAP_JOIN_INPUTS(@&quot;SEL$A1BD89B9&quot; &quot;BUCKETS&quot;@&quot;SEL$6&quot;)]',\nq'&#x5B;GBY_PUSHDOWN(@&quot;SEL$A1BD89B9&quot;)]',\nq'&#x5B;USE_HASH_AGGREGATION(@&quot;SEL$A1BD89B9&quot;)]',\nq'&#x5B;PARTIAL_JOIN(@&quot;SEL$A1BD89B9&quot; &quot;BUCKETS&quot;@&quot;SEL$6&quot;)]',\n<\/pre><\/pre>\n<p>Now I have all the information I need to create SQL Profile to force this plan.<br \/>Here is the procedure (modified script from <a href=\"http:\/\/kerryosborne.oracle-guy.com\/2010\/07\/sqlt-coe_xfr_sql_profilesql\/\" target=\"_blank\" rel=\"noopener noreferrer\">Kerry Osborne Website<\/a>) I used to run in the target database to manually create SQL profile. sql_txt must match the sql from v$sql.sql_fulltext.<\/p>\n<pre><pre class=\"brush: sql; gutter: false; title: ; notranslate\" title=\"\">\nSET SERVEROUTPUT ON;\nSET NUMFORMAT 99999999999999999999\nWHENEVER SQLERROR EXIT SQL.SQLCODE;\nVAR signature NUMBER;\n\nDECLARE\nsql_txt   CLOB;\nh         SYS.SQLPROF_ATTR;\nBEGIN\nSELECT SQL_FULLTEXT\n       INTO SQL_TXT\n  FROM SYS.V_$SQL\n WHERE SQL_ID = 'f2p5qthszvxqj' AND CHILD_NUMBER = 0;\n\nh :=\nSYS.SQLPROF_ATTR (\nq'&#x5B;BEGIN_OUTLINE_DATA]',     --Need to add this\nq'&#x5B;IGNORE_OPTIM_EMBEDDED_HINTS]',      --Output from a query ran in AWR Warehouse database\nq'&#x5B;OPTIMIZER_FEATURES_ENABLE('12.1.0.2')]',\nq'&#x5B;DB_VERSION('12.1.0.2')]',\nq'&#x5B;OPT_PARAM('optimizer_index_cost_adj' 50)]',\nq'&#x5B;OPT_PARAM('optimizer_index_caching' 50)]',\nq'&#x5B;OPT_PARAM('optimizer_dynamic_sampling' 11)]',\nq'&#x5B;ALL_ROWS]',\nq'&#x5B;OUTLINE_LEAF(@&quot;SEL$A1BD89B9&quot;)]',\nq'&#x5B;MERGE(@&quot;SEL$5B8A663B&quot;)]',\nq'&#x5B;OUTLINE_LEAF(@&quot;SEL$2&quot;)]',\nq'&#x5B;OUTLINE_LEAF(@&quot;SEL$1&quot;)]',\nq'&#x5B;OUTLINE_LEAF(@&quot;INS$1&quot;)]',\nq'&#x5B;OUTLINE(@&quot;SEL$7&quot;)]',\nq'&#x5B;OUTLINE(@&quot;SEL$5B8A663B&quot;)]',\nq'&#x5B;MERGE(@&quot;SEL$6A1B73E7&quot;)]',\nq'&#x5B;OUTLINE(@&quot;SEL$6&quot;)]',\nq'&#x5B;OUTLINE(@&quot;SEL$6A1B73E7&quot;)]',\nq'&#x5B;MERGE(@&quot;SEL$37633EB5&quot;)]',\nq'&#x5B;OUTLINE(@&quot;SEL$5&quot;)]',\nq'&#x5B;OUTLINE(@&quot;SEL$37633EB5&quot;)]',\nq'&#x5B;MERGE(@&quot;SEL$3&quot;)]',\nq'&#x5B;OUTLINE(@&quot;SEL$4&quot;)]',\nq'&#x5B;OUTLINE(@&quot;SEL$3&quot;)]',\nq'&#x5B;FULL(@&quot;INS$1&quot; &quot;ACCUM_DTL_OUT&quot;@&quot;INS$1&quot;)]',\nq'&#x5B;NO_ACCESS(@&quot;SEL$1&quot; &quot;ACCUM&quot;@&quot;SEL$1&quot;)]',\nq'&#x5B;NO_ACCESS(@&quot;SEL$2&quot; &quot;from$_subquery$_003&quot;@&quot;SEL$2&quot;)]',\nq'&#x5B;GBY_PUSHDOWN(@&quot;SEL$2&quot;)]',\nq'&#x5B;USE_HASH_AGGREGATION(@&quot;SEL$2&quot;)]',\nq'&#x5B;FULL(@&quot;SEL$A1BD89B9&quot; &quot;CDLM&quot;@&quot;SEL$5&quot;)]',\nq'&#x5B;INDEX(@&quot;SEL$A1BD89B9&quot; &quot;BUCKETS&quot;@&quot;SEL$6&quot; (&quot;ACCUM_BUCKETS&quot;.&quot;IS_INBOUND&quot; &quot;ACCUM_BUCKETS&quot;.&quot;ACC_TYPE&quot; &quot;ACCUM_BUCKETS&quot;.&quot;ACAC_ACC_NO&quot;))]',\nq'&#x5B;INDEX(@&quot;SEL$A1BD89B9&quot; &quot;CDML&quot;@&quot;SEL$3&quot; (&quot;CMC_CDML_CL_LINE&quot;.&quot;CLCL_ID&quot; &quot;CMC_CDML_CL_LINE&quot;.&quot;CDML_SEQ_NO&quot;))]',\nq'&#x5B;FULL(@&quot;SEL$A1BD89B9&quot; &quot;MEME&quot;@&quot;SEL$4&quot;)]',\nq'&#x5B;INDEX(@&quot;SEL$A1BD89B9&quot; &quot;CLCL&quot;@&quot;SEL$3&quot; (&quot;CMC_CLCL_CLAIM&quot;.&quot;CLCL_ID&quot;))]',\nq'&#x5B;LEADING(@&quot;SEL$A1BD89B9&quot; &quot;CDLM&quot;@&quot;SEL$5&quot; &quot;BUCKETS&quot;@&quot;SEL$6&quot; &quot;CDML&quot;@&quot;SEL$3&quot; &quot;MEME&quot;@&quot;SEL$4&quot; &quot;CLCL&quot;@&quot;SEL$3&quot;)]',\nq'&#x5B;USE_HASH(@&quot;SEL$A1BD89B9&quot; &quot;BUCKETS&quot;@&quot;SEL$6&quot;)]',\nq'&#x5B;USE_NL(@&quot;SEL$A1BD89B9&quot; &quot;CDML&quot;@&quot;SEL$3&quot;)]',\nq'&#x5B;NLJ_BATCHING(@&quot;SEL$A1BD89B9&quot; &quot;CDML&quot;@&quot;SEL$3&quot;)]',\nq'&#x5B;USE_HASH(@&quot;SEL$A1BD89B9&quot; &quot;MEME&quot;@&quot;SEL$4&quot;)]',\nq'&#x5B;USE_NL(@&quot;SEL$A1BD89B9&quot; &quot;CLCL&quot;@&quot;SEL$3&quot;)]',\nq'&#x5B;NLJ_BATCHING(@&quot;SEL$A1BD89B9&quot; &quot;CLCL&quot;@&quot;SEL$3&quot;)]',\nq'&#x5B;PQ_DISTRIBUTE(@&quot;SEL$A1BD89B9&quot; &quot;BUCKETS&quot;@&quot;SEL$6&quot; NONE BROADCAST)]',\nq'&#x5B;PX_JOIN_FILTER(@&quot;SEL$A1BD89B9&quot; &quot;BUCKETS&quot;@&quot;SEL$6&quot;)]',\nq'&#x5B;PQ_DISTRIBUTE(@&quot;SEL$A1BD89B9&quot; &quot;CDML&quot;@&quot;SEL$3&quot; NONE BROADCAST)]',\nq'&#x5B;PQ_DISTRIBUTE(@&quot;SEL$A1BD89B9&quot; &quot;MEME&quot;@&quot;SEL$4&quot; BROADCAST NONE)]',\nq'&#x5B;PX_JOIN_FILTER(@&quot;SEL$A1BD89B9&quot; &quot;MEME&quot;@&quot;SEL$4&quot;)]',\nq'&#x5B;PQ_DISTRIBUTE(@&quot;SEL$A1BD89B9&quot; &quot;CLCL&quot;@&quot;SEL$3&quot; NONE BROADCAST)]',\nq'&#x5B;SWAP_JOIN_INPUTS(@&quot;SEL$A1BD89B9&quot; &quot;BUCKETS&quot;@&quot;SEL$6&quot;)]',\nq'&#x5B;GBY_PUSHDOWN(@&quot;SEL$A1BD89B9&quot;)]',\nq'&#x5B;USE_HASH_AGGREGATION(@&quot;SEL$A1BD89B9&quot;)]',\nq'&#x5B;PARTIAL_JOIN(@&quot;SEL$A1BD89B9&quot; &quot;BUCKETS&quot;@&quot;SEL$6&quot;)]',\nq'&#x5B;END_OUTLINE_DATA]');  --Need to add this\n\n:signature := DBMS_SQLTUNE.SQLTEXT_TO_SIGNATURE (sql_txt);\n\nDBMS_SQLTUNE.IMPORT_SQL_PROFILE (\nsql_text      =&amp;gt; sql_txt,\nprofile       =&amp;gt; h,\nname          =&amp;gt; 'mpc_f2p5qthszvxqj_593130478',   -- name of profile mpc_sqlid_PlanHashValue\ndescription   =&amp;gt; 'mpc f2p5qthszvxqj 593130478 ' || :signature || '',\ncategory      =&amp;gt; 'DEFAULT',\nVALIDATE      =&amp;gt; TRUE,\nREPLACE       =&amp;gt; TRUE,\nforce_match   =&amp;gt; TRUE \/* TRUE:FORCE (match even when different literals in SQL). FALSE:EXACT (similar to CURSOR_SHARING) *\/\n);\nEND;\n\/\n\nWHENEVER SQLERROR CONTINUE\nSET ECHO OFF;\n\nSELECT TO_CHAR (:signature, '999999999999999999999') signature FROM DUAL;\n<\/pre><\/pre>\n<p>After running the above code, SQL Profile is now being used for this query.<\/p>\n<p>So that is how using AWR Warehouse, you can bring a plan from graveyard back to life \ud83d\ude42<ins class=\"adsbygoogle\" style=\"display: block;\" data-ad-client=\"ca-pub-0542342557062526\" data-ad-slot=\"3551104696\" data-ad-format=\"auto\"><\/ins><\/p>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8230;.yes, that is correct. \ud83d\ude42 You can apply an execution plan even if it has been aged out from your local Automatic Workload Repository (AWR).<\/p>\n","protected":false},"author":1,"featured_media":4041,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4,45],"tags":[46,48,47],"class_list":["post-269","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-11gr2","category-12cr1","category-sql-query-performance","tag-oracle-awr-warehouse","tag-oracle-execution-plan","tag-sql-query-performance"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Apply Execution Plan From Graveyard - The Database Handyman<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.aamirharoon.com\/?p=269\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Apply Execution Plan From Graveyard - The Database Handyman\" \/>\n<meta property=\"og:description\" content=\"&#8230;.yes, that is correct. \ud83d\ude42 You can apply an execution plan even if it has been aged out from your local Automatic Workload Repository (AWR).\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.aamirharoon.com\/?p=269\" \/>\n<meta property=\"og:site_name\" content=\"The Database Handyman\" \/>\n<meta property=\"article:published_time\" content=\"2017-02-21T14:00:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-12-25T23:34:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.aamirharoon.com\/wp-content\/uploads\/2020\/10\/photo-1546185363-b188cc935569-e1608058035797.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"1050\" \/>\n\t<meta property=\"og:image:height\" content=\"701\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Aamir\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@aamir814\" \/>\n<meta name=\"twitter:site\" content=\"@aamir814\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Aamir\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.aamirharoon.com\/?p=269#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.aamirharoon.com\/?p=269\"},\"author\":{\"name\":\"Aamir\",\"@id\":\"http:\/\/www.aamirharoon.com\/#\/schema\/person\/dbcd256c4a97c6e27b7cc408200a9b63\"},\"headline\":\"Apply Execution Plan From Graveyard\",\"datePublished\":\"2017-02-21T14:00:36+00:00\",\"dateModified\":\"2020-12-25T23:34:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.aamirharoon.com\/?p=269\"},\"wordCount\":361,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/www.aamirharoon.com\/#\/schema\/person\/dbcd256c4a97c6e27b7cc408200a9b63\"},\"image\":{\"@id\":\"https:\/\/www.aamirharoon.com\/?p=269#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.aamirharoon.com\/wp-content\/uploads\/2020\/10\/photo-1546185363-b188cc935569-e1608058035797.jpeg\",\"keywords\":[\"Oracle AWR Warehouse\",\"Oracle Execution Plan\",\"SQL Query Performance\"],\"articleSection\":[\"Oracle Database 11gR2\",\"Oracle Database 12cR1\",\"SQL Query performance\"],\"inLanguage\":\"en\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.aamirharoon.com\/?p=269#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.aamirharoon.com\/?p=269\",\"url\":\"https:\/\/www.aamirharoon.com\/?p=269\",\"name\":\"Apply Execution Plan From Graveyard - The Database Handyman\",\"isPartOf\":{\"@id\":\"http:\/\/www.aamirharoon.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.aamirharoon.com\/?p=269#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.aamirharoon.com\/?p=269#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.aamirharoon.com\/wp-content\/uploads\/2020\/10\/photo-1546185363-b188cc935569-e1608058035797.jpeg\",\"datePublished\":\"2017-02-21T14:00:36+00:00\",\"dateModified\":\"2020-12-25T23:34:09+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.aamirharoon.com\/?p=269#breadcrumb\"},\"inLanguage\":\"en\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.aamirharoon.com\/?p=269\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\/\/www.aamirharoon.com\/?p=269#primaryimage\",\"url\":\"http:\/\/www.aamirharoon.com\/wp-content\/uploads\/2020\/10\/photo-1546185363-b188cc935569-e1608058035797.jpeg\",\"contentUrl\":\"http:\/\/www.aamirharoon.com\/wp-content\/uploads\/2020\/10\/photo-1546185363-b188cc935569-e1608058035797.jpeg\",\"width\":1050,\"height\":701,\"caption\":\"Photo by Einar Storsul on Unsplash\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.aamirharoon.com\/?p=269#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/www.aamirharoon.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Apply Execution Plan From Graveyard\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/www.aamirharoon.com\/#website\",\"url\":\"http:\/\/www.aamirharoon.com\/\",\"name\":\"The Database Handyman\",\"description\":\"My notes about Oracle Database, APEX, OEM Cloud Control and whatever I learn\",\"publisher\":{\"@id\":\"http:\/\/www.aamirharoon.com\/#\/schema\/person\/dbcd256c4a97c6e27b7cc408200a9b63\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/www.aamirharoon.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"http:\/\/www.aamirharoon.com\/#\/schema\/person\/dbcd256c4a97c6e27b7cc408200a9b63\",\"name\":\"Aamir\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"http:\/\/www.aamirharoon.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/63cc5bb07711a1b9719cc47e13a8205072859c1aef30fac28f412baa84b9cf9b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/63cc5bb07711a1b9719cc47e13a8205072859c1aef30fac28f412baa84b9cf9b?s=96&d=mm&r=g\",\"caption\":\"Aamir\"},\"logo\":{\"@id\":\"http:\/\/www.aamirharoon.com\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/www.aamirharoon.com\/about\/\",\"https:\/\/x.com\/aamir814\"],\"url\":\"http:\/\/www.aamirharoon.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Apply Execution Plan From Graveyard - The Database Handyman","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.aamirharoon.com\/?p=269","og_locale":"en_US","og_type":"article","og_title":"Apply Execution Plan From Graveyard - The Database Handyman","og_description":"&#8230;.yes, that is correct. \ud83d\ude42 You can apply an execution plan even if it has been aged out from your local Automatic Workload Repository (AWR).","og_url":"https:\/\/www.aamirharoon.com\/?p=269","og_site_name":"The Database Handyman","article_published_time":"2017-02-21T14:00:36+00:00","article_modified_time":"2020-12-25T23:34:09+00:00","og_image":[{"width":1050,"height":701,"url":"https:\/\/www.aamirharoon.com\/wp-content\/uploads\/2020\/10\/photo-1546185363-b188cc935569-e1608058035797.jpeg","type":"image\/jpeg"}],"author":"Aamir","twitter_card":"summary_large_image","twitter_creator":"@aamir814","twitter_site":"@aamir814","twitter_misc":{"Written by":"Aamir","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.aamirharoon.com\/?p=269#article","isPartOf":{"@id":"https:\/\/www.aamirharoon.com\/?p=269"},"author":{"name":"Aamir","@id":"http:\/\/www.aamirharoon.com\/#\/schema\/person\/dbcd256c4a97c6e27b7cc408200a9b63"},"headline":"Apply Execution Plan From Graveyard","datePublished":"2017-02-21T14:00:36+00:00","dateModified":"2020-12-25T23:34:09+00:00","mainEntityOfPage":{"@id":"https:\/\/www.aamirharoon.com\/?p=269"},"wordCount":361,"commentCount":0,"publisher":{"@id":"http:\/\/www.aamirharoon.com\/#\/schema\/person\/dbcd256c4a97c6e27b7cc408200a9b63"},"image":{"@id":"https:\/\/www.aamirharoon.com\/?p=269#primaryimage"},"thumbnailUrl":"http:\/\/www.aamirharoon.com\/wp-content\/uploads\/2020\/10\/photo-1546185363-b188cc935569-e1608058035797.jpeg","keywords":["Oracle AWR Warehouse","Oracle Execution Plan","SQL Query Performance"],"articleSection":["Oracle Database 11gR2","Oracle Database 12cR1","SQL Query performance"],"inLanguage":"en","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.aamirharoon.com\/?p=269#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.aamirharoon.com\/?p=269","url":"https:\/\/www.aamirharoon.com\/?p=269","name":"Apply Execution Plan From Graveyard - The Database Handyman","isPartOf":{"@id":"http:\/\/www.aamirharoon.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.aamirharoon.com\/?p=269#primaryimage"},"image":{"@id":"https:\/\/www.aamirharoon.com\/?p=269#primaryimage"},"thumbnailUrl":"http:\/\/www.aamirharoon.com\/wp-content\/uploads\/2020\/10\/photo-1546185363-b188cc935569-e1608058035797.jpeg","datePublished":"2017-02-21T14:00:36+00:00","dateModified":"2020-12-25T23:34:09+00:00","breadcrumb":{"@id":"https:\/\/www.aamirharoon.com\/?p=269#breadcrumb"},"inLanguage":"en","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.aamirharoon.com\/?p=269"]}]},{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/www.aamirharoon.com\/?p=269#primaryimage","url":"http:\/\/www.aamirharoon.com\/wp-content\/uploads\/2020\/10\/photo-1546185363-b188cc935569-e1608058035797.jpeg","contentUrl":"http:\/\/www.aamirharoon.com\/wp-content\/uploads\/2020\/10\/photo-1546185363-b188cc935569-e1608058035797.jpeg","width":1050,"height":701,"caption":"Photo by Einar Storsul on Unsplash"},{"@type":"BreadcrumbList","@id":"https:\/\/www.aamirharoon.com\/?p=269#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/www.aamirharoon.com\/"},{"@type":"ListItem","position":2,"name":"Apply Execution Plan From Graveyard"}]},{"@type":"WebSite","@id":"http:\/\/www.aamirharoon.com\/#website","url":"http:\/\/www.aamirharoon.com\/","name":"The Database Handyman","description":"My notes about Oracle Database, APEX, OEM Cloud Control and whatever I learn","publisher":{"@id":"http:\/\/www.aamirharoon.com\/#\/schema\/person\/dbcd256c4a97c6e27b7cc408200a9b63"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/www.aamirharoon.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en"},{"@type":["Person","Organization"],"@id":"http:\/\/www.aamirharoon.com\/#\/schema\/person\/dbcd256c4a97c6e27b7cc408200a9b63","name":"Aamir","image":{"@type":"ImageObject","inLanguage":"en","@id":"http:\/\/www.aamirharoon.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/63cc5bb07711a1b9719cc47e13a8205072859c1aef30fac28f412baa84b9cf9b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/63cc5bb07711a1b9719cc47e13a8205072859c1aef30fac28f412baa84b9cf9b?s=96&d=mm&r=g","caption":"Aamir"},"logo":{"@id":"http:\/\/www.aamirharoon.com\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/www.aamirharoon.com\/about\/","https:\/\/x.com\/aamir814"],"url":"http:\/\/www.aamirharoon.com\/?author=1"}]}},"_links":{"self":[{"href":"http:\/\/www.aamirharoon.com\/index.php?rest_route=\/wp\/v2\/posts\/269","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.aamirharoon.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.aamirharoon.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.aamirharoon.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.aamirharoon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=269"}],"version-history":[{"count":43,"href":"http:\/\/www.aamirharoon.com\/index.php?rest_route=\/wp\/v2\/posts\/269\/revisions"}],"predecessor-version":[{"id":4201,"href":"http:\/\/www.aamirharoon.com\/index.php?rest_route=\/wp\/v2\/posts\/269\/revisions\/4201"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.aamirharoon.com\/index.php?rest_route=\/wp\/v2\/media\/4041"}],"wp:attachment":[{"href":"http:\/\/www.aamirharoon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=269"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.aamirharoon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=269"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.aamirharoon.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=269"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}