Results 1 to 6 of 6

Thread: DB2 Purge

  1. #1
    Join Date
    Jan 2004
    Posts
    1

    Unanswered: DB2 Purge

    Can someone tell me if there is any better way than a DB2 Delete to do this ? I need to regularly purge data from 2 of my DB2 tables which are 90 days old. On an average 50,000 rows get inserted in the tables Daily. Frequent Inserts and Deletes would require frequent Reorgs.

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Need more information:

    1. What is DB2 version and platform? (as requested in MUST READ BEFORE POSTING thread).

    2. What is the percent of rows deleted and how often you run the purge?

    3. Are rows inserted at end of table or throughout the table? (depends on clustering index defintion or use of APPEND clause on table).

    4. Same with indexes (are indexes inserted at end of index keys or in middle of keys?).

    5. What is your percent free on table and indexes?
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  3. #3
    Join Date
    Jan 2004
    Location
    Tallahassee, FL, USA
    Posts
    96
    you need truncate data in tables ?


    if it is


    create dummy file as tst.txt


    db2 load from tst.txt of del replace into create.tablename


    this will delete data in table ( as truncate in Oracle)


    set up cronjob when ever you want it



    Let me know , if any questions


    Lekharaju Ennam

  4. #4
    Join Date
    Nov 2003
    Location
    kualaumpur
    Posts
    33
    u can do the same also using

    load from nul of del replace into table_name


    cheers



    Originally posted by famudba
    you need truncate data in tables ?


    if it is


    create dummy file as tst.txt


    db2 load from tst.txt of del replace into create.tablename


    this will delete data in table ( as truncate in Oracle)


    set up cronjob when ever you want it



    Let me know , if any questions


    Lekharaju Ennam

  5. #5
    Join Date
    Jan 2004
    Location
    Tallahassee, FL, USA
    Posts
    96
    if you create dumy file as null , that work.

    load from null of del replace into tablename

    will work, but not just null ( word)

    Lekharaju Ennam

  6. #6
    Join Date
    Nov 2003
    Location
    kualaumpur
    Posts
    33

    Talking

    I think u didnt follow me 'famudba'

    i said

    load from nul of del replace into tablename

    not ( ....null ) no double L

    try it out and let me know

    cheers....

    Trinmoy


    Originally posted by famudba
    if you create dumy file as null , that work.

    load from null of del replace into tablename

    will work, but not just null ( word)

    Lekharaju Ennam

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •