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 3515D1961158
 for <oracle-l@orafaq.com>; Thu,  2 Feb 2017 16:50:01 +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>; Thu,  2 Feb 2017 16:50:01 +0100 (CET)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 2459C6C463;
 Thu,  2 Feb 2017 10:50:00 -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 6dt0LMl5X_z3; Thu,  2 Feb 2017 10:50:00 -0500 (EST)
Received: from turing.freelists.org (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id EE20A6C548;
 Thu,  2 Feb 2017 10:49:42 -0500 (EST)
Received: with ECARTIS (v1.0.0; list oracle-l); Thu, 02 Feb 2017 10:48:21 -0500 (EST)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 25C056C43D
 for <oracle-l@freelists.org>; Thu,  2 Feb 2017 10:48:21 -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 MgXMG823ppbA for <oracle-l@freelists.org>;
 Thu,  2 Feb 2017 10:48:21 -0500 (EST)
Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id E98F26C432
 for <oracle-l@freelists.org>; Thu,  2 Feb 2017 10:48:20 -0500 (EST)
Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71])
 by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v12FmII8020732
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Thu, 2 Feb 2017 15:48:18 GMT
Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235])
 by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v12FmHhP009408
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
 Thu, 2 Feb 2017 15:48:17 GMT
Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12])
 by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id v12FmFnp020671;
 Thu, 2 Feb 2017 15:48:16 GMT
MIME-Version: 1.0
Message-ID: <ba732017-07d3-42d4-957e-24f5f68d007c@default>
Date: Thu, 2 Feb 2017 07:48:13 -0800 (PST)
From: Jeff Smith <jeff.d.smith@oracle.com>
To: jonathan@jlcomp.demon.co.uk, oracle-l@freelists.org
Subject: RE: Tuning "INSERT as SELECT"
References: <TY1PR01MB0538F2C3A70674B77DBBC319BC4C0@TY1PR01MB0538.jpnprd01.prod.outlook.com>>
 <<MMXP123MB0911F7009F1BED10AA6BAB08A54C0@MMXP123MB0911.GBRP123.PROD.OUTLOOK.COM>>
 <<TY1PR01MB05389100D912B48FB267515ABC4C0@TY1PR01MB0538.jpnprd01.prod.outlook.com>
 <MMXP123MB091187B141E6CCC3961E7615A54C0@MMXP123MB0911.GBRP123.PROD.OUTLOOK.COM>>
 <<9277cbb0-ab06-421e-a6e9-2fd5f80a5fe8@default>
 <MMXP123MB091169E81091B9A3948BC288A54C0@MMXP123MB0911.GBRP123.PROD.OUTLOOK.COM>
In-Reply-To: <MMXP123MB091169E81091B9A3948BC288A54C0@MMXP123MB0911.GBRP123.PROD.OUTLOOK.COM>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Source-IP: userv0021.oracle.com [156.151.31.71]
X-archive-position: 67560
X-ecartis-version: Ecartis v1.0.0
Sender: oracle-l-bounce@freelists.org
Errors-to: oracle-l-bounce@freelists.org
X-original-sender: jeff.d.smith@oracle.com
Precedence: normal
Reply-To: jeff.d.smith@oracle.com
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

Doesn't everyone have EE + all the goodies?=20

The tool will prompt you with a warning that you'll need the tuning pack. I=
f you can, get the 2nd EA update - we've updated the interface to hopefully=
 show everything you'd expect. And of course share your feedback to me dire=
ctly or on our OTN Forums Space.=20

-----Original Message-----
From: Jonathan Lewis [mailto:jonathan@jlcomp.demon.co.uk]=20
Sent: Thursday, February 02, 2017 10:45 AM
To: oracle-l@freelists.org
Subject: Re: Tuning "INSERT as SELECT"


Good point - much more widely available.

Still requires the licences, of course.

Regards
Jonathan Lewis

________________________________________
From: Jeff Smith <jeff.d.smith@oracle.com>
Sent: 02 February 2017 15:43:19
To: Jonathan Lewis; Prem Khanna J; oracle-l@freelists.org
Subject: RE: Tuning "INSERT as SELECT"

FWIW, SQL Developer 4.2, currently in EA, also has a new RTSM report viewer=
.

View > DBA > Tuning.

-----Original Message-----
From: Jonathan Lewis [mailto:jonathan@jlcomp.demon.co.uk]
Sent: Thursday, February 02, 2017 10:40 AM
To: Prem Khanna J <jprem@outlook.com>; oracle-l@freelists.org
Subject: Re: Tuning "INSERT as SELECT"


In the first place I would examine the query to decide whether or not I cou=
ld identify a path that was likely to be the most efficient. You indicated =
that the query might only reference one table, in which case that might be =
quite easy to do ;) but if it's one main table and several others, or if yo=
u have scalar subqueries in the select list there may be some scope for doi=
ng some mental gymnastics and then seeing whether or not Oracle agrees with=
 your analysis.

If I couldn't work out why Oracle was taking longer than expected - and ass=
uming I had licensed the diagnostic and performance packs I'd take advantag=
e of the SQL Monitoring option - either through OEM, or through the procedu=
re dbms_sqltune.report_sql_monitor.  There's a comment and example in the f=
ollowing posting: http://jonathanlewis.wordpress.com/2015/12/21/parallel-pl=
ans-2/

The figures are updated every few seconds so you can watch the progression =
of your query and may get enough clues to figure out how long it's going to=
 take, where the time goes and why. Easiest if you have the OEM screen hand=
y, but you can dump the text version a few times.

Regards
Jonathan Lewis


________________________________________
From: Prem Khanna J <jprem@outlook.com>
Sent: 02 February 2017 14:12:32
To: Jonathan Lewis; oracle-l@freelists.org
Subject: Re: Tuning "INSERT as SELECT"

Hi Jonathan / Mladen / Tim and All - tons of thanks for your inputs.

>>Did you really select and fetch 80 million rows ?  or was it the first fe=
w, or a count(*) of an inline view, or what ?

You are on spot . we did a "select count(*) from inline view" :-(    Also t=
ested with "+all_rows" hint in sql*developer thinking that might help , but=
 now I feel like
that's also not the right way of testing as sql*developer stops with first =
50~100 rows. Will let the exact SQL run all the way in sql*plus and see lon=
g it takes.Just curious - is there any other way of doing it (don't want to=
 see all the 80m recs in sql*plus) or how would you guys do it ?

>> ... your test starts with a truncate then it will have made the indexes =
valid again.

Exaclty. we made indexes "unusable" , truncated the table before I ran my t=
ests. Did not imagine that truncate would my indexes valid. Just checked an=
d it was so.
Shocked !! Wonder why truncate does so. Thanks a million Jonathan for letti=
ng me know that.

>> please turn on SQL tracing using DBMS_MONITOR or .... Everything else is=
 pure witchcraft.
Sure Mladen. Thanks again for the valuable piece of advice.

Will continue with my tests and keep you guys posted.

Regards,
Prem

--
http://www.freelists.org/webpage/oracle-l


--
http://www.freelists.org/webpage/oracle-l


--
http://www.freelists.org/webpage/oracle-l


