Pervasive logo

Prev Advanced Operations Guide Next

Viewing Data File Statistics


This section includes information about generating a report that contains a data file's characteristics and statistics using STAT.

STAT

The STAT command generates a report that contains defined characteristics of a data file and statistics about the file's contents. Using the STAT command is a good way to determine if a file can be logged by the MicroKernel's transaction durability feature. The STAT command reports indexes the same whether they were created by the Create Supplemental Index operation (in Btrieve 6.0 and later) or the Create operation.

Format

BUTIL -STAT <sourceFile> [/O<owner | *>] [/S]

sourceFile
The fully qualified name of the data file for which to report statistics. For Windows NT, you do not need to specify the name of the path if the data file resides in the same directory as your current directory.
/Oowner
The owner name for the data file, if required.
/S (NetWare only)
By default, the Maintenance utility stops at each full screen of output and waits for a keystroke before continuing. With the/S option, the utility continuously scrolls output on the screen. You cannot use /S on the command line if you specify a command file, but you can specify /S with a command inside a command file.

Example

The following example reports file statistics for the PATIENTS.DTA file. The data file does not have an owner name.

butil -stat patients.dta 

However for NetWare, you must specify the full path such as:

butil -stat sys:\pvsw\demodata\patients.dta. 

The following example shows the resulting report:

************************************************** 
File Statistics for PATIENTS.DTA 
 
File Version = 8.00 
Page Size = 2048 
Page Preallocation = No 
Key Only = No 
Extended = No 
 
Total Number of Records = 16 
Record Length = 104 
Data Compression = No 
Variable Records = No 
 
Available Linked Duplicate Keys = 0 
Balanced Key = No 
Log Key = 1 
 System Data = No 
Total Number of Keys = 3 
Total Number of Segments = 4 
 
Key  Segment Position Length  Type  Flags 
Null Values*  Unique  ACS Values 
0    1       21       20      String MD   
--            16       0 
0    2        7       12      String MD   
--            16       0 
1    1        1        6      String M    
--            16       0 
2    1       83       10      String MD   
--            7        0 

Alternate Collating Sequence (ACS) List: 
 0 UPPER 
 
Legend: 
 < = Descending Order 
 D = Duplicates Allowed 
 I = Case Insensitive 
 M = Modifiable 
 R = Repeat Duplicate 
 A = Any Segment (Manual) 
 L = All Segments (Null) 
 * = The values in this column are hexadecimal. 
?? = Unknown 
-- = Not Specified 

This example shows that the file called PATIENTS.DTA is an 8.0 file. (The version number indicates the earliest Btrieve version that can read the file format.) The file has a page size of 2,048 bytes and has no preallocated pages. This is not a key-only file, nor is it an extended file.

Sixteen records have been inserted into the file. The file was defined with a record length of 104 bytes, does not use data compression, and does not allow variable-length records.

There are no linked duplicate keys available in the file. The file does not use balanced indexing. The MicroKernel performs logging using Key 1, and the file contains no system-defined data. The file has three keys comprised of four key segments.


Note
Indexes created with SINDEX are designated with the letter R by default unless you specified the Reserved Duplicate Pointer element.

The STAT report also provides information about specific keys. For example, the report shows that Key 0 allows duplicates, is modifiable, and consists of two segments:

Key 1 is the key the MicroKernel uses in logging this file. Key 1 consists of one segment. It starts in position 1, is six characters long, does not allow duplicates, is modifiable, and will be sorted as a STRING type. Sixteen unique values were inserted for this key. This key uses the UPPER.ALT alternate collating sequence file.

Key 2 consists of one segment. It starts in position 83, is 10 characters long, allows duplicates, is modifiable, and will be sorted as a STRING type. Seven unique key values were inserted for this key. This key uses the UPPER.ALT alternate collating sequence file.

File Version Notes

When reporting the file format version for a file, the MicroKernel reports the earliest engine version that can read the specified file. For example, you may have a file that was created in Btrieve 5.x format, but it may be reported as a version 3.x file because it does not use any 4.x or 5.x features. Starting with the 6.x format, the file itself contains a version stamp. Prior to 6.x, the only way to determine the file format version of a file is by inspecting the features that it uses. For version 5.x or earlier files, the table below shows the features which, if used, determine the version that is reported for the file:

 
Table 14-11 Version 5.x and Earlier File Format Features

This file format version is reported ...
... if one or more of these features are in use:
5.x
Compressed records
Key only file
4.x
Extended key types
Variable length records
Index added with CreateIndex operation
3.x
None of the above


Prev
Creating and Modifying Data Files
Contents
Up
Check for Revisions
Next
Displaying Btrieve Interface Module Version