Product Documentation

c-treeACE V11.0 Update Guide

Previous Topic

Next Topic

New File Verification Utilities - ctflvrfy.exe, ctvfyfil.exe, ctvfyidx.exe

Exceptional situations exist where files may be left in inconsistent states. It was requested to be able to more formally, and comprehensively, verify data and index file integrity. The backbone of this cross-file integrity check are new API calls available in the c-tree SDK. These verification APIs allow cross checking files in both directions: verifying all index entries have a matching data file record, as well as ensuring each data file record has consistent index key values.

Along with the introduction of these new c-tree API calls, several utilities were introduced with this functionality available for ease of routine use.

ctvfyfil.exe and ctvfyidx.exe utilities (described below) have been added to the client Admin area.

The following utilities have been added to the standalone low-level package:

ctflvrfy.exe

Usage

ctflvrfy <filename.idx>

Description

The Index Verify utility, ctflvrfy, takes the index name as the parameter and calls the ctVERIFY() and chkidx() functions to allow the user to verify the index, and optionally inspect it at a low-level.

>ctflvrfy custmaster.idx

Verifying file [custmaster.idx]

Retrying open with sect of [8]

Retrying open with sect of [12]

Retrying open with sect of [16]

Retrying open with sect of [20]

Retrying open with sect of [24]

Retrying open with sect of [28]

Retrying open with sect of [32]

Retrying open with sect of [36]

Retrying open with sect of [40]

Retrying open with sect of [44]

Retrying open with sect of [48]

Retrying open with sect of [52]

Retrying open with sect of [56]

Retrying open with sect of [60]

Retrying open with sect of [64]

Verifying the host index

Verifying index delete stack...

Verifying index links...

Verifying index leaf nodes...

Index page scan finds entries=75 header=75

Index nodes per level of tree structure - [0: 1]

( 2 resource pages )

Internal Index Verify: SUCCESSFUL

The return of ctVERIFY = 0, 75 KEYS FOUND

Verifying member index #1

Verifying index delete stack...

Verifying index links...

Verifying index leaf nodes...

Index page scan finds entries=75 header=75

Index nodes per level of tree structure - [0: 1]

( 2 resource pages )

Internal Index Verify: SUCCESSFUL

The return of ctVERIFY = 0, 75 KEYS FOUND

Verifying member index #2

Verifying index delete stack...

Verifying index links...

Verifying index leaf nodes...

Index page scan finds entries=75 header=75

Index nodes per level of tree structure - [0: 1]

( 2 resource pages )

Internal Index Verify: SUCCESSFUL

The return of ctVERIFY = 0, 75 KEYS FOUND

Verifying member index #3

Verifying index delete stack...

Verifying index links...

Verifying index leaf nodes...

Index page scan finds entries=75 header=75

Index nodes per level of tree structure - [0: 1]

( 2 resource pages )

Internal Index Verify: SUCCESSFUL

The return of ctVERIFY = 0, 75 KEYS FOUND

Verifying member index #4

Verifying index delete stack...

Verifying index links...

Verifying index leaf nodes...

Index page scan finds entries=75 header=75

Index nodes per level of tree structure - [0: 1]

( 2 resource pages )

Internal Index Verify: SUCCESSFUL

The return of ctVERIFY = 0, 75 KEYS FOUND

Verifying member index #5

Verifying index delete stack...

Verifying index links...

Verifying index leaf nodes...

Index page scan finds entries=38 header=38

Index nodes per level of tree structure - [0: 1]

( 2 resource pages )

Internal Index Verify: SUCCESSFUL

The return of ctVERIFY = 0, 38 KEYS FOUND

Verifying member index #6

Internal Index Verify: no tree structure

The return of ctVERIFY = 0, 0 KEYS FOUND

Verifying member index #7

Verifying index delete stack...

Verifying index links...

Verifying index leaf nodes...

Index page scan finds entries=75 header=75

Index nodes per level of tree structure - [0: 1]

( 2 resource pages )

Internal Index Verify: SUCCESSFUL

The return of ctVERIFY = 0, 75 KEYS FOUND

Verifying member index #8

Verifying index delete stack...

Verifying index links...

Verifying index leaf nodes...

Index page scan finds entries=16 header=16

Index nodes per level of tree structure - [0: 1]

( 2 resource pages )

Internal Index Verify: SUCCESSFUL

The return of ctVERIFY = 0, 16 KEYS FOUND

Verifying member index #9

Verifying index delete stack...

Verifying index links...

Verifying index leaf nodes...

Index page scan finds entries=75 header=75

Index nodes per level of tree structure - [0: 1]

( 2 resource pages )

Internal Index Verify: SUCCESSFUL

The return of ctVERIFY = 0, 75 KEYS FOUND

Verifying member index #10

Verifying index delete stack...

Verifying index links...

Verifying index leaf nodes...

Index page scan finds entries=75 header=75

Index nodes per level of tree structure - [0: 1]

( 2 resource pages )

Internal Index Verify: SUCCESSFUL

The return of ctVERIFY = 0, 75 KEYS FOUND

Verify complete......

Do you wish to perform a low-level tree walk? (Y/N): n

ctvfyfil.exe

The ctvfyfil utility calls the ctVerifyFile() (ctVerifyFile, ctVerifyFile) function. (See function for details.) The utility can be run in standalone and in client/server mode.

Usage

ctvfyfil [<option> ...] <file name>

where <option> is one or more of the following:

  • <page size> - Use the specified page size
  • -chkdat - Read data file only (default)
  • -chkdatkeys - Read data file and check keys in index
  • -chkdeletedspace - Check deleted space
  • -chkidx - Read index file
  • -chkidxrec - Read index file and check records in data file
  • -chkidxint - Additional index checks
  • -excl - Open the file in exclusive mode
  • -int - Interactive mode: stop on each error
  • -index=<N> - Check only the Nth index (N=1,2,...)

The example below shows the utility run on a file called mark.dat with the page size set to 8192:

ctvfyfil -8192 mark.dat

ctvfyidx.exe

The ctvfyidx utility uses the ctVERIFYidx() function to check the integrity of an index file. The client version of the ctvfyidx utility supports the command-line options listed below.

Usage

ctvfyidx [<option> ...] [-u <userid>] [-p <password>] [-s <servername] <file name> [<member #>]

where <option> is one or more of the following:

  • -excl - Open the file in exclusive mode
  • -delstk - Check delete stack (on by default)
  • -link - Check links (on by default)
  • -leaf - Check leaf nodes (on by default)
  • -chkkey - Check keys in leaf nodes

The optional parameter -page size equals sector size * 128 (third parameter in InitCtree()). If page size is not entered, a default value of 16 will be used. filename specifies the index file targeted for analysis. The member # refers to the index member number. A physical index file can contain one or more indexes. Each index has a member number (0, 1, 2, 3, etc.). For example, the sample index file custordr.idx provided with the FairCom ODBC Driver contains a total of two indexes. Depending on whether you specify 0 or 1 you will be looking at either the order number index or the customer number index. rflg represents an optional recovery flag switch and is only applicable when compiled with TRANPROC. Any character will enable rflg, which will result in c-tree skipping automatic recovery.

The ctvfyidx utility defaults to ctREADFIL. It uses ctEXCLUSIVE when the ‑excl option is specified. A ctREADFIL open will fail with error 12 and sysiocod ‑8 if any connection has the file open for write access.

Example

Below is an example of launching ctvfyidx along with output showing the results of the index verification.

# ctvfyidx -2048 custmast.idx 0

Index page scan finds entries=4 header=4

Index nodes per level of tree structure - [0: 1]

Internal Index Verify: SUCCESSFUL

Previous Topic

Next Topic

Advanced encryption master key store encrypted at system level on Windows

c-treeACE supports creating an advanced encryption master key store encrypted at the system level on Windows. Prior to this revision, the encrypted master key store file created by the ctcpvf utility on Windows could only be decrypted by the user account that created the file. This made it difficult to set up a Windows service that is using the LocalSystem account to be able to read the encrypted master key store file. (The ctcpvf utility had to be run as LocalSystem when creating the master key store.)

An option has been added to the ctcpvf utility to create the encrypted store using system-level encryption, meaning that any user account on the system can decrypt the file. Use the ctcpvf utility's ‑syslevel option to use this feature. Example:

ctcpvf -k mymasterkey -s ctsrvr.fkf -syslevel

This option has been added to the ctadmn utility's "Change advanced encryption master password" option. Example:

Enter the name of the filename list file >> files.txt

Enter the current advanced encryption master password >> ****************

Enter the new advanced encryption master password >> ******************

Please confirm the new master password by entering it again:

Enter the new advanced encryption master password >> ******************

Enter the encryption level [U]ser or [S]ystem for the encrypted store >> u

Changing master password for the specified files...

Successfully changed the advanced encryption master password.

See ctadmn.c for an example showing how to call the SECURITY() function with mode of SEC_CHANGE_ADVENC_PASSWD to change the master key. If you want to create the master key encrypted store using the system-level encryption option, OR in the ctENCMODsysl bit to the options field of the ctENCMOD structure whose address you pass to SECURITY().

Note: This support was added on the Windows platform only.

TOCIndex