Salesforce

How to script DBTOOL for specific records?

« Go Back

Information

 
TitleHow to script DBTOOL for specific records?
URL Namehow-to-script-dbtool-for-specific-record-rowids
Article Number000168287
EnvironmentProduct: OpenEdge
Version: 10.2B, 11.x, 12.x
OS: All supported platforms
Other: DBTOOL
Question/Problem Description
How to script DBTOOL 4. Record Version Validation to report  record version information before AND after the record Version upgrade check.
How to script DBTOOL 3. Record Validation with ROWID & verbose 3 to dump the details of the record reported as corrupt
How to script DBTOOL 5. Read or Validate Database Blocks for a known list of record DBKEYS
How to script DBTOOL 6. Record Fixup for a specific RECID range
Steps to Reproduce
Clarifying Information
Error Message
Defect Number
Enhancement Number
Cause
Resolution
DBTOOL does not allow for a record rowid range, single records are verified at a time by entering the rowid (recid or dbkey) and associated storage area:
           
<connect>:    (0=single-user 1=self-service >1=#threads)? 0
<rowid>:      (rowid or all)? 65756
<area>:       (Area number or all)? 8
<display>:    (verbose level 0-3)? 3 
<validation>: (level 0-2)? 2

The following example uses DBTOOL OPTION 4, to report record version information before and after the record Version upgrade check online. The input provided will work for Options 3, 4 & 6. Option 5 requires an additional line "<validation>: (level 0-2)?"

1. Create a text file with a list of the records for DBTOOL to verify: recids.out
 
65756
65757
65758
<CR this is just to highlight there is an empty line at the end of the file >

2. Create a script to parse each value in turn.
Example DBTOOL batch file:
@echo off
set AREANUM=9
set DBNAME=sports
SETLOCAL EnableDelayedExpansion
for /F "tokens=1" %%i in (recids.out) do (
REM set %%i
echo 4 > .\resp.in
echo 4 >> .\resp.in
echo %%i >> .\resp.in
echo %AREANUM% >> .\resp.in
echo 3 >> .\resp.in
REM echo 0 >> .\resp.in
CALL dbtool %DBNAME% < .\resp.in >> .\resp.out 2>&1
)
@echo on
Example DBTOOL shell script:
#!/bin/sh
AREANUM=9
DBNAME=sports
for i in `cat recids.out`
do
echo 4 > /tmp/resp.in
echo 4 > /tmp/resp.in
echo $i >> /tmp/resp.in
echo $AREANUM >> /tmp/resp.in
echo 3 >> /tmp/resp.in
# echo 0 >> /tmp/resp.in
dbtool $DBNAME < /tmp/resp.in >> /tmp/resp.out 2>&1
done












First proof the script against a test database in the same environment before running against production databases.
Workaround
Notes
Keyword Phrase
Last Modified Date5/14/2020 10:33 AM

Powered by