Hi... (I'm mainly and Oracle guy) working w/DB2 7.2.9 32-bit w/FP11 on Solaris 8 on a v440 w/2 CPU's and a 3310 array. Using VxVM 4.0 to manage the striping (8k stripe). Using 6 spindles on that table.
We have a table w/~16mil rows, they are ~15 days of data, ~1 mil a day. (the table will be growing (maybe doubling in the very near future.)
Just FYI I did a DEL unload and it was 1.6GB.
This table needs to store only 15 days and I need to delete the 15 day every day, as new data is constantly streaming in 24 hours a day. We only need to house 15 days.
The developers created a delete script (KSH) that selects and creates files in /tmp for hourly lists and they do a SED and grab line by line from the list and delete from the dB. This is heavy on the CPU and extra I/O on /tmp FS. During this time (several hours at times) there are locks occuring in the dB and the delete script and program streaming in data, are fighting for the table.
I know there has to be a better way using the functions within DB2.
I've looked at trying to create a C/C++ program that could use a Cursor, but have only seen it used for updates and inserts and not Deletes. There is an index on the date when the record comes in and an ID# of the "customer".
Each row is only ~100bytes.
My goals:
1) delete the 15th day everyday in the shortest period of time.
2) get rid of the deadlocks, as they cause the program doing the 24-hr streaming to timeout, and can get behind in its' work.
3) get this done ASAP.
Any help would be greatly appreciated.
Thanx
DrD123
We have a table w/~16mil rows, they are ~15 days of data, ~1 mil a day. (the table will be growing (maybe doubling in the very near future.)
Just FYI I did a DEL unload and it was 1.6GB.
This table needs to store only 15 days and I need to delete the 15 day every day, as new data is constantly streaming in 24 hours a day. We only need to house 15 days.
The developers created a delete script (KSH) that selects and creates files in /tmp for hourly lists and they do a SED and grab line by line from the list and delete from the dB. This is heavy on the CPU and extra I/O on /tmp FS. During this time (several hours at times) there are locks occuring in the dB and the delete script and program streaming in data, are fighting for the table.
I know there has to be a better way using the functions within DB2.
I've looked at trying to create a C/C++ program that could use a Cursor, but have only seen it used for updates and inserts and not Deletes. There is an index on the date when the record comes in and an ID# of the "customer".
Each row is only ~100bytes.
My goals:
1) delete the 15th day everyday in the shortest period of time.
2) get rid of the deadlocks, as they cause the program doing the 24-hr streaming to timeout, and can get behind in its' work.
3) get this done ASAP.
Any help would be greatly appreciated.
Thanx
DrD123