Feedback
Did this article resolve your question/issue?

   

Article

How to Run dbscan With Database Repair Utility (dbrpr)?

« Go Back

Information

 
TitleHow to Run dbscan With Database Repair Utility (dbrpr)?
URL Name2077
Article Number000136067
EnvironmentProduct: Progress
Version: 8.x, 9.x
Product: OpenEdge
Version: 10.x, 11.x, 12.x
OS: All supported platforms
Other: DBRPR
Question/Problem Description
How to scan a database to detect bad records and blocks?
How to run the Database repair utility ( dbrpr )?
How to use dbrpr to scan a database?
How to use dbrpr to dump a database block?
How to run DBRPR?
How to verify if a bad block on the server disk affected the database?
Steps to Reproduce
Clarifying Information
Error Message
Defect/Enhancement Number
Cause
Resolution
Since Progress 9.1D06, the preferred documented and supported method of scanning a database:

1. For bad records and data blocks use DBTOOL with Options 3. Record Validation and 5. Read database block(s). There are several advantages to using this utility to scan all data blocks, or any of it's other features:
  • DBTOOL can be run online and as such use threads to improve performance
  • DBTOOL does not require after-imaging to be disabled
  • DBTOOL does not require the BI file to be manually truncated before-hand
For further information refer to Article: 000020119, What is DBTOOL?   
     
2.  For bad index blocks and index entries, use IDXCHECK or IDXFIX

 What tools / utilities can I run to check the integrity of a database or check for corruption?  

Using DBRPR

The database repair utility (DBRPR) can be used to scan a database for bad records and blocks when database corruption are reported.

WARNING:
The dbrpr utility is an undocumented tool because of the damage that can be caused by using the tool incorrectly.
This utility is provided to assist Progress Technical Support staff in assisting customers when diagnosing or dealing with corruption issues.
Use dbrpr only to scan a database. Before attempting any repair action on a database, it is important that Progress Technical Support is contacted.
Every precaution should be taken before using this tool. Restoring from a valid backup is always the recommended solution.

The database repair utility is a function of PROUTIL and the _proutil executable.
It is executed like any other PROUTIL function, there are however a number of prerequisites to 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.
  • Disable after-imaging, if enabled, otherwise it will fail with: ERROR - Turn off ai or use -F Option.
  • Truncate the before-image (BI) file.
Do not skip this last step. The BI file must be truncated.

Only if there is BI corruption will an error be received during the truncation. Events leading up to this need to scan may also signal that there is bi corruption.  At that point a decision can be made whether reverting to backup would be advisable or continue to skip recovery and use the force access (-F) option to start DBRPR. The -F option bypasses the transaction recovery,  marks the database as damaged and can compromise database integrity by introducing logical corruption and possible structural corruption.  If this is necessary, review the content of the following Article:
To run the database repair utility:

A. Run DBSCAN

DBSCAN
 was introduced in Progress 8.x and runs only the reporting scan options of proutil -C dbrpr > 1,1,4,A,G detailed below in one command line :
 
$   proutil dbname -C dbscan -OUTPUT dbscan.out
or
$   proutil <dbname> -C dbrpr > dbscan.out

B. Run DBRPR 
          
$   proutil dbname -C dbrpr [-F]

The Progress OpenEdge version is presented, followed by the Main DATABASE REPAIR MENU. The only Menu Options of interest to this Article are 1, 4, and Q.

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

         1. Database Scan Menu
         2.
         3.
         4. Dump Block
         ...

         Q. Quit

         Choice: _



Option 1, Database Scan Menu:

The Database Scan Menu presents options to test the format of database blocks and records:
  • The menu allows the selection of multiple options, 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 activated.
  • To deselect an Option, simply enter the Option Number again.

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

         1. Report Bad Blocks
         2.
         3.
         4. Report Bad Records
         ...
         10. Change Current Working Area
         A. Apply scan to all areas <---- v9.1D and later

         G. GO

         Choice: _


NOTE: In Progress 9.1A, 9.1B and 9.1C Option 9 was "Apply scan to all areas"

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, for complete database scan at both the block and record level is carried out.

In Progress 9 and above, "Apply scan to all areas" should be selected, ensuring the scan is run across the whole database,
rather than only on the current Storage Area (by default the Schema Area), unless of course all of the schema is still only in the Schema Area or a specific Storage Area has been isolated for scanning in which case use Option 10 to change the storage area to scan. Only one area can be selected.

Having selected the Options above, enter G (go) to execute the selected items.

The following question is asked:

         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.

Example Output:

Scanning test.d1
From dbkey 32 to dbkey 3648

Scan of Schema Area extent 1   10% complete
Can't find Blk 128 (4096)
Scan of Schema Area extent 1   20% complete
Bad File Number:-6 Len:255 dbkey:995
Scan of Schema Area extent 1   30% complete
...
Scan of Schema Area extent 1  100% complete
Extent test.d2 is above high water mark, skipping...

Total Records:  1870
Continues:      2
# Dumped:       0


The report shows that:
  • The block scan cannot find block 128.
  • The record scan detected a bad file number in a record. This is a case where the actual record with RECID 995 is damaged.
  • The scan only checks blocks (records) under the high water mark for the area, which is why "Extent <> is above high water mark, skipping" is recorded showing the reason for it's exclusion.
To capture the DBRPR output for analysis, or more importantly to provide it to Technical Support for further analysis, a text file needs to be created which contains the input that must be fed to dbrpr to instruct the Options required. The DBRPR menu has changed across versions, it is therefore advisable to run DBRPR against a test database of the same version in order to assure the correct input choices are used.

For example, since Progress 9.1D, to run a full scan on all Storage Areas, create the following input file without the comment markers (a dbrpr.in example is attached to the Article):

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


Where:
  • All lines must be terminated with a carriage return.
  • The text after and including the hash signs (#) are comments and must not be included in the text file.
  • There is a Carriage Return after the last line "Q"
Then run DBRPR providing the text file (dbrpr.in) as input and redirecting STDOUT to a file (dbrpr.out):
$   proutil <dbname> -C dbrpr < dbrpr.in 2>&1 > dbrpr.out

At this point, contact Progress Technical Support for next steps in addressing the problem.

DBRPR Option 4, Dump Block:

If there are Block Corruption detected, Technical Support may request a block dump for analysis by Technical Support.

To dump a database block using DBRPR:

Progress 8:
  1. From the main menu: DATABASE REPAIR MENU, Select Option 4, Dump Block.
  2. The following prompt will appear: Enter dbkey:
  3. Enter the dbkey.
  4. The block is dumped to a file called <dbkey>.dmp.
  5. Select Quit from the main menu to exit the database repair menu.
Progress 9 and later:
  1. From the main menu: DATABASE REPAIR MENU
  2. First Select: Change Current Working Area
  3. From the "SELECT CURRENT WORKING AREA" menu, enter the correlating number next to the Storage Area the required block needs to be dumped from.
  4. Select Option 4, Dump Block and follow the instructions above to enter the dbkey

Example against the sports2000 database: Choice: 9 will select the Cust_Data Area

                SELECT CURRENT WORKING AREA:
                 1. Control Area
                 3. Primary Recovery Area
                 6. Schema Area
                 7. Employee
                 8. Inventory
                 9. Cust_Data
                10. Cust_Index
                11. Order
                12. Misc
                Choice: 9


After entering the correct Storage Area, the Main Menu will again present. Confirm at the bottom that the required Storage Area is now the Current Storage Area:

Example:

                (Current Working Area: Cust_Data)
                Choice:
  • 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.

Conclusion:

After all requested scans and dumps are complete, call Progress Technical Support to help with further database repair utilities and next steps. The next steps are dependent on the error messages presented.
Workaround
Notes
The following is an example of an input file for dbrpr for 9.1C:
 
1    # Select the Database Scan Menu
1    # Activate the 'Report Bad Blocks' option
4    # Activate the 'Report Bad Records' option
9    # 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
 
Last Modified Date11/20/2020 7:30 AM
Attachment 
Files 1. dbrpr.in
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.