Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Exporting large tables!!!

Re: Exporting large tables!!!

From: Alan D. Mills <alanmNOSPAM_at_uk.europe.mcd.mot.com>
Date: Wed, 19 Aug 1998 13:18:20 +0100
Message-ID: <6refpp$9bu$1@schbbs.mot.com>


I would be wary of copying your data in one statement as discussed. If the reason you are exporting the table is because it's getting very large then you will likely be in danger of blowing your rollback segments by doing the likes of

create table ... as select * from ...

You'll probably want to put this into a piece of PL/SQL. have a cursor and loop through it with insert statements remembering to commit every few thousand records or so.

Alternatively, why not use the folliwng algorithm.

  1. Store exact date/time now as EXPORT_DATE
  2. Perform table export
  3. Delete from table where date_created column <= 'EXPORT_DATE'

Of course this only works if your have a date created/updated column in your table. Alternatively, if you are using a sequence to populate a primary key then keep a copy of the highest ID in the table and delete all those lower than it.

I agree though, short of locking the table it'll be a slow and long job.

--
Alan D. Mills

Jerry Gitomer wrote in message <35D9D3FB.29F6_at_ictgroup.com>...
>Hi Vinnie,
>
> I have two proposed solutions and am happy with neither of them. The
>first one requires locking the table from inserts and updates for as
Received on Wed Aug 19 1998 - 07:18:20 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US