Return-Path: <oracle-l-bounce@freelists.org>
X-Original-To: oracle-l@orafaq.com
Delivered-To: oracle-l@orafaq.com
Received: from puck1183.startdedicated.com (localhost [127.0.0.1])
 by puck1183.startdedicated.com (Postfix) with ESMTP id C40E519611D1
 for <oracle-l@orafaq.com>; Fri, 11 Nov 2016 09:12:27 +0100 (CET)
Received: from turing.freelists.org (turing.freelists.org [206.53.239.180])
 by puck1183.startdedicated.com (Postfix) with ESMTPS
 for <oracle-l@orafaq.com>; Fri, 11 Nov 2016 09:12:27 +0100 (CET)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 3BC8B626CF;
 Fri, 11 Nov 2016 03:12:26 -0500 (EST)
X-Virus-Scanned: Debian amavisd-new at turing.freelists.org
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 7BYa8idbwBPI; Fri, 11 Nov 2016 03:12:26 -0500 (EST)
Received: from turing.freelists.org (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 70CA2626BC;
 Fri, 11 Nov 2016 03:12:13 -0500 (EST)
Received: with ECARTIS (v1.0.0; list oracle-l); Fri, 11 Nov 2016 03:10:51 -0500 (EST)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 67093626AF
 for <oracle-l@freelists.org>; Fri, 11 Nov 2016 03:10:51 -0500 (EST)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id F_ijm2eAHDCL for <oracle-l@freelists.org>;
 Fri, 11 Nov 2016 03:10:51 -0500 (EST)
Received: from mout.web.de (mout.web.de [212.227.17.12])
 (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 8FAA2626AD
 for <oracle-l@freelists.org>; Fri, 11 Nov 2016 03:10:50 -0500 (EST)
Received: from [192.168.2.20] ([77.177.235.130]) by smtp.web.de (mrweb101
 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LlWKh-1cdcOV2Acx-00bMm4; Fri, 11
 Nov 2016 09:10:48 +0100
To: ecandrietta@gmail.com
Cc: "oracle-l@freelists.org" <oracle-l@freelists.org>
From: Randolf Geist <info@www.sqltools-plusplus.org>
Subject: Re: How to force Oracle generate a new execution plan
Message-ID: <d4117b66-06ea-7e30-23e3-a2222bbedf46@www.sqltools-plusplus.org>
Date: Fri, 11 Nov 2016 09:13:13 +0100
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101
 Thunderbird/45.4.0
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:Q4rxbJGRklMhz/THsfT6tBsGd24zlQ9ywDHLiUOHGzVThTZO3+G
 2wNPv1oxLcUsv98MtTKFNQyW0Y/mxdsYZU9QoIIzAwJRS9MdMgy4X5cRKLmq9iNJ4bgJUkf
 dH6FU6gQ/TUnIH/keiBrdCaLhnN/iXZleA4UzgXtRKyqICpv2+dRTUzSZ402mwxWNzVvDUf
 05VQ8lXET0HE+qs9hEKOg==
X-UI-Out-Filterresults: notjunk:1;V01:K0:HSDhKAjS/1k=:23dMDFp7NZOTsjRWhU75IC
 sJGNr6RVXfjb+gqHex0GINTiP0+aLRiLICtwEu26Rq4u7GyEdX+DchxYc0kI9yMVEZh7REXnZ
 KV86rWnVJqIIYHkK8GGbVCxb0WAfZX1oNGZ4OdmfHeh7mIm91Ok5UnJPzf8RgSjf9pmi+/8me
 vVDwKVOD1U0+PKU/DITWGezqdgU8ybzN+I/3jApEXyJhX0TQUbu5QOWJ2HUhJYLoFbuUA1rz0
 j1CSJFSRgXAPi+LsGvduIhlzVHUSqWk9n5FGoIObGD+9UR3Oph/AgeCXhN7Gh2dJs0aP0BCkm
 jJZ83wKhHP2xtFXMvufV4kMKA/aAsagpr6v1dTTv+/tvJXId3YPmrGux7yGKLJ0ZrtNAy5YBc
 yL0gvUFYrJe5GvLIVs2xZut30IgYQ6Tq26sBCJcQkE4LI1lwNAzLUNZkWL1XkpUgIXwiNbmhQ
 FNGwy9+BpNn6w8QIlAyDe3FNev1DiT+sNIIQ5gXBZlfNyT8wqKgChfylBtQeRWJdkKU5cDZdH
 QI5hie0IljnoUOfm2HxnzT4ce9f4LH/MyJxeRmnyu8mG6vK3/INBaj1iyIJZnDuuVXoB/a5G0
 gqMtxidbzfLEpxzdgETXAztg1ZBiXWwRO8SUAmpJFBWXIE9kQI/fsq9dcuKG+zL1gBwLH8Xqd
 ZP0okiKzgqbQD99Fe5nMWv0fi+llovPa8WVblaMCy8u5FA+JwT+UjYzGC11D2qhOC8Dy8H8nt
 LSiRxtXFgH0IX/vV/eTL3SzwVAwyOP7ISROlH/PjIsp3ZtEFy5vBJBg0q3Cnw7SMJED13OCHm
 H2rQrLD
X-archive-position: 66807
X-ecartis-version: Ecartis v1.0.0
Sender: oracle-l-bounce@freelists.org
Errors-to: oracle-l-bounce@freelists.org
X-original-sender: info@www.sqltools-plusplus.org
Precedence: normal
Reply-To: info@www.sqltools-plusplus.org
List-help: <mailto:ecartis@freelists.org?Subject=help>
List-unsubscribe: <oracle-l-request@freelists.org?Subject=unsubscribe>
List-software: Ecartis version 1.0.0
List-Id: oracle-l <oracle-l.freelists.org>
X-List-ID: oracle-l <oracle-l.freelists.org>
List-subscribe: <oracle-l-request@freelists.org?Subject=subscribe>
List-owner: <mailto:mark.bobak@proquest.com>
List-post: <mailto:oracle-l@freelists.org>
List-archive: <http://www.freelists.org/archives/oracle-l>
X-list: oracle-l

Hi Eriovaldo,

you've got already answers to your specific questions, however the way I 
you understand your description these answers won't necessarily help you 
with your problem.

If your application issues the dynamic query using a variable length IN 
list of bind variables (so e.g. uses IN (:b1, :b2, :b3) in case of three 
members, IN (:b1, :b2, :b3, :b4) in case of four members etc.) then you 
effectively end up with different SQL texts / SQL_IDs for each of these 
variations - so you actually don't re-use any of the plans potentially 
already available in the Shared Pool, except for those cases where you 
issue the statement with the same number of bind variables but 
different/same bind values.

Hence your problem is very likely related to different execution plans 
being generated for the different variations / SQL_IDs, but it could 
also be a optimization / hard parse issue - sometimes with a higher 
number of bind variables the optimizer might take very long to come up 
with an execution plan.

So as a first step you need to identify what the problem actually is 
(bad execution plan, hard parse, something else) by measuring where the 
time goes e.g. via SQL trace, or maybe via Active Session History if you 
have an Enterprise Edition plus Diagnostic Pack license, then you can 
decide what measures you have at your disposal.

Randolf

> 1.) How can I do to force Oracle always generate a new execution plan and
> not reuse the plan that is in cache ?
> 2.) Is there a way to clear a execution plan for a specific sql_id ? (I
> have the sql_id that supose is with the bad execution plan).
--
http://www.freelists.org/webpage/oracle-l


