IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Multiple delete from a Table


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vasudevan_c

New User


Joined: 15 Apr 2008
Posts: 7
Location: bangalore

PostPosted: Tue Dec 01, 2009 11:41 am
Reply with quote

Hi All,
Can anyone tell me how does multiple rows can be performed in an application program. PFB the requirement

Its a table, which will receive daily insert and delete files. The primary key is field called Trace id. I will get this Trace id in my input file to delete the record from the table. The delete volume that i may get is around 10 million. But problem is another similar table, for deleting 600K rec took 38 mins, so going by this for deleting 1000K rec it wl take hours to complete. As this table is expose to online as well...i can not go ahead with single row delete. So please suggest me any approach so that i can delete multiple row together, with better performance.

Thanks,
Vasu
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Tue Dec 01, 2009 12:19 pm
Reply with quote

Define PFB. DB2 tables have rows, not records. For that many deletes, I'd unload the table, delete the appropriate records from the unloaded file, then reload the table.
Back to top
View user's profile Send private message
vasudevan_c

New User


Joined: 15 Apr 2008
Posts: 7
Location: bangalore

PostPosted: Tue Dec 01, 2009 12:29 pm
Reply with quote

Thanks a lot Terry.

But tell me one thing, is it advisable to use load utility daily for an table?



Thanks,
Vasu
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Tue Dec 01, 2009 5:36 pm
Reply with quote

Vasudevan,

Quote:
But tell me one thing, is it advisable to use load utility daily for an table?


We do it, in our everyday batch cycle, for a lot of tables. So, what's the problem in that.


Sushanth
Back to top
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Tue Dec 01, 2009 7:17 pm
Reply with quote

Use DISCARD REORG with the proper conditions. It much faster than normal delete. But you need to provide where clause for delete which in your case keeps on changing as per the input file.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts DELETE SPUFI DB2 1
No new posts Load new table with Old unload - DB2 DB2 6
No new posts DSNTIAUL driven delete IBM Tools 0
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top