Return-Path: <oracle-l-bounce@freelists.org>
X-Original-To: oracle-l@orafaq.com
Delivered-To: oracle-l@orafaq.com
Received: from turing.freelists.org (turing.freelists.org [206.53.239.180])
 by malta2546.startdedicated.com (Postfix) with ESMTPS id 6701D100339469
 for <oracle-l@orafaq.com>; Fri, 28 Aug 2020 16:49:01 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 1866327FF2;
 Fri, 28 Aug 2020 10:49:00 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=freelists.org;
 s=turing; t=1598626140;
 bh=cvknHi4BTmgWifDsASGB3OA0OSSgA2/HRgVm+o0wSO0=;
 h=From:Sender:Sender:From;
 b=SqvXaDIfnzsDfmaR5yIE9bsw9MnWtG9coRjE/+ejJiuizUqTzLDWLjnqj4Q/QuJhA
	 oVc5XTnvDpsPlvUgMKGX1HEeRYtGbvWZ3DreSzxe/3otDi7BgQFBqZDjg+L9WSUgNU
	 HqTlB6qxCyYNhiChATIdVcSYy+OBcA823Ex0wFLc=
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 078H64Q0cVjr; Fri, 28 Aug 2020 10:48:59 -0400 (EDT)
Received: from turing.freelists.org (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id B09A027FFC;
 Fri, 28 Aug 2020 10:48:05 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=freelists.org;
 s=turing; t=1598626134;
 bh=cvknHi4BTmgWifDsASGB3OA0OSSgA2/HRgVm+o0wSO0=;
 h=From:Sender:Sender:From;
 b=Q3JRHIiy4A6BiDrZVv3NBHQvPux5hS8ECf43+6FlDAg5c0MelMKKPoz1cT1P36s3/
	 CedpE576p5YrmXF13ASxSqnkKFfhqcn50zMWwHAEZARBHAW3LNKUEhhMp43kfA9OIV
	 AFaqb5QCbpBRZ4i4dhSSeZYRvAc5Zw75SjCckS9E=
Received: with ECARTIS (v1.0.0; list oracle-l); Fri, 28 Aug 2020 10:47:18 -0400 (EDT)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id D1C972630C
 for <oracle-l@freelists.org>; Fri, 28 Aug 2020 10:47:17 -0400 (EDT)
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 C8qHZkRZn6pv for <oracle-l@freelists.org>;
 Fri, 28 Aug 2020 10:47:17 -0400 (EDT)
Received: from mx1.tidalhosting.net (mx1.tidalhosting.net [155.130.138.9])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 1CEF026356
 for <oracle-l@freelists.org>; Fri, 28 Aug 2020 10:47:17 -0400 (EDT)
Received: from mwf4500 (c-73-238-99-41.hsd1.nh.comcast.net [73.238.99.41]) by mx1.tidalhosting.net with SMTP
 (version=Tls
 cipher=Aes256 bits=256);
   Fri, 28 Aug 2020 10:47:00 -0400
From: "Mark W. Farnham" <mwf@rsiz.com>
To: <smishra_97@yahoo.com>,
 <oracle-l@freelists.org>,
 "'Tim Gorman'" <tim.evdbt@gmail.com>
References: <625546540.6286223.1598412528817.ref@mail.yahoo.com> <625546540.6286223.1598412528817@mail.yahoo.com> <CAGtsp8kbsMLJ8R+M7FJNfy=_CUWQ6Xva=sD0Q863qp8f8+fQ5g@mail.gmail.com> <CACj1VR5aM7eEqAobijxRSSZBEPyDfXFhGtWiS2CeguuAucWe=Q@mail.gmail.com> <1613067749.6729763.1598479894734@mail.yahoo.com> <CAOVevU6_tdPLbJeME0-cZj_FXni7+vNpvNZ20UUv7Qq8ZZe1+Q@mail.gmail.com> <2067790113.7736.1598489004999@mail.yahoo.com> <31132203-7dc2-0480-b770-6eb5d054e872@bluewin.ch> <98f95d81-cd31-bc52-8d5b-b553483e0d47@gmail.com> <1691487233.550567.1598581275725@mail.yahoo.com>
In-Reply-To: 
Subject: RE: Big Update/DML
Date: Fri, 28 Aug 2020 10:46:51 -0400
Message-ID: <0bfb01d67d4a$11595f50$340c1df0$@rsiz.com>
MIME-Version: 1.0
Content-Type: multipart/alternative;
 boundary="----=_NextPart_000_0BFC_01D67D28.8A5F8D10"
Content-Language: en-us
X-Exim-Id: 0bfb01d67d4a$11595f50$340c1df0$
X-archive-position: 77612
X-ecartis-version: Ecartis v1.0.0
Sender: oracle-l-bounce@freelists.org
Errors-to: oracle-l-bounce@freelists.org
X-original-sender: mwf@rsiz.com
Precedence: normal
Reply-To: mwf@rsiz.com
List-Help: <mailto:ecartis@freelists.org?Subject=help>
List-Unsubscribe: <mailto: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: <mailto:oracle-l-request@freelists.org?Subject=subscribe>
List-Owner: <mailto:>
List-post: <mailto:oracle-l@freelists.org>
List-Archive: <http://www.freelists.org/archives/oracle-l>
X-list: oracle-l
------=_NextPart_000_0BFC_01D67D28.8A5F8D10
Content-Type: text/plain;
 charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Humor me: Run it forced local into a newly created tablespace that is =
ONLY the destination of the CTAS and has no other competing dictionary =
and/or space management.

=20

From: Mark W. Farnham [mailto:mwf@rsiz.com]=20
Sent: Friday, August 28, 2020 10:45 AM
To: 'smishra_97@yahoo.com'; 'oracle-l@freelists.org'; 'Tim Gorman'
Subject: RE: Big Update/DML

=20

=E2=80=9CContention was only seen for Interconnect or some gc =
wait=E2=80=9D

=20

Humor me: Run it forced local.=20

=20

From: oracle-l-bounce@freelists.org =
[mailto:oracle-l-bounce@freelists.org] On Behalf Of Sanjay Mishra =
(Redacted sender "smishra_97" for DMARC)
Sent: Thursday, August 27, 2020 10:21 PM
To: oracle-l@freelists.org; Tim Gorman
Subject: Re: Big Update/DML

=20

Tim

=20

Thanks for the update. Based on the Sqlmonitor data shared earlier , it =
was using Parallel for DDL operation but I will give another try again =
as working to load another table in Nocompress as existing one is =
Compress for OLTP. Tablespace was given 1.5T space as it was initially =
extending it heavily and that helped to increase the throughput. =
Contention was only seen for Interconnect or some gc wait and CPU =
Contention or any high IO wait was also not seen in the AWR report.=20

=20

Do we think Advance compression can be major bottleneck as I earlier =
thought that it might help in utilizing buffer space but doesn't look =
like the case.=20

=20

Will share details soon

=20

Tx

Sanjay

=20

On Thursday, August 27, 2020, 05:08:41 PM EDT, Tim Gorman =
<tim.evdbt@gmail.com> wrote:=20

=20

=20

Agreed!  Pardon my unwarranted guess, but perhaps parallel DDL (which is =
enabled by default) was not enabled in the session for some reason =
before starting CTAS?  To verify, consider running the following query =
after ALTER SESSION ENABLE PARALLEL DDL and before CTAS?

select pddl_status from v$session where sid in (select distinct sid from =
v$mystat);


...or better yet, check PDDL_STATUS from another session?

Another possible issue is high-water mark management.  If the datafiles =
in the tablespace in which you're creating the new table in the CTAS =
statement has to be autoextended to accommodate the volume of data =
you're loading, then things might take longer.  If the INCREMENT_BY =
(i.e. NEXT) for the datafile(s) is really small, then datafile =
autoextension might take a *REALLY* long time;  look for waits on "enq: =
HV - contention" or "enq: HW - contention"?  At any rate, the solution =
is to either make INCREMENT_BY really large, or just resize the datafile =
to accommodate what you're building.

There are other possible issues to be considered.  The key is to monitor =
the operation and use the information that the Oracle RDBMS provides to =
understand why you're bottlenecked and resolve it.

If you need suggestions for monitoring specific actions, please ask?  It =
is frustrating when someone announces "it doesn't work" with no attempt =
to understand why.



On 8/27/2020 3:41 AM, Lothar Flatz wrote:

Hi,

with regards to CTAS it is very hard to believe it takes that long. I am =
pretty sure that there is something wrong.
A sql monitor would be extremly helpfull.

Regards

Lothar

Am 27.08.2020 um 02:43 schrieb Sanjay Mishra (Redacted sender smishra_97 =
for DMARC):

Sayan

=20

Update statement is=20

=20

Update snows.stamp_detail set set =
stamp_process_calc=3Dprocessed_calc_amt;

=20

Tried to use

1. Parallel DML with 100 --> Taking 20+hrs

2. CTAS was tried using half a billion as well as 1 billion rows with =
parallel 50, 75,100 - Almost same result

3. CTAS with nologging using same step 2 but still not much improvement

=20

We have 5-10 such big table and so running each with this much =
time-frame need high downtime

Tx

Sanjay

=20

On Wednesday, August 26, 2020, 08:23:18 PM EDT, Sayan Malakshinov  =
<mailto:xt.and.r@gmail.com> <xt.and.r@gmail.com> wrote:=20

=20

=20

Hi Sanjay,=20

=20

It would be better if you provide more details about your update. Exact =
update statement would be helpful. is this column nullable/not null?

=20

=20

On Thu, Aug 27, 2020 at 1:12 AM Sanjay Mishra =
<dmarc-noreply@freelists.org> wrote:

Andy

=20

Yes look like is an option if we are doing work online and despite take =
more time but need not require downtime. In our case multiple DDL are =
running to existing environment due to Application upgrade and so all =
work has to be done with downtime. So challenge is reduce time of DML =
operations on big tables containing few billions rows.

=20

Tx

Sanjay

=20

On Wednesday, August 26, 2020, 11:20:55 AM EDT, Andy Sayer =
<andysayer@gmail.com> wrote:=20

=20

=20

It does sound like a virtual column could be the ideal solution. But if =
data needs to be physically stored or cannot be calculated =
deterministically at any point in time then Connor has a great demo of =
using dbms_redefinition to create a new table online with a function to =
map the new column. There=E2=80=99s obviously some overhead with context =
switching but it may be far better than some of the obstacles you might =
be facing at the moment: =20

https://connor-mcdonald.com/2016/11/16/performing-a-large-correlated-upda=
te/ (and you might be able to help it with pragma udf in the right =
circumstances).

=20

Obviously, how helpful this is depends where the work is currently going =
and how online this needs to be.=20

=20

=20

Thanks,

Andrew

=20

On Wed, 26 Aug 2020 at 16:00, Jonathan Lewis <jlewisoracle@gmail.com> =
wrote:

=20

Is that 3-4 billion rows each, or total ?

=20

I would be a little suspicious of an update which populates a new column =
with a value derived from existing columns. What options might you have =
for declaring a virtual column instead - which you could index if =
needed.

=20

Be extremely cautious about calculating space requirements - if you're =
updating every row on old data might you find that you're causing a =
significant fraction of the rows in each block to migrate, and there's a =
peculiarity of bulk row migration that can effectively "waste" 25% of =
the space in every block that becomes the target of a migrated row.=20

=20

This effects can be MUCH work when the table is compress (even for OLTP) =
since the update has to decompress the row before updating and then only =
"re-compresses" intermittently as the block becomes full.  The CPU cost =
can be horrendous and you still have the problem of migration if the =
addition means the original rows can no longer fit in the block.

=20

If it is necessary to add the column you may want to review "alter table =
move online" can do in the latest versions (in case you can make it add =
the column as you move) or review the options for dbms_redefinition - =
maybe running several redefinitions concurrently rather than trying to =
do any parallel update to any single table.

=20

Regards

Jonathan Lewis

=20

=20

=20

=20

=20




=20

--=20

Best regards,
Sayan Malakshinov

Oracle performance tuning engineer

Oracle ACE Associate
http://orasql.org

=20


------=_NextPart_000_0BFC_01D67D28.8A5F8D10
Content-Type: text/html;
 charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40"><head><meta =
http-equiv=3DContent-Type content=3D"text/html; charset=3Dutf-8"><meta =
name=3DGenerator content=3D"Microsoft Word 14 (filtered =
medium)"><style><!--
/* Font Definitions */
@font-face
	{font-family:Helvetica;
	panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
	{font-family:Courier;
	panose-1:2 7 4 9 2 2 5 2 4 4;}
@font-face
	{font-family:Courier;
	panose-1:2 7 4 9 2 2 5 2 4 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
tt
	{mso-style-priority:99;
	font-family:"Courier New","serif";}
span.EmailStyle18
	{mso-style-type:personal;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
span.EmailStyle19
	{mso-style-type:personal-reply;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]--></head><body lang=3DEN-US link=3Dblue =
vlink=3Dpurple><div class=3DWordSection1><p class=3DMsoNormal><span =
style=3D'font-size:14.0pt;font-family:"Calibri","sans-serif";color:#1F497=
D'>Humor me: Run it forced local into a newly created tablespace that is =
ONLY the destination of the CTAS and has no other competing dictionary =
and/or space management.<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-size:14.0pt;font-family:"Calibri","sans-serif";color:#1F497=
D'><o:p>&nbsp;</o:p></span></p><div><div =
style=3D'border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in =
0in 0in'><p class=3DMsoNormal><b><span =
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span>=
</b><span style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'> =
Mark W. Farnham [mailto:mwf@rsiz.com] <br><b>Sent:</b> Friday, August =
28, 2020 10:45 AM<br><b>To:</b> 'smishra_97@yahoo.com'; =
'oracle-l@freelists.org'; 'Tim Gorman'<br><b>Subject:</b> RE: Big =
Update/DML<o:p></o:p></span></p></div></div><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal><span =
style=3D'font-size:14.0pt;font-family:"Calibri","sans-serif";color:#1F497=
D'>=E2=80=9CContention was only seen for Interconnect or some gc =
wait=E2=80=9D<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-size:14.0pt;font-family:"Calibri","sans-serif";color:#1F497=
D'><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-size:14.0pt;font-family:"Calibri","sans-serif";color:#1F497=
D'>Humor me: Run it forced local. <o:p></o:p></span></p><p =
class=3DMsoNormal><span =
style=3D'font-size:14.0pt;font-family:"Calibri","sans-serif";color:#1F497=
D'><o:p>&nbsp;</o:p></span></p><div><div =
style=3D'border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in =
0in 0in'><p class=3DMsoNormal><b><span =
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span>=
</b><span style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'> =
<a =
href=3D"mailto:oracle-l-bounce@freelists.org">oracle-l-bounce@freelists.o=
rg</a> [<a =
href=3D"mailto:oracle-l-bounce@freelists.org">mailto:oracle-l-bounce@free=
lists.org</a>] <b>On Behalf Of </b>Sanjay Mishra (Redacted sender =
&quot;smishra_97&quot; for DMARC)<br><b>Sent:</b> Thursday, August 27, =
2020 10:21 PM<br><b>To:</b> <a =
href=3D"mailto:oracle-l@freelists.org">oracle-l@freelists.org</a>; Tim =
Gorman<br><b>Subject:</b> Re: Big =
Update/DML<o:p></o:p></span></p></div></div><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><div><div><p =
class=3DMsoNormal><span style=3D'font-size:10.0pt;font-family:"Courier =
New","serif"'>Tim<o:p></o:p></span></p></div><div><p =
class=3DMsoNormal><span style=3D'font-size:10.0pt;font-family:"Courier =
New","serif"'><o:p>&nbsp;</o:p></span></p></div><div><p =
class=3DMsoNormal><span style=3D'font-size:10.0pt;font-family:"Courier =
New","serif"'>Thanks for the update. Based on the Sqlmonitor data shared =
earlier , it was using Parallel for DDL operation but I will give =
another try again as working to load another table in Nocompress as =
existing one is Compress for OLTP. Tablespace was given 1.5T space as it =
was initially extending it heavily and that helped to increase the =
throughput. Contention was only seen for Interconnect or some gc wait =
and CPU Contention or any high IO wait was also not seen in the AWR =
report.&nbsp;<o:p></o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Courier =
New","serif"'><o:p>&nbsp;</o:p></span></p></div><div><p =
class=3DMsoNormal><span style=3D'font-size:10.0pt;font-family:"Courier =
New","serif"'>Do we think Advance compression can be major bottleneck as =
I earlier thought that it might help in utilizing buffer space but =
doesn't look like the case.&nbsp;<o:p></o:p></span></p></div><div><p =
class=3DMsoNormal><span style=3D'font-size:10.0pt;font-family:"Courier =
New","serif"'><o:p>&nbsp;</o:p></span></p></div><div><p =
class=3DMsoNormal><span style=3D'font-size:10.0pt;font-family:"Courier =
New","serif"'>Will share details soon<o:p></o:p></span></p></div><div><p =
class=3DMsoNormal><span style=3D'font-size:10.0pt;font-family:"Courier =
New","serif"'><o:p>&nbsp;</o:p></span></p></div><div><p =
class=3DMsoNormal><span style=3D'font-size:10.0pt;font-family:"Courier =
New","serif"'>Tx<o:p></o:p></span></p></div><div><p =
class=3DMsoNormal><span style=3D'font-size:10.0pt;font-family:"Courier =
New","serif"'>Sanjay<o:p></o:p></span></p></div><div><p =
class=3DMsoNormal><span style=3D'font-size:10.0pt;font-family:"Courier =
New","serif"'><o:p>&nbsp;</o:p></span></p></div></div><div =
id=3D"yahoo_quoted_9067706048"><div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'>On Thursday, August 27, 2020, 05:08:41 PM EDT, Tim Gorman &lt;<a =
href=3D"mailto:tim.evdbt@gmail.com">tim.evdbt@gmail.com</a>&gt; wrote: =
<o:p></o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'><o:p>&nbsp;</o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'><o:p>&nbsp;</o:p></span></p></div><div><div =
id=3Dyiv5543919164><div><p class=3DMsoNormal =
style=3D'margin-bottom:12.0pt'><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'>Agreed!&nbsp; Pardon my unwarranted guess, but perhaps parallel DDL =
(which is enabled by default) was not enabled in the session for some =
reason before starting CTAS?&nbsp; To verify, consider running the =
following query after ALTER SESSION ENABLE PARALLEL DDL and before =
CTAS?<o:p></o:p></span></p><p class=3DMsoNormal><tt><span =
style=3D'font-size:10.0pt;color:#26282A'>select pddl_status from =
v$session where sid in (select distinct sid from =
v$mystat);</span></tt><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'><o:p></o:p></span></p><p class=3DMsoNormal =
style=3D'margin-bottom:12.0pt'><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'><br>...or better yet, check PDDL_STATUS from another =
session?<br><br>Another possible issue is high-water mark =
management.&nbsp; If the datafiles in the tablespace in which you're =
creating the new table in the CTAS statement has to be autoextended to =
accommodate the volume of data you're loading, then things might take =
longer.&nbsp; If the INCREMENT_BY (i.e. NEXT) for the datafile(s) is =
really small, then datafile autoextension might take a *REALLY* long =
time;&nbsp; look for waits on &quot;enq: HV - contention&quot; or =
&quot;enq: HW - contention&quot;?&nbsp; At any rate, the solution is to =
either make INCREMENT_BY really large, or just resize the datafile to =
accommodate what you're building.<br><br>There are other possible issues =
to be considered.&nbsp; The key is to monitor the operation and use the =
information that the Oracle RDBMS provides to understand why you're =
bottlenecked and resolve it.<br><br>If you need suggestions for =
monitoring specific actions, please ask?&nbsp; It is frustrating when =
someone announces &quot;it doesn't work&quot; with no attempt to =
understand why.<br><br><o:p></o:p></span></p><div =
id=3Dyiv5543919164yqt70173><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'>On 8/27/2020 3:41 AM, Lothar Flatz =
wrote:<o:p></o:p></span></p></div></div></div><div =
id=3Dyiv5543919164yqt45937><div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'>Hi,<br><br>with regards to CTAS it is very hard to believe it takes =
that long. I am pretty sure that there is something wrong.<br>A sql =
monitor would be extremly =
helpfull.<br><br>Regards<br><br>Lothar<br><br>Am 27.08.2020 um 02:43 =
schrieb Sanjay Mishra (Redacted sender smishra_97 for =
DMARC):<o:p></o:p></span></p></div></div><div><div><div><p =
class=3DMsoNormal><span style=3D'font-size:10.0pt;font-family:"Courier =
New","serif";color:#26282A'>Sayan<o:p></o:p></span></p></div><div><p =
class=3DMsoNormal><span style=3D'font-size:10.0pt;font-family:"Courier =
New","serif";color:#26282A'><o:p>&nbsp;</o:p></span></p></div><div><p =
class=3DMsoNormal><span style=3D'font-size:10.0pt;font-family:"Courier =
New","serif";color:#26282A'>Update statement =
is&nbsp;<o:p></o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Courier =
New","serif";color:#26282A'><o:p>&nbsp;</o:p></span></p></div><div><p =
class=3DMsoNormal><span style=3D'font-size:10.0pt;font-family:"Courier =
New","serif";color:#26282A'>Update snows.stamp_detail set set =
stamp_process_calc=3Dprocessed_calc_amt;<o:p></o:p></span></p></div><div>=
<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Courier =
New","serif";color:#26282A'><o:p>&nbsp;</o:p></span></p></div><div><p =
class=3DMsoNormal><span style=3D'font-size:10.0pt;font-family:"Courier =
New","serif";color:#26282A'>Tried to =
use<o:p></o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Courier =
New","serif";color:#26282A'>1. Parallel DML with 100 --&gt; Taking =
20+hrs<o:p></o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Courier =
New","serif";color:#26282A'>2. CTAS was tried using half a billion as =
well as 1 billion rows with parallel 50, 75,100 - Almost same =
result<o:p></o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Courier =
New","serif";color:#26282A'>3. CTAS with nologging using same step 2 but =
still not much improvement<o:p></o:p></span></p></div><div><p =
class=3DMsoNormal><span style=3D'font-size:10.0pt;font-family:"Courier =
New","serif";color:#26282A'><o:p>&nbsp;</o:p></span></p></div><div><p =
class=3DMsoNormal><span style=3D'font-size:10.0pt;font-family:"Courier =
New","serif";color:#26282A'>We have 5-10 such big table and so running =
each with this much time-frame need high =
downtime<o:p></o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Courier =
New","serif";color:#26282A'>Tx<o:p></o:p></span></p></div><div><p =
class=3DMsoNormal><span style=3D'font-size:10.0pt;font-family:"Courier =
New","serif";color:#26282A'>Sanjay<o:p></o:p></span></p></div><div><p =
class=3DMsoNormal><span style=3D'font-size:10.0pt;font-family:"Courier =
New","serif";color:#26282A'><o:p>&nbsp;</o:p></span></p></div></div><div =
id=3D"yiv5543919164yahoo_quoted_9305524782"><div><div><p =
class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'>On Wednesday, August 26, 2020, 08:23:18 PM EDT, Sayan Malakshinov =
<a href=3D"mailto:xt.and.r@gmail.com" =
target=3D"_blank">&lt;xt.and.r@gmail.com&gt;</a> wrote: =
<o:p></o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'><o:p>&nbsp;</o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'><o:p>&nbsp;</o:p></span></p></div><div><div =
id=3Dyiv5543919164><div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'>Hi Sanjay, <o:p></o:p></span></p><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'><o:p>&nbsp;</o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'>It would be better if you provide more details about your update. =
Exact update statement would be helpful. is this column nullable/not =
null?<o:p></o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'><o:p>&nbsp;</o:p></span></p></div></div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'><o:p>&nbsp;</o:p></span></p><div =
id=3Dyiv5543919164yqt99090><div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'>On Thu, Aug 27, 2020 at 1:12 AM Sanjay Mishra &lt;<a =
href=3D"mailto:dmarc-noreply@freelists.org" =
target=3D"_blank">dmarc-noreply@freelists.org</a>&gt; =
wrote:<o:p></o:p></span></p></div><blockquote =
style=3D'border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in =
6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5=
.0pt'><div><div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:Courier;color:#26282A'>Andy<o:p></o=
:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:Courier;color:#26282A'><o:p>&nbsp;<=
/o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:Courier;color:#26282A'>Yes look =
like is an option if we are doing work online and despite take more time =
but need not require downtime. In our case multiple DDL are running to =
existing environment due to Application upgrade and so all work has to =
be done with downtime. So challenge is reduce time of DML operations on =
big tables containing few billions =
rows.<o:p></o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:Courier;color:#26282A'><o:p>&nbsp;<=
/o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:Courier;color:#26282A'>Tx<o:p></o:p=
></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:Courier;color:#26282A'>Sanjay<o:p><=
/o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:Courier;color:#26282A'><o:p>&nbsp;<=
/o:p></span></p></div></div><div =
id=3D"yiv5543919164gmail-m_389331017349516639yahoo_quoted_8813058018"><di=
v><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'>On Wednesday, August 26, 2020, 11:20:55 AM EDT, Andy Sayer &lt;<a =
href=3D"mailto:andysayer@gmail.com" =
target=3D"_blank">andysayer@gmail.com</a>&gt; wrote: =
<o:p></o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'><o:p>&nbsp;</o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'><o:p>&nbsp;</o:p></span></p></div><div><div =
id=3D"yiv5543919164gmail-m_389331017349516639yiv1410979998"><div><div><di=
v><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'>It does sound like a virtual column could be the ideal solution. =
But if data needs to be physically stored or cannot be calculated =
deterministically at any point in time then Connor has a great demo of =
using dbms_redefinition to create a new table online with a function to =
map the new column. There=E2=80=99s obviously some overhead with context =
switching but it may be far better than some of the obstacles you might =
be facing at the moment:&nbsp; <o:p></o:p></span></p><div><p =
class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'><a =
href=3D"https://connor-mcdonald.com/2016/11/16/performing-a-large-correla=
ted-update/" =
target=3D"_blank">https://connor-mcdonald.com/2016/11/16/performing-a-lar=
ge-correlated-update/</a> (and you might be able to help it with pragma =
udf in the right circumstances).<o:p></o:p></span></p></div><div><p =
class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'><o:p>&nbsp;</o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'>Obviously, how helpful this is depends where the work is currently =
going and how online this needs to =
be.&nbsp;<o:p></o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'><o:p>&nbsp;</o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'><o:p>&nbsp;</o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'>Thanks,<o:p></o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'>Andrew<o:p></o:p></span></p></div></div></div></div><div =
id=3D"yiv5543919164gmail-m_389331017349516639yiv1410979998yqt09142"><div>=
<div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'><o:p>&nbsp;</o:p></span></p><div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'>On Wed, 26 Aug 2020 at 16:00, Jonathan Lewis &lt;<a =
href=3D"mailto:jlewisoracle@gmail.com" =
target=3D"_blank">jlewisoracle@gmail.com</a>&gt; =
wrote:<o:p></o:p></span></p></div><blockquote =
style=3D'border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in =
6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5=
.0pt'><div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'><o:p>&nbsp;</o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'>Is that 3-4 billion rows each, or total =
?<o:p></o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'><o:p>&nbsp;</o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'>I would be a little suspicious of an update which populates a new =
column with a value derived from existing columns. What options might =
you have for declaring a virtual column instead - which you could index =
if needed.<o:p></o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'><o:p>&nbsp;</o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'>Be extremely cautious about calculating space requirements - if =
you're updating every row on old data might you find that you're causing =
a significant fraction of the rows in each block to migrate, and there's =
a peculiarity of bulk row migration that can effectively =
&quot;waste&quot; 25% of the space in every block that becomes the =
target of a migrated row. <o:p></o:p></span></p></div><div><p =
class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'><o:p>&nbsp;</o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'>This effects can be MUCH work when the table is compress (even for =
OLTP) since the update has to decompress the row before updating and =
then only &quot;re-compresses&quot; intermittently as the block becomes =
full.&nbsp; The CPU cost can be horrendous and you still have the =
problem of migration if the addition means the original rows can no =
longer fit in the block.<o:p></o:p></span></p></div><div><p =
class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'><o:p>&nbsp;</o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'>If it is necessary to add the column you may want to review =
&quot;alter table move online&quot; can do in the latest versions (in =
case you can make it add the column as you move) or review the options =
for dbms_redefinition - maybe running several redefinitions concurrently =
rather than trying to do any parallel update to any single =
table.<o:p></o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'><o:p>&nbsp;</o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'>Regards<o:p></o:p></span></p></div></div><div><div><p =
class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'>Jonathan Lewis<o:p></o:p></span></p></div><div><p =
class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'><o:p>&nbsp;</o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'><o:p>&nbsp;</o:p></span></p></div><div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'><o:p>&nbsp;</o:p></span></p></div></div><p class=3DMsoNormal =
style=3D'margin-bottom:12.0pt'><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'><o:p>&nbsp;</o:p></span></p></blockquote></div></div><p =
class=3DMsoNormal style=3D'margin-bottom:12.0pt'><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'><o:p>&nbsp;</o:p></span></p></div></div></div></div></div></div></di=
v></div></blockquote></div></div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'><br clear=3Dall><o:p></o:p></span></p><div><p =
class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'><o:p>&nbsp;</o:p></span></p></div><p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'>-- <o:p></o:p></span></p><div><div><div><div><div><p =
class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'>Best regards,<br>Sayan Malakshinov<o:p></o:p></span></p></div><p =
class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'>Oracle performance tuning engineer<o:p></o:p></span></p><div><p =
class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'>Oracle ACE Associate<br><a href=3D"http://orasql.org" =
target=3D"_blank">http://orasql.org</a><o:p></o:p></span></p></div></div>=
</div></div></div></div></div></div></div></div><p class=3DMsoNormal =
style=3D'margin-bottom:12.0pt'><span =
style=3D'font-size:10.0pt;font-family:"Helvetica","sans-serif";color:#262=
82A'><o:p>&nbsp;</o:p></span></p></div></div></div></div></div></div></di=
v></body></html>
------=_NextPart_000_0BFC_01D67D28.8A5F8D10--


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


