Option 1: Find the table from index number found in the content of an idxblockreport.
1. Run PROMON -> buffer lock queue option to find the dbkey
2. Run proutil idxblockreport for each index in the database
3. Search for the dbkey found in step 1 and table name will be included in the output file name.
For example: if dbkey is found in Customer.SalesRep.out, table name is Customer.
The following ABL code will help to generate a shell script that includes proutil “idxblockreport ” option command for every index in the database, which in turn will generate different output files.
output to ./scanidxblk.p.
for each _file no-lock:
if _file-name begins "_" then next.
for each _index of _file no-lock:
put unformatted
"proutil sports2000 -C idxblockreport " +
trim(_file-name) + "." +
trim(_index-name) + " > " +
trim(_file-name) + "." +
trim(_index-name) + ".out" skip.
end.
end.
output close.
Option 2: Find the table from index number found in the content of an index block details with DBRPR.
1. Run PROMON -> buffer lock queue option to find the dbkey
2. Run DBRPR to output the Index Block Content of the DBKEY
$ proutil <dbname> -C dbrpr
- Select Option 13 - Display Block Contents
- Select Option 8 - Change Current Area (to the index area to be checked of index block contents found in Promon -> Buffer Lock Queue)
- Select Option 2 - Dump Index Block Details
- Select option G - Go
- If asked for extent to display, select extent.
In the result information, search for dbkey, once is located, find below the header IDXBLK:
ih_ixnum: <999>.
- Where <999> is the index number of this block.
Run the following code to find in VST tables the table name associated with the index number.
For example, the index number of the dbkey could be 15, which is the index called 'Name' of the table called "Customer" for the Sports2000 database.
DEFINE VARIABLE idx AS INTEGER NO-UNDO.
UPDATE idx.
FOR EACH _index NO-LOCK WHERE _idx-num = idx.
FIND _file OF _index.
DISP _file-name _file-num SKIP
_index-name _idx-num.
END.
Option 3: Find the table from index number found by dumping the index block with DBRPR.
1. Run PROMON -> buffer lock queue option to find the dbkey
2. Run DBRPR to dump the DBKEY
$ proutil <dbname> -C dbrpr
- Select Option 9 - Change Current Working Area (to the index area to be checked of index block contents found in Promon -> Buffer Lock Queue)
- Select Option 4 - Dump Block
- Enter dbkey index block obtained from the Promon.
- A file <dbkey>.dmp is generated.
Open this <dbkey>.dmp file in a text editor and find the index number.
For example if dbkey is 704 then the file name will be 704.dmp.
proenv>cat 704.dmp | more
# BLOCK REPAIR UTILITIES
# DATABASE = sports2000.db
# AREA = Cust_Index
# DBKEY = 704
# BLOCK NUM = 11
>0000 0000 02C0 027F 0001 0000 0000 0000 0058
>0010 0001 000F 0000 0000 0110 1758 0021 0100
etc
After the Header information check second row, second block is the index number:
'000F' in hexadecimal converted to decimal == 15 == the index number (an index block only every holds the key values of one index)
Once the index number is known, run the code provided in Option 2 above to find the associated table name (_file-name) associated with the index number (_idx-num).