Question Way to delete records of table from database? (DBA related query using and utility)

Mike

Moderator
Hi Tom Team,

We had a situation where we had an urgent need purge (delete records of 1 year old ) from a database table. Progress version 11 and linux platform.We called the programmer to write the code and delete the records of 1 year of table. We took backup of table .df and .d of table and programmer run the codes to delete the table records.

I have few questions below: -

Q;-1 Can Database DBA can delete records from table ? Do we have any utility to delete or purge table?
Q:-2 If we take .df and .d of a table and after deleting records via using progress editor with the help of programmer, Can we delete records of .d and load in database?

Thanks and Regards
Mike
 
Sure, anyone with permission can delete records.

If you want to delete an entire table there is always "drop table". Performance will pretty much suck if the table is of non-trivial size.

If you know that a certain table will need to be frequently purged completely (maybe it is a "scratch" table of some sort...) you can plan ahead and make life simpler by putting that table in a dedicated type 2 storage area (and doing the same with the indexes). Then you can use "truncate area" to immediately delete everything.

But if you only want to delete _some_ of the data you will need to use some code.

And, sure, you could edit a .d and remove some data and then reload whatever remains. But that seems awfully convoluted. If you have a way to identify what you want to remove from a .d then it seems like you could much more easily write a program to delete the records directly.
 
When someone says they have an urgent need to purge data from a table, experience has shown that they may be assuming such a purge will help them with a problem of low available disk space, as if deleting records will shrink the database files that contain those records. This is an incorrect assumption.

If this was the motivation for the "urgent need", stop and re-evaluate the situation. Talk about the problem, not the proposed solution.
 
Two other common reasons for an urgent need to purge data:

1) Someone thinks that it will solve a performance problem. If that turns out to be true then the real problem is the quality of the WHERE clause or the lack of proper indexes to support that WHERE clause

2) You're hiding something from a regulator. Bad idea. You're going to get caught. And your boss will throw *you* under the bus.
 
Someone thinks that it will solve a performance problem. If that turns out to be true then the real problem is the quality of the WHERE clause or the lack of proper indexes to support that WHERE clause
Good point, I've heard that one many times too.
 
Back
Top