Return-Path: Delivered-To: 2-oracle-l@orafaq.com Received: (qmail 27857 invoked from network); 22 Jan 2008 19:01:43 -0600 Received: from freelists-180.iquest.net (HELO turing.freelists.org) (206.53.239.180) by static-ip-69-64-49-119.inaddr.intergenia.de with SMTP; 22 Jan 2008 19:01:43 -0600 Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 4D71E7EB0D4; Tue, 22 Jan 2008 20:01:43 -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 25389-05; Tue, 22 Jan 2008 20:01:43 -0500 (EST) Received: from turing (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id B5BDC7EB5DD; Tue, 22 Jan 2008 20:01:42 -0500 (EST) Received: with ECARTIS (v1.0.0; list oracle-l); Tue, 22 Jan 2008 19:13:48 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id CF5C37EAED6 for ; Tue, 22 Jan 2008 19:13:48 -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 19242-01 for ; Tue, 22 Jan 2008 19:13:48 -0500 (EST) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.159]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id BA8C37EB007 for ; Tue, 22 Jan 2008 19:13:47 -0500 (EST) Received: by fg-out-1718.google.com with SMTP id d23so2076051fga.32 for ; Tue, 22 Jan 2008 16:13:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=AkuvrSlb4Q3AM4wAHa1wN5RGkeOvi3hG3oykvQr5IuQ=; b=ShB1HQqn3Tac7pxlwGVGL8LTbGID3XnynIibtgZixEVdTFHnyqfY0TShyvS0HHYu6XuxML2TeHDyr/AfkMdWWVyH9YsoTMIl6Lc6Te/kj9DWbW1JPrEJjtsh+iEXMH63ELw5YPvGOUa8d74CVqBh/JcjO+ApGVFa2z6Un/k2NK4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=Pjlf5HsqRGMoZcpwAqV7vXW9wt0L02QoriiNKDjiFnUOeHzFLqCu4tp0z1yTKdkfZIYNYRCfwgSR63Rq5Qf0/KmGYWwAMy3rrW1elvKPMshyhGe1mIsP6OWBRIeKf+rVQ6SMuumYmtkmIPgXFY1OypA0VLV5Ek3XTnTFUu+2K3E= Received: by 10.86.25.17 with SMTP id 17mr8255315fgy.73.1201047226945; Tue, 22 Jan 2008 16:13:46 -0800 (PST) Received: by 10.86.27.8 with HTTP; Tue, 22 Jan 2008 16:13:46 -0800 (PST) Message-ID: <666b99c70801221613v5eab8e8eo3fbae58a6c45d6bc@mail.gmail.com> Date: Tue, 22 Jan 2008 16:13:46 -0800 From: Prasad To: kennaim@gmail.com Subject: Re: Paralellizing Pl/sql inserts Cc: oracle-l@freelists.org In-Reply-To: <901CE9A27473416CABACB807651DE527@KenPC> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_11690_31798650.1201047226900" References: <4ef2fbf50801221450g7a887eb7w9a0e0a6b7aac8a0f@mail.gmail.com> <329b3afe0801221518x36a941e1ga2ca456f7a311152@mail.gmail.com> <901CE9A27473416CABACB807651DE527@KenPC> X-archive-position: 4856 X-ecartis-version: Ecartis v1.0.0 Sender: oracle-l-bounce@freelists.org Errors-to: oracle-l-bounce@freelists.org X-original-sender: p4cldba@gmail.com Precedence: normal Reply-to: p4cldba@gmail.com List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: oracle-l X-List-ID: oracle-l List-subscribe: List-owner: List-post: List-archive: X-list: oracle-l X-Virus-Scanned: Debian amavisd-new at localhost.localdomain ------=_Part_11690_31798650.1201047226900 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Have you tried BULK insert . On Jan 22, 2008 4:03 PM, Ken Naim wrote: > > I have a process that is currently running at a rate of 4 million inserts > per hour. In selects from a cursor that returns 65 million records bulk > collects 500 at a time and forall inserts them into another table with 1.5 > billion rows. I cannot do an insert as select as the record may already > exists. I use the save exceptions clause to allow the code to continue > processing but I don't care about which record turn the unique constraint > violation. The 1.2 billion row table is partitioned but the data can go > into > any partition. The 65 million row table is not partitioned > > On smaller tables I would do a minus between the primary keys of both > tables > and use that as a filter on an insert as select. > > The 65 million record cursor takes only 15 minutes to return all 65 > million > records, so 98.5% of the time is consumed by the inserts. I am going to > move > the table to non assm tablespace and increase its free lists but I believe > these measures will only provide a marginal improvement. 33% of the > elapsed > time is waiting on cpu and the top wait events are db file sequential read > (94%) and db file scattered read (6%) > > The business requires this process to run in under 2 hours as it will run > weekly (if not daily) so I need an order of magnitude increase in > performance. The infrastructure (server/storage array etc.) is high end > and > shows little load during this process and this process will be the only > one > running on the box at that time. > > I am open to any suggestions but my question is how can I parallelize the > process into multiple (24-48) threads. > > Thanks, > Ken > > -- > http://www.freelists.org/webpage/oracle-l > > > ------=_Part_11690_31798650.1201047226900 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Have you tried BULK insert .

On Jan 22, 2008 4:03 PM, Ken Naim <kennaim@gmail.com> wrote:

I have a process that is currently running at a rate of 4 million inserts
per hour. In selects from a cursor that returns 65 million records bulk
collects 500 at a time and forall inserts them into another table with 1.5
billion rows. I cannot do an insert as select as the record may already
exists. I use the save exceptions clause to allow the code to continue
processing but I don't care about which record turn the unique constraint
violation. The 1.2 billion row table is partitioned but the data can go into
any partition. The 65 million row table is not partitioned

On smaller tables I would do a minus between the primary keys of both tables
and use that as a filter on an insert as select.

The 65 million record cursor takes only 15 minutes to return all 65 million
records, so 98.5% of the time is consumed by the inserts. I am going to move
the table to non assm tablespace and increase its free lists but I believe
these measures will only provide a marginal improvement. 33% of the elapsed
time is waiting on cpu and the top wait events are db file sequential read
(94%) and db file scattered read (6%)

The business requires this process to run in under 2 hours as it will run
weekly (if not daily) so I need an order of magnitude increase in
performance. The infrastructure (server/storage array etc.) is high end and
shows little load during this process and this process will be the only one
running on the box at that time.

I am open to any suggestions but my question is how can I parallelize the
process into multiple (24-48) threads.

Thanks,
Ken

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



------=_Part_11690_31798650.1201047226900-- -- http://www.freelists.org/webpage/oracle-l