Kbase P8966: How to find the index number ?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  3/22/2007 |
|
Status: Verified
GOAL:
How to find the index number
GOAL:
How to find the Root Block of an index
GOAL:
How to find the Area Number of an index
FIX:
Both the index number and Storage Area Name and number can be found in the Index analysis report which can be run online or offline.
$ proutil <dbname> -C idxanalys >> idx.out
Alternatively the _storageobject VST can be used.
Example:
DEF VAR cTableName AS CHAR FORMAT 'X(30)' LABEL 'Table Name'.
UPDATE cTableName WITH SIDE-LABELS.
FIND _file WHERE _file-name = cTableName NO-LOCK NO-ERROR.
IF NOT AVAILABLE(_file) THEN MESSAGE "Table does not exist" VIEW-AS ALERT-BOX.
ELSE DO:
FIND _storageobject WHERE _storageobject._object-type = 1 AND _storageobject._object-number = _file._file-num NO-LOCK NO-ERROR.
FIND _Area WHERE _Area._Area-number = _storageobject._Area-number NO-LOCK NO-ERROR.
DISPLAY _Area-name _Storageobject._Area-number.
FOR EACH _index OF _file:
FIND _storageobject WHERE _storageobject._object-type = 2 AND _storageobject._object-number = _index._idx-num NO-LOCK NO-ERROR.
FIND _Area WHERE _Area._Area-number = _storageobject._Area-number NO-LOCK NO-ERROR.
DISPLAY _index-name FORMAT 'x(15)'
_Area-name FORMAT 'x(15)'
_Storageobject._Area-number FORMAT "->>9"
_Storageobject._Object-root LABEL "Root Block" FORMAT "->>>>9"
_Storageobject._Object-number LABEL "Index Number" FORMAT "->>9".
END.
END.