Progress
Database Administration
Guide and Reference


Dumping Tables From a Damaged Database

Occasionally, data is damaged and the index rebuild utility does not work. When this happens, you can use the following Progress 4GL procedure to dump the data in a table called item. The p-dump.p procedure runs slowly on large databases. Use it only when you cannot use the Index Rebuild utility:

p-dump.p
DEFINE VARIABLE i AS INTEGER. 
FIND _file "item". 
OUTPUT TO item.d. 
DO i = 1 TO 10000: 
  FIND item WHERE RECID(item) = i NO-ERROR. 
  IF AVAILABLE item AND i <> INTEGER(_file._template) 
  THEN EXPORT item. 
END. 

In this procedure, data from the item table is dumped into the item.d file. Use the item.d file with the reload procedure. For more information on loading, see Dumping and Loading."

In the p-dump.p procedure, you must set the end value for the DO block high enough (10,000 in the previous example procedure) so that every record in the database is examined. Calculate a safe value using the following formula:

100 + 32 (database-size-in-bytes / database-block-size) 

The database block size varies among systems. Use the PROSTRCT STATISTICS utility to determine the database block size for your system.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095