[Chicago-talk] Help on Purging Database

tiger peng tigerpeng2001 at yahoo.com
Tue Jan 24 13:43:43 PST 2006


--- Steve Peters <steve at fisharerojo.org> wrote:

> On Tue, Jan 24, 2006 at 12:39:08PM -0800, tiger peng
> wrote:
> > Hello All,
> > 
> > There is a need to create a general tool for
> purging
> > old records from transaction databases (Oracle).
> The
> > referential integrity is required but foreign keys
> or
> > triggers are no allowed (for performance reason).
> > 
> > I did googling and cpanning without good solution.
> Is
> > there anyone did similar tasks or knows where are
> the
> > similar utilities?
> > 
> 
> Without knowing any requirements or anything else
> about your system, 
> your likely best bet will be something custom in
> PL/SQL.  I would highly 
> doubt if a generic tool is available that does not
> at least rely on 
> foreign keys.
> 
> Steve Peters
> steve at fisharerojo.org
> _______________________________________________
> Chicago-talk mailing list
> Chicago-talk at pm.org
> http://mail.pm.org/mailman/listinfo/chicago-talk
> 

I am try to put the following data sturcture in a
config file and load to scripts by require.
But there are some headach problems:

1. User should understand perl data structure, or a
tool for creating the config files is needed;
2. Implementation of 'CASECADE', recusive, looks not
easy as the information passed seems vary among the
recusive calls;

$purge_list = [
  parent_table=> {
    timestamp_column => {
       day =>100,    # keep the records younger than
100 days
       #row => 1000, # or the youngest 1000 records
    }
    children => { 
      child1 => {
        rf => {
          parent_fk_col1 => 'child_pk_col1',
          parent_fk_col2 => 'child_pk_col2',
        },
        grand_children => {},
      },
  },
]



More information about the Chicago-talk mailing list