gajoseph / purge

Purge data from db based on datafield(createdDate/ lastupdatedate)
GNU General Public License v3.0
1 stars 0 forks source link

Copy/ create the child/ parent tables into a destination DB. #2

Open gajoseph opened 6 years ago

gajoseph commented 6 years ago

source db: has table/s destination Db : is where data is getting archived Dest Db: should be setup using DB utils :+1:

dest db schema. See properties: SRC.DB.URL DES.DB.URL Use threads and batch update:

  1. loop thru rows that need to be deleted
  2. add batchSize see variable DES.DB.BATCH.SIZE=2000
  3. create a thread(set thread count paramter) and execute;note if there is a self join need sp :thinking:
  4. t1 = new ithread(ibatch + "", strInsSql, url);
  5. Same thread should delete data. :thought_balloon:

Should set only threads per table otherwise FK might throw errors.

Store thread info as well. this might be helpful for debugging