If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > DB2 Purge

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-31-04, 12:28
sapzen sapzen is offline
Registered User
 
Join Date: Jan 2004
Posts: 1
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.
Reply With Quote
  #2 (permalink)  
Old 01-31-04, 14:05
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
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
Reply With Quote
  #3 (permalink)  
Old 02-03-04, 12:24
famudba famudba is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 02-04-04, 01:07
trinmoy trinmoy is offline
Registered User
 
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



Quote:
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
Reply With Quote
  #5 (permalink)  
Old 02-11-04, 07:52
famudba famudba is offline
Registered User
 
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
Reply With Quote
  #6 (permalink)  
Old 02-11-04, 22:08
trinmoy trinmoy is offline
Registered User
 
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


Quote:
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On