Utilities - Client

The tools listed in the section are client-side utilities. 

 


ctinfo - ISAM File Info

Operational Model:

  • Client
  • Standalone

Usage:

ctinfo FileName [-isam] [-rdkeys] [<UserId> [<UserPassword> [<ServerName>]]]

Description

ctinfo retrieves IFIL and DODA structures from a FairCom DB file as well as XCREblk extended header information if available. This utility is useful in both client-server and standalone mode.

  • -isam - Open the specified data file in ISAM mode (V10.3 and later). See below.
  • -rdkeys - If this option is enabled, ctinfo opens the data file and associated indexes at the ISAM level instead of performing a low-level open, which avoids FRSKEY error: 26. Without this option, ctinfo does not cause FairCom Server to log replication diagnostics; an ISAM level file open used by -rdkeys will cause the details to be logged.
  • ServerName defaults to FAIRCOMS if not provided.

Note: The ISAM open requires the index files to exist and to be accessible, unlike the low-level open which requires only the data file to exist.

Authentication File

This utility supports the use of an encoded password file. Encoded password files keep user IDs and passwords from plain view when the utility is used within a script file. They are created with the ctcmdset utility. The plain text form of the file should be:

; User Id
USERID ADMIN
; User Password
PASSWD <pass>

Use the -1 option to specify the name of the encoded file.

Index Compression Modes

The file information utility, ctinfo, displays index compression modes as included in the key type when displaying index information.

Example

IIDX #2 { 

 

        /* key length              */ 4, 

        /* key type                */ 2048, (0x0800 = KTYP_KEYCOMPSRLE) 

        /* duplicate flag          */ 0, 

        /* null key flag           */ 0, 

        /* empty character         */ 0, 

        /* number of segments      */ 1, 

        /* r-tree symbolic index   */ cm_custnumb_idx, 

        /* alternate index name    */ 0000000000000000, 

        /* alternate collating seq */ 0000000000000000, 

        /* alternate pad byte      */ 0000000000000000, 

 

}; 

Output

In V10.3 and later, the ctinfo -isam option causes the utility to open the specified data file in ISAM mode. This option is useful for checking if a REPLICATE keyword enables replication for the file.
 

In V11 and later, the ctinfo utility outputs the header record for fixed-length files or the header key count for each logical index. For example:


Header Count

        4776 keys in index 0

        4776 keys in index 1

        4776 keys in index 2

 

 

ctinfo Sample Output

c-tree Plus(R) IFIL and DODA Extraction Utility.

This utility extracts file and field information from the file you

specify and displays that information. If the required IFIL and DODA

resources are present, the data file should work with the FairCom 

Drivers. The ODBC interface requires detailed information about the

relationship between data and index files and the layout of records

within a data file. This information is stored in the IFIL and DODA.

 

..\admin_custmast.dat is a variable-length data file.

 

Data record length = 40

Logical file size  = 19802

Physical file size = 32768

File mode          = 0x34 = VLENGTH TRNLOG 

Schema ID          = 0

 

Conditional Index Resource Details:

File does not have a conditional index resource.

 

Extended File Mode Details:

ctFRC2HDRS       : file has extended header

ctTRANDEP        : file is transaction-dependent

ctFILEPOS8       : file uses 8-byte file offsets

ctFILCRECHKmd3   : file created and no subsequent checkpoint

 

Extended File Creation Block:

extended file mode   : 0x40000052

segment file size    : 0

max total file size  : 0

1st file extent size : 0

file extent size     : 0

max # of segments    : 1

disk full threshold  : 0

 

 

File Definition Mask Details:

DEF_MASK_IFIL2       : extended IFIL structures

DEF_MASK_SPCMGT      : unambiguous superfile space management

DEF_MASK_PSCL24      : complete Pascal string def

DEF_MASK_XTDPRM      : extended permission mask

DEF_MASK_UNIACS      : UNIFRMAT alt col seq in IFIL

DEF_MASK_HUGEFL      : ctHUGEFILE enabled

DEF_MASK_HDRSZ4      : V7 HDRSIZ: 4 * 128

DEF_MASK_PARTIN      : partition files

IFIL {

/* data file name       */ ..\admin_custmast,

/* data file number     */ -1,

/* data record length   */ 40,

/* data extension size  */ 0,

/* data file mode       */ 54 = VLENGTH TRNLOG EXCLUSIVE PERMANENT 

/* number of indices    */ 2,

/* index extension size */ 0,

/* index file mode      */ 50 = ctFIXED TRNLOG EXCLUSIVE PERMANENT 

/* first r-tree field   */ 0000000000000000,

/* last r-tree field    */ 0000000000000000,

/* temporary file number*/ -1 

};

 

IIDX #0 {

/* key length              */ 8,

/* key type                */ 0,

/* duplicate flag          */ 0,

/* null key flag           */ 0,

/* empty character         */ 0,

/* number of segments      */ 1,

/* r-tree symbolic index   */ $ROWID$,

/* alternate index name    */ 0000000000000000,

/* alternate collating seq */ 0000000000000000,

/* alternate pad byte      */ 0000000000000000,

};

 

ISEG [] {

{16, 8, 3},

};

 

IIDX #1 {

/* key length              */ 4,

/* key type                */ 0,

/* duplicate flag          */ 4,

/* null key flag           */ 0,

/* empty character         */ 0,

/* number of segments      */ 1,

/* r-tree symbolic index   */ admin_custmast_sys_001,

/* alternate index name    */ ..\admin_custmast_sys_001.idx,

/* alternate collating seq */ 0000000000000000,

/* alternate pad byte      */ 0000000000000000,

};

 

ISEG [] {

{3, 4, 12},

};

 

SCHEMA MAP HEADER:

flavor:     2

align:      8

delimiter:  '\0'  (0 decimal)

padding:    ' '   (32 decimal)

map length: 76

nbr fields: 10

nbr blocks: 10

 

 

DODA:

field offset field type length

----- ------ ---------- ------

$DELFLD$                 0 CT_ARRAY     (128)     9

$NULFLD$                 9 CT_ARRAY     (128)     1

$ROWID$                16 CT_INT8      (231)     8

cm_custnumb            24 CT_FSTRING   (144)     4

cm_custzipc            28 CT_FSTRING   (144)     9

cm_custstat            37 CT_FSTRING   (144)     2

cm_custrtng            39 CT_FSTRING   (144)     1

cm_custname            40 CT_2STRING   (162)    49

cm_custaddr            89 CT_2STRING   (162)    49

cm_custcity           138 CT_2STRING   (162)    49

 

Header Count

   4776 keys in index 0

   4776 keys in index 1

   4776 keys in index 2

 

The required IFIL and DODA resources are present.

A special data types DLL may be required to access

this file with the FairCom(R) Drivers.

Contact your application vendor for details.

 

ctixmg - Incremental ISAM / Resource sample

Operational Model:

  • Client

Usage

ctixmg [<UserID>  <UserPassWord> <ServerName>]

Description

ctixmg supports variable-length data records using Incremental ISAM structures to specify the file parameters for creation and optionally supports resources. If RESOURCES are defined in ctoptn.h prior to opening the files the proper resource open, OpenFileWithResource(), and close, CloseRFile(), functions are used. If RESOURCES are not defined, then OpenIFileXtd() and CloseIFile() are used to open and close the files. The optional UserId, UserPassWord and ServerName parameters only apply to FairCom Server based systems.

ctixmg automatically creates the files it needs if they do not exist. It rebuilds the files if they appear corrupt. In transaction processing environments, automatic recovery replaces the need for rebuilding the files.

ctixmg runs in all FairCom DB console-based models. ctixmg permits transaction processing control including Begin(), and Commit(). In a non-transaction processing system, Begin() and Commit() are replaced by LockISAM() to control ISAM level locking.

 

ctsfex - Superfile Data Export Utility

The ctsfex utility exports data from a superfile to another superfile or to individual files identical to the superfile members. This high-performance utility exports the data without index updates, transaction control, or file extension. After the data export is completed, the indexes are rebuilt and transaction control and file extension properties are restored on the newly-created files. This utility also supports a multi-threaded version allowing each thread to process a superfile member.

Operational Model:

  • Client
  • Standalone

Usage:

ctsfex sf1 [-f sf2 | -d dir] [-cCrovV] [-t thds] [-e key]
           [-m recs] [-n size]  [-T <path>] [-ctscmp <args>]
           [-s svn] [-u uid] [-p upw] [-i]

Where:

  • -f sf2 - Export to superfile sf2
  • -d dir - Export to standard files in directory dir
  • -c - Create the target files without exporting data.
  • -C - Create AND export data for _isp@ and .group tables only.
  • -r - Force replacement (overwrite) of existing files.
  • -o - Force open of a corrupted file using the ctOPENCRPT file mode.
  • -v - Open the superfile and its members to validate a superfile.
  • -V - Used in conjunction with -v, this option validates records with a read.
  • -m recs - Send record counter to stdout every recs records.
  • -e key - Encrypt the target files with key
  • -t threads - Maximum number of concurrent threads to use.
  • -T <path> - Specify the location of temporary files created by the rebuild operation.
  • -s server_name - Server name for connecting to the server.
  • -u userID - User ID for connecting to the server.
  • -p userpassword - User password for connecting to the server.
  • -ctscmp <args> - Invoke the superfile compact utility, ctscmp with <args>.
  • -i - Read records from superfile members using the first index instead of physical order (if superfile member has no indexes, physical order is used for that member).

Standalone Usage

In standalone mode an additional option is available to specify the index node size:

  • -n size - Index node size to use (standalone mode only).

Page Size

Default PAGE_SIZE settings are now considered in superfile compact and export utilities, ctsfil and ctsfex. In V11.9.5 and later, this size is 32768 (sect = 256). Prior to V11.9.5, it was 8192 (sect = 64). Server and standalone of these utilities have been updated to use the new default page size. ctsfex supports a parameter for use with superfiles created with different page sizes.

 

cttpca - TPC A Test

Operational Model:

  • Client

This is a C code sample program implementing the TPC (Transaction Processing Council) A test using the FairCom DB ISAM, FairCom DB API (CTDB), and ODBC APIs. You can execute the same test set using any combination of these APIs.

When included with FairCom ISAM, this utility supports the FairCom DB BTRV interface as a fourth API.

This utility is perfect for benchmarking across computer systems, or for comparing the performance of these FairCom DB APIs. For full usage information, simply execute the utility without any parameters.

See ct_tpc for a C++ code version.

Note: This program is considered legacy, in favor of the more advanced ct_tpc version.

 

 

ct_tpc - TPC A Test

Operational Model:

  • Client

This is a C++ code sample program implementing the TPC (Transaction Processing Council) A test using the FairCom DB ISAM, FairCom DB API (CTDB), and ODBC APIs. You can execute the same test set using any combination of these three APIs. For full usage information, simply execute the utility without any parameters.

When included with FairCom ISAM, this utility supports the FairCom DB BTRV interface as a fourth API.

This utility is perfect for benchmarking across computer systems, or for comparing the performance of these FairCom DB APIs.

See cttpca for a C code version.

 

ctvlqa - Variable-length quality assurance utility

Operational Model:

  • Client

Usage:

ctvlqa

Description

ctvlqa is designed as a torture and performance test for variable-length records. The program generates random data to build generic records based on the file structure layout from ctixmg. ctvlqa prompts the user for the file name, beginning record size, ending record size, record increment size, and quantity of records to add.

The program does the following:

  1. Creates the data file with the desired file name.
  2. Adds the first record of the beginning record size.
  3. Reads back the record to ensure it was properly inserted into the database.
  4. Adds the desired quantity of records, checking each insertion by re-reading.
  5. Increments the beginning record size by record increment size and inserts the desired quantity of records for this record size.

Steps 2 - 5 repeat until the ending record size is encountered or an error occurs.

An output log can be created by changing OUTLOG in ctvlqa.c from 0 to 1.

 

ISQL Command-Line Interface

The FairCom DB Interactive SQL utility (ISQL) provides an industry-standard "command processing" interface to the FairCom DB Database Engine.

Operational Model: Client

FairCom offers two separate implementations of Interactive SQL:

  1. A command-line version (isql.exe or isql). This utility is designed as a command-line tool and can be placed in job streams.
  2. A GUI tool version within the Windows program FairCom DB SQL Explorer.

Either implementation allows you to issue SQL statements directly from a command prompt for immediate displayed results. You can use Interactive SQL to test and prototype SQL statements to be embedded in programs; modify an existing database; perform ad-hoc queries; and run existing SQL scripts.

With few exceptions, you can issue any SQL statement in ISQL that can be embedded in a program, including CREATE, SELECT, and GRANT statements.