View previous topic :: View next topic
|
Author |
Message |
RedDevil711
New User
Joined: 04 Jun 2010 Posts: 25 Location: Pune
|
|
|
|
Hi All,
I just moved to a new work team and received a business request to clean up a large business table. The table, currently has 600 million rows and upwards. If i were to cleanup this table, would it be effective using a COBOL-DB2 program where i make use of the YEAR and QUARTER functions of DB2 ? Basically i am looking at efficient ways of cleaning up a large DB2 table using COBOL. This table was used for archiving transactions done by business. Any pointers on the same would be helpful, thanks. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
You coukld unload the table and use your sort program to delete the unwanted rows - assuming cleanup=delete. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
Code: |
IF It is a conditional clean up then
take a back up and then delete by DB2 utility-additionally if you have any
partions on date then and need to delete any specific range data then
use a partion number while you do a delete
ELSE
Also look for TRUNCATE.
END-IF |
It is not efficient to do one by one in COBOL-DB@ program (if thats what you were asking) |
|
Back to top |
|
|
RedDevil711
New User
Joined: 04 Jun 2010 Posts: 25 Location: Pune
|
|
|
|
Thanks for the replies Nic and Rohit.
I do have a date specific range for clean up, I will look at the option Rohit suggested based on partitions allocated based on date. |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hello There,
You can also use REORG DISCARD option to delete the MASS data for any specific criteria. |
|
Back to top |
|
|
|