Re: ** outline change

From: Riyaj Shamsudeen <>
Date: Wed, 18 Mar 2009 14:10:14 -0500
Message-ID: <>

Hi Joshi

  Use hints and then create outlines exactly as you want the plan to be. Then you will be able to exchange the outlines, as long as, you don't materially alter the SQL statement.

  create outeline <outln> for
   select /*+ hints...*/
    .. Rest of the query..

  If you are making a very minimal change to the plan, then you can directly update the ol$hints table, but I always prefer to swap outlines by creating outlines with explicit hints.

  But, I am surprised that you are resorting to this method for MV refresh. Is it possible for you to share tkprof output lines? It is rare that you need to use outlines for MV refresh, I suppose, needed in some cases.


Riyaj Shamsudeen
Principal DBA,
Ora!nternals -
Specialists in Performance, Recovery and EBS11i

On Wed, Mar 18, 2009 at 1:37 PM, A Joshi <> wrote:

> Riyaj,
> I am on dev. The sql is related to MV refresh where the source table is
> on remote database. The remote database is not accessible to me as dba. only
> read only. The refresh is sending sql to remote database. I have created a
> outline by running the mv refresh. Now I need to change the outline. How do
> I do it from sqlplus since I cannot go to tool outline management. I need to
> change the hint and join method using sqlplus. I did a select * on
> OL$HINTS and I can see the hint listed and maybe it can be changed.However,
> I cannot see the join method listed like hash join etc. Thanks for help.
> --- On *Wed, 3/18/09, Riyaj Shamsudeen <>*wrote:
> From: Riyaj Shamsudeen <>
> Subject: Re: ** outline change
> To:
> Cc:
> Date: Wednesday, March 18, 2009, 1:54 PM
> Hi Joshi
> You really need to create outlines through the application, if you
> don't have access to code. Oracle uses signature which is raw(16) column and
> seems to be generated from SQL text. Unless, you have exactly same text,
> signature doesn't match. You might want to run this process in dev or test (
> with logon trigger based created_stored_outlines=true or whole system ) and
> collect outlines. Then drop all outlines except that specific outline you
> are tuning.
> Once you have that outline collected, then you can get sql_text from
> outln.ol$. Tune that SQL and then create outline using 'create outline
> <olname> for <sqltext>'. At this point, you have two outlines and you can
> swap them using that technique in that ML document. Technically, speaking
> you can update ol_name as that is the link between all three tables. Of
> course, it is better idea to update hint_count also.
> It is easy to copy that outline from dev to prod using exp/imp (in
> unix, $, single quote, double quote, ( etc need to be excaped or use
> parfile for exp.).
> exp userid=\"/ as sysdba\" file=outln_tuned.dmp log=outln_tuned.log
> tables=\( outln.ol\$, outln.ol\$nodes, outln.ol\$hints \) query=\" where
> ol_name=\'SYS_OUTLINE_070710104645510\'\"
> import that in PROD.
> imp userid=\"/ as sysdba\" file=outln_tuned.dmp log=outln_tuned.log
> fromuser=outln touser=outln ignore=Y
> As a side note, sql_text in outln.ol$ is a long column and searching
> for a specific sql_Text is not easy one. To search easier use this method:
> Create a clob column and search on that.
> create table rs.ol$lob (ol_name varchar2(30), sql_text
> clob) tablespace users;
> insert into rs.ol$lob select ol_name, to_lob(sql_text)
> from outln.ol$;
> now, you can search on * from rs.ol$lob
> where upper(sql_text) like '%T1$';
> --
> Cheers
> Riyaj
> On Wed, Mar 18, 2009 at 11:58 AM, A Joshi <> wrote:
>> Riyaj,
>> Yes. I had seen this note. It is applicable for when we have two
>> outlines one <snip..>
Received on Wed Mar 18 2009 - 14:10:14 CDT

Original text of this message