Ravindra,
That is basically what I do each 6 months for 6 large tables. I created a function 
that will insert the rows into an existing table and commit after so many rows. Then I 
use a script to delete the rows from the original table by date range and commit after 
each range specified.
It works great as I have about 1.6 GIG in the largest table and that one takes the 
better part of the day. The limiting factor is the size of the archivelog storage 
space 4 GIG so I have to watch it constantly and more the logs of to a different 
location.
Listed below is an example of my function to insert rows...
============
declare 
i  number :=0;

cursor c1 is  
select  RETNBR ,                
 SALEDATE      ,         
 GAMECODE      ,         
 ORDERAMT      ,         
 CONFIRMATIONAMT,        
 ACTIVATIONAMT  ,        
 SETTLEMENTAMT  ,        
 RETURNAMT      ,        
 CASHAMT        ,        
 SALESCOMMAMT   ,        
 CASHBONUSAMT   ,        
 TOTCOMMAMT              
 from glcIDsr_curr
 WHERE SALEDATE between '06-01-2001' and '06-30-2001';                  
         
IDSR_UPDATE  C1%ROWTYPE; 
                  
begin                                    
 open c1 ;                                 
 loop                                          
fetch c1 into IDSR_UPDATE ;                 
 exit when c1%NOTFOUND  ;                 
 insert into GLCIDSR_HIST01          
 values(IDSR_UPDATE.RETNBR,                 
 IDSR_UPDATE.SALEDATE,               
 IDSR_UPDATE.GAMECODE,               
 IDSR_UPDATE.ORDERAMT,               
 IDSR_UPDATE.CONFIRMATIONAMT,        
 IDSR_UPDATE.ACTIVATIONAMT,          
 IDSR_UPDATE.SETTLEMENTAMT,          
 IDSR_UPDATE.RETURNAMT,              
 IDSR_UPDATE.CASHAMT,                
 IDSR_UPDATE.SALESCOMMAMT,           
 IDSR_UPDATE.CASHBONUSAMT,           
 IDSR_UPDATE.TOTCOMMAMT);
i := i + 1;
if i > 200000 
   then
     commit; 
     i := 0;
   end if;  
end loop;
commit;      
close c1; 
end;
===========
After the deletions are complete I export the remaining data and truncate the table 
and then import the data to clean up the tablespace.
ROR mª¿ªm

>>> [EMAIL PROTECTED] 08/30/01 07:07PM >>>
I have few tables that will be getting populated with transaction data
continuously.This table
grows to large size.For us once the transaction is completed we don't need
the data to be in the database,
but we cannot delete them either.We need to archive those records and clear
those archived records
from the table.Like out of the 3million records I want to keep this months
records and archive the
remaining.There are few set of tables which needs to be archived and they
are all related.

I can think of creating a new table and populating the table with records
that needs to be archived and
after this those records can be deleted.Ex

create table T1 as select * from <tablename> where id < xxxx;

What is the best way of doing this.

Thanks
Ravindra

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com 
-- 
Author: Ravindra Basavaraja
  INET: [EMAIL PROTECTED] 

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Ron Rogers
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to