Consultor Eletrônico



Kbase P6320: How to delete table content fastest way by using truncate area?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   28/04/2011
Status: Verified

GOAL:

How to delete table content fastest way by using truncate area?

GOAL:

How to delete table content fastest way?

GOAL:

What does the truncate area utility do?

FACT(s) (Environment):

Progress 9.1B
Progress 9.1C
Progress 9.1D
Progress 9.1E
OpenEdge 10.x
All Supported Operating Systems

FIX:

Use "proutil dbname -C truncate area [area-name]", which has been first announced in Progress 9.1B release. There are 2 ways how to truncate the areas of your database.:

1) "proutil -C truncate area" does following:

Truncate the bi file
This will truncate each area in the database that contain no storage objects (indexes or tables) by simply clearing the space allocation chains and re-setting the high water mark
It is useful if you have performed a table move or deleted all the storage objects of a particular area and you want to recapture space in the area or you want to delete the extents and/or the area with a subsequent call to prostrct remove
It is not useful as a quick delete of all the storage objects in an area however2) "proutil -C truncate area [area-name]" does following:

Truncate the bi file
Deactivate any indexes on tables that are in this area to truncate but are not themselves in the area being truncated.
Reset the high water mark
Zero the space allocation chains (rm chain, index delete chain and free chain)
Restore template records to the truncated area (The template records maintain the default values for record creation)
Re-create root blocks for indexes in the truncated area.
Only executes if ai not enabled
This is useful as a quick delete of all the storage object in an area
No data integrity checks are performed (no table validation executed) nor triggers fired so you can cause orphaned records depending on your particular db relational model
If you try to restore the high water mark hoping to recover data from the truncated area it will not be possible as the data corruption is inevitable. You cannot truncate the Schema Area (Area 6), but utility "Schema mover" has been introduce in Progress 9.1D, for more information, see Solution P4794