Archive

Archive for September, 2007

How to Run dbscan With Database Repair Utility (dbrpr)

September 12th, 2007 No comments

You may need to scan your database for bad records and bad blocks if you receive an error message which points  to data corruption (such as 1124 and 16).


The database repair utility is a function of PROUTIL and the _proutil executable. It is executed like any other  PROUTIL function, however there are a number of prerequisites to using the utility. Make sure you have done the following before using the utility:

– Always have a current backup of the database.
– The server must be down and the database not in use.
– If possible, bring the database into sync by having a normal shutdown where there are no incomplete  transactions to be backed out.
– Truncate the before-image (BI) file.
Do not skip this last step. You must attempt to truncate the BI file. Only if there is BI corruption will you  receive an error during the truncation, and then you can decide whether or not to skip recovery and use the  force access (-F) option to start dbrpr. The -F option bypasses the transaction recovery and that can compromise database integrity.

Use the following command to execute the database repair utility:

    proutil <dbname> -C dbrpr

On VMS, use the command:

    PROGRESS/UTIL=DBRPR <database name>

After the command, the version of your Progress software is displayed, followed by the main menu:

               DATABASE REPAIR MENU
              --------------------

         1. Database Scan Menu
         2.
         3.
         4. Dump Block
         5.
         6.
         7.
         8.

         Q. Quit

         Choice: _

The only options of interest to this discussion are 1, 4, and Q.


Option 1, Database Scan Menu:

This option allows you to test the format of database blocks and records. Once you have selected option 1 the following menu appears:

               DATABASE SCAN MENU
              ------------------

         1. Report Bad Blocks
         2.
         3.
         4. Report Bad Records
         5.
         6.
         7.
         8.
         9.
         A. Apply scan to all areas <---- v9 only

         G. GO


         Choice: _

The menu allows you to select as many options as you want, then runs all the options together.
In order to select an option, enter the option number and the press the ENTER key; the menu then reappears with the word “ON” to the left of the option you activated. To deselect an option, just enter the option number again.

Of the choices displayed in the ‘Database Scan Menu’, only 1 and 4 are of interest to database scans.
Option 1 checks for bad blocks by making sure that some data in the block header is consistent.
Option 4 carries out a more in-depth check by verifying the format of each record.
When database corruption is suspected, it is best to activate both of these options, so that a complete  database scan is carried out.

In version 9, option A is available too, and you should select it to make sure that your scan is run across the  whole database, rather than only on the current storage area (by default the Schema Area).

When all the options you want to run are marked, enter G (go) to execute the selected items.
You will be asked the following question:

          Scan Backward (Yes/No)? _

Answer “n” for best performance. By scanning forward, Progress can take advantage of some OS and hardware optimization for sequential reads.

Following is a sample output from dbrpr against a copy of the version 8 sports database.

Scanning E:\test\test.db
From dbkey 32 to dbkey 3648

Can't find Blk 128 (4096)


Total Records:  1870
Continues:      2
# Dumped:       0

The report shows that the scan cannot find a block 128. At this point, you should contact Progress Technical Support for information on how to approach the problem.

Following is another sample:

Scanning E:\test\test.db
From dbkey 32 to dbkey 3648

Bad File Number:-6 Len:255 dbkey:995


Total Records:  1870
Continues:      2
# Dumped:       0

The record scan detected a bad file number in a record. This is a case where the actual record with RECID 995 is damaged.

You may want to capture the output from dbrpr for your own analysis, or in order to forward it to Tech Support. In this case you should proceed as follows.

– Generate a text file which contains the input that must be fed to dbrpr in order to carry out the scan you  need.
For example, in version 9, to run a full scan on all storage areas, generate a file like:
1 # Select the Database Scan Menu
1 # Activate the ‘Report Bad Blocks’ option
4 # Activate the ‘Report Bad Records’ option
A # Activate the ‘Apply scan to all areas’ option
G # Select GO and start the scan
N # Answer No to ‘Scan Backward (Yes/No)?’
Q # Select Quit once dbrpr returns to the main menu

All lines must be terminated with a carriage return. Beware that the text after and including the hash signs  (#) are comments and should not be included in the text file.
– Once the file is finalized, run:

    proutil <dbname> -C dbrpr < [your file] 2>&1 > dbrpr.log

All the output from dbrpr will go to dbrpr.log.


Option 4, Dump Block.

While you are at the main menu, there might be another piece of data that a Progress Technical Support Engineer  needs to help you; hex dumps. You might be asked to dump a block for analysis by technical support.

Follow these steps to dump a database block using dbrpr:

– From the main menu select Option 4, Dump Block. The following prompt will appear:

          Enter dbkey:

– Enter the dbkey. The block is dumped to a file called <dbkey>.dmp.
– Select Quit from the main menu to exit the database repair menu.


Categories: Progress Tags: ,