Checking and Fixing Data Sets [ DBChange Plus User's Guide ] MPE/iX 5.0 Documentation
DBChange Plus User's Guide
Checking and Fixing Data Sets
This section explains how to check data sets for internal pointer or
structural inconsistency and how to fix data sets that contain
inconsistencies. To check a data set for internal or pointer
inconsistency, use the CHECK SET command. To correct problems found
after using CHECK SET, use the FIX SET command. You can use CHECK SET
and FIX SET for either master data sets or detail data sets.
NOTE CHECK SET checks only the internal pointer consistency of the
set(s) specified. It does not check the pointer consistency across
sets. For example, the pointer from a chain head in a master data
set to the first record on the chain in the associated detail set
is not checked. To check across data sets, use the CHECK PATH
command.
Checking a Master Data Set
To check a master data set, use the CHECK SET command. In the following
example, the master data set CUSTOMER is checked.
>check set customer
Check Set issued for 1 set(s).
>
If you want to verify that the CHECK SET command is pending, use the
REVIEW SETS command. Refer to "REVIEW SETS" in chapter 10, "DBChange
Plus Commands."
After issuing a PERFORM COMMANDS to invoke DBAPLUS, the following output
is displayed:
Starting data set serial reads.
Tabulating statistics.
CHECK SET (MASTER)
Pct Pct Longest Average
Master Set Name Type Entries Capacity Full Sec Cluster Cluster
-----------------------------------------------------------------------
CUSTOMER M 9 221 4 11.1 0 0.0
CHECK INFORMATION
Set Name Type
Search Item
Message(s)
------------------------------------------------------------------------
CUSTOMER M
Userlabel entry count does not match bitmap entry count (CHK 560).
SALES D
ACCOUNT (Path 1; linked to master CUSTOMER, path 1)
Sum of chain counts in the related master set does not
match bitmap entry count for this set (CHK 580).
HP36386 (A.00.00) DBCHANGE (c) COPYRIGHT Hewlett-Packard Co. 1985
Analyzing the CHECK SET Statistics for a Master Data Set.
CHECK SET performs a serial read followed by a chained read on the master
data set specified. If you use the QUICK parameter, only a serial read
is performed. The output is in two sections: CHECK SET and CHECK
INFORMATION.
Under the CHECK SET section of the output, the following information is
reported for the above example:
* The data set name. CUSTOMER is the name of the master data set.
* The data set type. The following are valid data set types:
M is a manual master data set.
A is an automatic master data set.
* Entries is the number of entries in the data set.
* Capacity is the capacity of the data set.
* Pct Full is the percentage of the data set capacity that is not
available, rounded to the nearest whole percentage. This
statistic is useful for capacity planning. The recommended
percent full for a master data set is between 60 percent and 80
percent. If a master data set capacity is significantly less than
60 percent full, a serial read becomes slower. If a master data
set is significantly more than 80 percent full, DBPUT intrinsics
involving the master data set can slow down. If you are
experiencing performance problems, consider changing the capacity
of the data set. (Refer to "CHANGE SET" in chapter 10, "DBChange
Plus Commands.")
* Pct Sec is the percentage of secondary entries. In general, the
lower the percentage, the better. A high percentage indicates
that the hashing algorithm is creating many synonyms. To decrease
the percentage of secondaries, increase the data set capacity to a
larger number that is not a power of two. (Refer to "CHANGE SET"
in chapter 10, "DBChange Plus Commands.")
* Longest Cluster and Average Cluster are the longest and average
number of TurboIMAGE blocks that must be read to find an open slot
to place a synonym. If two records with the same hash value are
added to a master data set, one of them must be placed in another
available slot. Acceptable guidelines range from a cluster of 10
on a very heavily loaded transaction processing system to as much
as 200 on a very lightly loaded system. A collection of
historical statistics about the database can help you evaluate if
the longest and average clusters are within a reasonable range.
In addition, your database users can help identify clustering
problems by reporting slow response time when adding records to a
particular data set. Once you have determined if the range should
be changed, increase or decrease the data set capacity
accordingly. (Refer to "CHANGE SET" in chapter 10, "DBChange Plus
Commands.")
The CHECK INFORMATION section of the output identifies specific records
in the data set that contain problems. If no problems are found, the
following message is displayed:
No problems were detected by CHECK.
Fixing a Master Data Set
To correct problems identified by CHECK SET, use the FIX SET command.
When fixing a master data set, the following messages may occur:
* Dataset DataSetName record n is duplicate manual master (FIX 170).
Key value: n
To correct this problem, examine the key values in the data set
DataSetName and delete the key that has no entries. Be sure to
print the data before deleting.
* Please verify key for dataset DataSetName (FIX 170). Key value: n
To correct this problem, examine the key value and the record to
determine if the data is damaged.
In the following example, FIX SET is used to correct the problems found
in the previous CHECK SET example:
>fix set customer
Fix Set issued for 1 set(s).
>
If you want to verify that the FIX SET command is pending, use the REVIEW
SETS command. Refer to "REVIEW SETS" in chapter 10, "DBChange Plus
Commands."
After issuing a PERFORM COMMANDS to invoke DBAPLUS, the following output
is displayed:
Check file ORDERSRX exists; it will be overwritten (DBA 125).
Starting data set serial reads.
Tabulating statistics.
CHECK SET (MASTER)
Pct Pct Longest Average
Master Set Name Type Entries Capacity Full Sec Cluster Cluster
-----------------------------------------------------------------------
CUSTOMER M 9 221 4 11.1 0 0.0
CHECK INFORMATION
Set Name Type
Search Item
Message(s)
------------------------------------------------------------------------
CUSTOMER M
Userlabel entry count does not match bitmap entry count (CHK 560).
SALES D
ACCOUNT (Path 1; linked to master CUSTOMER, path 1)
Sum of chain counts in the related master set does not
match bitmap entry count for this set (CHK 580).
FIX INFORMATION
------------------------------------------------------------------------
All problems detected have been fixed.
HP36386 (A.00.00) DBCHANGE (c) COPYRIGHT Hewlett-Packard Co. 1985
>
The FIX SET output is similar to the CHECK SET output. The same CHECK
PATH and CHECK INFORMATION reporting occurs. In addition, FIX
INFORMATION reports the status of the FIX SET process. All problems
found in the previous example are corrected.
Checking a Detail Data Set
To check a detail data set, use the CHECK SET command. In the following
example, the detail data set SALES is checked:
>check set sales
Check Set issued for 1 set(s).
>
If you want to verify that the CHECK SET command is pending, use the
REVIEW SETS command. Refer to "REVIEW SETS" in chapter 10, "DBChange
Plus Commands."
After issuing a PERFORM COMMANDS to invoke DBAPLUS, the following output
is displayed:
Check file ORDERSRX exists; it will be overwritten (DBA 125).
Starting data set serial reads.
Tabulating statistics.
CHECK SET (DETAIL)
Pct Highest Delete
Detail Set Name Entries Capacity Full Entry Used Chain Count
-----------------------------------------------------------------------
SALES 17 504 3 17 0
CHECK INFORMATION
Set Name Type
Search Item
Message(s)
------------------------------------------------------------------------
SALES D
ACCOUNT (Path 1; linked to master CUSTOMER, path 1)
Path Chain inconsistencies detected (CHK 400).
HP36386 (A.00.00) DBCHANGE (c) COPYRIGHT Hewlett-Packard Co. 1985
>
Analyzing the CHECK SET Statistics for a Detail Data Set.
CHECK SET performs a serial read followed by a chained read on the detail
data set specified. If you use the QUICK parameter, only a serial read
is performed. The output is in two sections: CHECK SET and CHECK
INFORMATION.
Under the CHECK SET section of the output, the following information is
displayed for the previous example:
* The data set name. SALES is the name of the detail data set.
* Entries is the number of entries in the data set.
* Capacity is the capacity of the data set.
* Pct Full is the percentage of the data set capacity that is not
available, rounded to the nearest whole percentage. This
statistic is useful for capacity planning.
* Highest Entry Used is the record number of the highest entry ever
used (the high-water mark) in the data set. When reducing data
set capacity, do not reduce it below the highest entry used;
otherwise, you must repack the data set to recover the unused
space in the middle of the data set. (Refer to "REPACK" in
chapter 10, "DBChange Plus Commands.")
* Delete Chain Count is the number of records in the delete chain.
This number should be as close to 0 as possible. A high delete
chain count may mean a problem with a large quantity of deletes.
For example, if you have a program that performs a large number of
deletes, gaps may be left in your detail data set. Subsequent
record additions may disburse data randomly within the data set.
As a result, serial reads may be slow. To correct a high Delete
Chain Count, repack the data set. (Refer to "REPACK" in chapter
10, "DBChange Plus Commands.")
The CHECK INFORMATION section of the output identifies specific records
in the data set that contain problems. If no problems are found, the
following message is displayed:
No problems were detected by CHECK.
Fixing a Detail Data Set
Use the FIX SET command to correct problems identified by CHECK SET. In
the following example, FIX SET is used to correct the problems found in
the previous example:
>fix set customer
If you want to verify that the FIX SET command is pending, use the REVIEW
SETS command. Refer to "REVIEW SETS" in chapter 10, "DBChange Plus
Commands."
After issuing a PERFORM COMMANDS to invoke DBAPLUS, the following output
is displayed:
Check file ORDERSRX exists; it will be overwritten (DBA 125).
Starting data set serial reads.
.
Tabulating statistics.
CHECK SET (MASTER)
Pct Pct Longest Average
Master Set Name Type Entries Capacity Full Sec Cluster Cluster
-----------------------------------------------------------------------
CUSTOMER M 9 221 4 11.1 0 0.0
CHECK INFORMATION
Set Name Type
Search Item
Message(s)
------------------------------------------------------------------------
CUSTOMER M
Userlabel entry count does not match synonym chain count (CHK 570).
SALES D
ACCOUNT (Path 1; linked to master CUSTOMER, path 1)
Sum of chain counts in the related master set does not
match bitmap entry count for this set (CHK 580).
FIX INFORMATION
------------------------------------------------------------------------
All problems detected have been fixed.
PERFORM COMMANDS completed.
HP36386 (A.00.00) DBCHANGE (c) COPYRIGHT Hewlett-Packard Co. 1985
>
The FIX SET output is similar to the CHECK SET output. The same CHECK
PATH and CHECK INFORMATION reporting occurs. In addition, the FIX
INFORMATION section reports how the problem was corrected and the status
of the FIX SET process. All problems found in the previous example are
corrected.
MPE/iX 5.0 Documentation