The tools listed in this section are standalone utilities.
ct_ver - Display FairCom DB version that created file
You can run the ct_ver utility to determine what version of FairCom DB was used to create your data file.
Operational Model:
- Standalone
Usage:
ctver <filename>
Where:
- <filename> - The name of the file to be checked.
ctchkbin - Checking for affected tables
Execute the ctchkbin utility to scan an entire server or a single database for tables that may be affected by the binary/varbinary issue. The syntax of ctchkbin is as follows:
Operational Model:
- Standalone
Usage:
ctchkbin.exe [-f] [-s server] [-u username] [-a password] [-d database]
Where:
- -f - Output only tables that fail check
- -d database - Scan database. Default: ctreeSQL
- -d ALL - Scan all databases in session.
- -s server name - Default: FAIRCOMS
- -u user name - Default: ADMIN
- -a user password - Default: ADMIN
Example
ctchkbin.exe –s FAIRCOMS –u ADMIN –a ADMIN –d ctreeSQL
The ctchkbin utility output to the screen the result of the check scan, printing one table per line, with the following columns:
database table status comments
Where:
- database - database name
- table - table name
- status - status code of the check performed on table (please see code listing in the following section)
- comments - brief comments if table fail scan
Example output
ctreeSQL admin_tb1 0
ctreeSQL admin_tb11 0
ctreeSQL admin_tb12 0
ctreeSQL admin_tb13 3 User may choose CTDB_BINARY_WITH_LENGTH or CTDB_BINARY_WITHOUT_LENGTH
ctreeSQL admin_tb14 3 User may choose CTDB_BINARY_WITH_LENGTH or CTDB_BINARY_WITHOUT_LENGTH
ctreeSQL admin_tb2 0
ctreeSQL admin_tb3 0
ctreeSQL admin_tb4 0
ctclntrn Utility - Clean Transaction Mark
Operational Model:
- Standalone
Usage:
ctclntrn [-<page size in bytes>] <file name> [<password>]
Description
ctclntrn “cleans” the high-water transactions marks within a FairCom DB index.
Suggested Steps for Successful Clean and Reset
In the event of an impending transaction number overflow, the server administrator should follow these steps to restart transaction numbering:
- Perform a clean FairCom DB shutdown.
- Delete the transaction logs and housekeeping files: files S0000000.FCS, S0000001.FCS, D*.FCS, I*.FCS, and L*.FCS.
- Use the ctclntrn utility to clean all indices (which resets the transaction numbers in the leaf nodes and index header) used by your application, including your application index files, superfiles, variable-length data, and c-tree Server files including the following if present:
- FAIRCOM.FCS -- If you are not using any User IDs or passwords other than ADMIN and GUEST, you can simply delete this file. (If you do delete this file, tFairCom DB will re-create it with the single user ADMIN and password ADMIN.)
- CTSYSCAT.FCS -- This is only present if you are using c-tree ODBC Drivers.
- SEQUENCEIX.FCS
- SYSLOGIX.FCS
- SYSLOG*.FCS
- ALL FairCom DB SQL Database Dictionaries
- <databasename>.dbs/SQL_SYS/<databasename>.fdd
- ctdbdict.fsd (session dictionary)
- Restart the c-tree Server.
The server will create new transaction logs and start transaction numbering from 1 again.
It is important to run ctclntrn on all files. If you miss any files and later open that file with a large transaction number in its header, the server will again increase its transaction number to that large value. You will need to repeat this procedure should that occur.
FYI: The ctclntrn utility uses the CleanIndexXtd() FairCom DB function. This function cleans any leaf nodes of exceptional transaction marks and resets the transaction high-water mark in the header to zero. This avoids rebuilding the entire index file.
You can use the c-tree High-water Mark Utility, cthghtrn, to verify that the transaction high-water marks in the files are back to zero, or other reasonably low number.
Tip: The AUTO_CLNIDXX YES configuration option can help automate and detect files which have been missed.
See also
- cthghtrn - Displays the high-water mark for transactions (cthghtrn - Displays the high-water mark for transactions, cthghtrn utility)
ctcmpcif - IFIL-based Compact Utility
This utility can be used to encrypt and decrypt c-tree data files.
Operational Model:
- Client
- Standalone
- FairCom DB Standalone SQL Service
Standalone Usage
ctcmpcif <data file name> <options> <user> <pass> <server> <-sectors>
Where:
Note: The order of parameters must be be as specified in the above usage descirption.
- <-sectors> - The sector size to use. Enter a dash followed by the size of the sectors. The sector parameter is especially useful if you need to adjust a file’s PAGE_SIZE to match the FairCom Server. This option must go after <server>. The sector size is 256 is in the example below:
ctcmpcif xx8.dat ADMIN ADMIN FAIRCOMSMS -256
<options> can be:
- -callback - Enable notifications of compact progress.
- -compress - Create the compacted data file with compression (defaults to zlib library if not specified in server configuration).
- -encrypt=cipher - Create the compacted file using the specified cipher. See the encryption sections below.
Accepted values:- AES: aes16, aes24, or aes32
- Blowfish: blf8, blf9, ..., or blf56
- DES: des8, des16, or des24
- none
- -flexrec - (Supported in V11.5 and later) Add Hot Alter Table support to the file.
- -idxseg=<M>@<S> - If creating an index, use M automatic segments of size S. Size is specified in megabytes, or you can specify MB or GB as a suffix. (Example: -idxseg=10@1GB)
- -local - causes the utility to use a standalone (local side) connection instead of a client connection when linked with a LOCLIB library.
- -nocompress - Create the compacted data file without compression.
- -noflexrec - (Supported in V11.5 and later) Remove Hot Alter Table support from the file.
- -oldsec - Use the utility's original security attribute assignment.
- -online - (In V13 and later) Defragment the file in ctSHARED mode. Online compact is not allowed for changing encryption or compression settings.
- -purge - Delete records that have illegal duplicate key values.
- -redosrl - Reassign serial numbers to the records in the compacted file instead of copying the values from the original file.
- -repairdata - Attempt repair if damaged data records are detected.
- ‑sortmem=<N> - Set the size of sort memory to N KB in non-client builds. This option can be used to increase the rebuild speed for large files.
- -temppath=<temporary_path> - Use the specified directory for temporary files.
- -updifil - Update IFIL resources in the data file.
- -x8 - Use extended create blocks read from data and index files.
Client-Side Usage
# ctcmpcif DataFileName [-purge] [-updifil] [<UserId>]
[<UserPassword> [<ServerName>]]
Where:
- -purge - purge duplicate records.
- -updifil - update IFIL resources in the data file.
UserID, UserPassword, and ServerName are only needed for client versions of this utility. FairCom recommends building this utility as a Single-user Standalone application.
ctcmpcif reads the IFIL structure from DataFileName and calls CompactIFileXtd() and RebuildIFileXtd() to compact and rebuild DataFileName and its associated indexes. If ctcmpcif cannot extract the IFIL from the target file, it will ask for the name of another copy of the file from which to extract the IFIL information.
Prior to FairCom DB V9.3, several option values were defined such as updateIFIL, purgeIFIL, and badpartIFIL, that can be specified. These values are specified by adding them together. For example: myifil.tfilno = updateIFIL + purgeIFIL. A new approach simplifies checking of these options. The following option values are now specified in ctport.h:
#define updateIFILoption 0x0002
#define purgeIFILoption 0x0004
#define badpartIFILoption 0x0008
#define redosrlIFILoption 0x0010
These values can now be OR-ed together and the negative of the result stored in the tfilno field of the IFIL structure passed to the compact or rebuild function. For example, to indicate that you want to assign new serial numbers, do the following:
myifil.tfilno = -redosrlIFILoption;
CMPIFIL(&myifil);
If you want to also use more than one option when compacting or rebuilding a file, OR them in to the value and negate the result. For example,
/* assign new serial numbers and update IFIL resource. */
myifil.tfilno = -(redosrlIFILoption | updateIFILoption);
CMPIFIL(&myifil);
ctcmpcif will attempt to open files of any page size definition. In addition, in standalone mode, it will create the new file based on the provided page size.
Note: This tool does not compact partitioned files. If you attempt to compact a partitioned file, the tool will return PCMP_ERR (954, compacting partitioned file not supported).
Changing Encryption Attributes
In V11 and later, the compact utility can optionally change the encryption attributes. To use this option, OR in the setencryptIFILoption bit into the tfilno field of the IFIL structure whose address you pass to the compact API function. When using this and other options, remember to negate the tfilno value after you OR in the options. For example:
myifil.tfilno = -(redosrlIFILoption | setencryptIFILoption);
CMPIFIL(&myifil);
Specifying the Encryption Cipher
In V11 and later, the ctcmpcif utility supports an option to specify the encryption cipher for the data and index files created by the compact operation. Usage:
-encrypt=cipher - Create the compacted file using the specified cipher:
- for AES, use aes16, aes24, or aes32
- for no encryption, use none
Note: If an index file does not exist, the original data file's encryption attributes are used when creating that index file.
To change the encryption attributes of a file using this ctcmpcif compact utility or the compact API function from a client, you must add the option CHANGE_ENCRYPTION_ON_COMPACT YES to ctsrvr.cfg. Otherwise, the operation fails with error NSUP_ERR (454, not supported).
Environment Variable to Enable Advanced Encryption
In V11.5 and later, c-tree supports enabling advanced encryption at run time using an environment variable. Set the environment variable CTREE_ADVANCED_ENCRYPTION to YES to enable advanced encryption if it is supported. This environment variable can be used to allow c-tree utilities to enable advanced encryption even if they haven't been updated yet to automatically enable advanced encryption when needed. Examples include the rebuild and compact utilities, ctrbldif and ctcmpcif.
Note: If c-tree does not support advanced encryption and this environment variable is set, the c-tree initialization will fail.
Note: In order to use advanced encryption, a master key must be supplied. The utility will prompt for the master key, or a master key file can be created like this:
1: create master key file:
ctcpyf -k mykey -s mykey.fkf
2: set environment variable to the name of the master key file:
CTREE_MASTER_KEY_FILE=mykey.fkf
If using these steps, then the utility will read the master key from the file instead of prompting for the key.
Considerations
- Even without the -x8 option, some extended create block settings such as the huge file, extended header, and 6-byte transaction number options, are always applied to new files.
- The -x8 option requires all associated index files that are referenced in the data file's IFIL structure to exist, as the utilities use OpenIFile() to open the data file and all associated index files to read the extended create block values.
When an application calls the standalone version of the Xtd8 file compact or rebuild functions (for example, CMPIFILX8() or RBLIFILX8()), index files created by the compact or rebuild no longer have the 6-byte transaction number attribute enabled if the specified extended create block's x8mode field has the ctNO6BTRAN bit set.
- A rebuild or compact will fail with the new error code TFLN_ERR (943) when a client library that supports the new rebuild or compact option format attempts to use this feature with a FairCom Server that does not support this new format.
- In V11 and later, the compact and rebuild API functions preserve the original files' encryption attributes by default. If the index files don't exist when compact/rebuild are called, they will be created with the data file's encryption attributes.
- In V11 and later, the compact utility always deletes and recreates the index files after saving the resources from the original index file. This provides the expected behavior of (possibly) reducing the size of the index file.
See also
- File Recovery in the FairCom DB Developer's Guide
- Updates in handling of security attributes
- Preventing Possible Data Loss with Compact & Rebuild Operations
-oldsec - Updates in handling of security attributes
In V10.3 and later, the ctrbldif utility assigns data file owner/group/permissions to index files and ctcmpcif assigns original data file owner/group/permissions to compacted data/index files.
The rebuild and compact utilities now read the permission mask, owner, and group settings from the original data file and after the rebuild or compact is completed, the utilities assign these same attributes to the new files.
A command-line option has been added to the utilities to restore the previous security attribute behavior. Use the -oldsec option to cause the rebuild and compact utilities to set the security attributes as they did before this revision. For example:
ctrbldif mark.dat -oldsec ADMIN ADMIN FAIRCOMS
The -oldsec option can be used if rebuild and compact are failing with error 455 (user does not belong to group) if you delete an index then run the rebuild or compact utility on the data file using a user account that does not belong to the group that is assigned to the data file.
Note: These changes only apply to the client and server versions of these utilities. Setting the security attributes is not supported in standalone mode, so the standalone rebuild and compact utilities behave as follows:
1) When the standalone mode rebuild utility creates new index files instead of reusing the new index files (for example if the original index files have been deleted before running the rebuild utility), the new index files are assigned a permission mask of zero (no restrictions on permissions), and the owner and group are unassigned (empty).
2) The standalone mode compact utility always preserves the security attributes of the data file. If the index files do not exist, the newly-created index files are assigned the same values as the standalone rebuild does when it creates new index files.
Preventing Possible Data Loss with Compact & Rebuild Operations
In most cases, compact and/or rebuild operations perform as expected: scanning your data file for potential invalid record headers, fixing those it finds invalid, and finally writing out a new compressed file and rebuilding indexes. Recently, a case was investigated where our default behavior should not be used due to potential data file corruption.
In a few rare and select cases, FairCom identified situations where compacting a variable-length and (typically) non-transaction enabled (non-TRNLOG) file, using the ctcmpcif compact utility or any of the CompactIFile functions, can fail, potentially, and unexpectedly, also altering your original file being compacted such that further attempts result in data loss.
Typically, it is only expected to see this situation occur with non-TRNLOG enabled files. However, in case #2 discussed below, a valid TRNLOG enabled file data file was found to exhibit this very unusual behavior. This raises an important point – if you encounter situations where you believe you must rebuild TRNLOG enabled files, please contact FairCom, as this is a highly unexpected event and we want to fully understand the context and nature of your data integrity situation. The recoverable nature of TRNLOG files should always maintain full data integrity through nearly any circumstance.
We have modified prior behavior to take a much more conservative approach protecting your original data state. Compact and rebuild (which can produce similar results) facilities listed below have been altered such that, when any data file integrity issue is detected, default behavior is now to stop further operations. In addition, no changes are made to existing original data records.
Note: This is a compatibility Change.
Full List of Functions Changed
The following utilities and function calls now default to stopping if an error is encountered:
ctcmpcif – Compact utility
ctrbldif – Rebuild utility
GUI tool - Dr. ctree has compact and rebuild functionality
| Long function name | Short function name |
|---|---|
| CompactIFile() | CMPIFIL() |
| CompactIFileXtd() | CMPIFILX() |
| CompactIFileXtd8() | CMPIFILX8() |
| RebuildIFil() | RBLIFIL() |
| RebuildIFileXtd() | RBLIFILX() |
| RebuildIFileXtd8() | RBLIFILX8() |
Default Behavior Changes the Original File
Prior to FairCom DB V11.5, the default behavior for compact and rebuild operations over variable-length record data files was to scan for invalid record headers before compacting a file. If the logic found invalid headers, it attempted to fix the headers in the original file. If the operation failed at this point, the original file could become corrupted. Two significant classes of situations are known to arise:
- In the vast majority of cases, this can only occur if the original data file is already corrupted due to invalid and irrecoverable record headers. Because the original data file is corrupted, restoring a backup is recommended.
- In some rare cases, it is possible the operation could exhibit vulnerability caused by mistaking old marks or binary record data as valid record header marks. In a very specific case, compact operations can treat space management nodes with inuse length 0, while logically a correct value, as invalid. This case could lead to data loss in a valid file, making it necessary to restore from a backup.
To ensure the second case does not cause data loss, observe our recommendations below and always back up all concerned data files before compacting or rebuilding.
Compact and Rebuild Best Practice
To avoid potential data loss, FairCom strongly recommends only using our latest FairCom DB V11.5 compact and rebuild logic that default to stopping if a corrupt data record header is encountered, and returns error DCPT_ERR (1107) rather than attempting to repair the data link in the record header. This allows an administrator to know with greater certainty that serious damage has occurred and they may prefer to recover the file from a backup.
If an administrator prefers allowing FairCom DB to attempt to recover a file, as done prior to V11.5, the following options are available to revert to prior behavior:
- -repairdata command-line switch - Use this switch with the ctcmpcif and ctcmpcif compact utilities, e.g., ctcmpcif -rdata
- -repairCorruptIFILoption option - The repairCorruptIFILoption option should be OR-ed into the tfilno of the rebuild (RebuildIFIL()) and compact (CompactIFile()) functions using the setIFILoptions() macro.
For example:
myIFIL.tfilno = setIFILoptions(repairCorruptIFILoption | updateIFILoption);
Best Practices:
1.) It is always important to back up concerned data files before you attempt to compact or rebuild them.
2.) Ensure sufficient disk space is available before starting a compact or rebuild. You will need up to at least 3X the size of the data file plus index files (original files + new files + copy) for a successful compact or rebuild.
3.) Consider keeping a copy of the data file for sufficient time and ensure all expected data is available before removing the backup.
ctencrypt - Utility to Change Master Password
The FairCom DB advanced encryption feature uses a master password to encrypt the file-specific advanced encryption key in c-tree data, index, and transaction log files that are encrypted using advanced encryption. ctencrypt is a standalone utility that can be used to change this master password for specified c-tree data, index, and transaction log files.
Operational Model:
- Standalone
Usage:
ctencrypt <options> <command>
Available Options:
- -n <sect> - Node sector size. The default is 64, which corresponds to PAGE_SIZE of 8192.
Available Commands (only one at a time may be specified):
- -chgmpw <filelist> - Change master password for the files whose names are listed in the file <filelist>. <filelist> is the name of a text file created by the end user that lists the names of the files (data and index), one per line, that are to be processed.
ctencrypt requires a password verification file named ctsrvr.pvf that was created using the current master password to exist in its working directory. ctencrypt prompts the user for the current master password and for the new master password (prompting twice in order to confirm that the new password was properly entered).
Note: ctencrypt does not change the master password file, ctsrvr.pvf. The ctcpvf utility will need to create a new file for server startup in coordination with the new password used to re-encrypt the encryption key for the files. Failure to do so will result in DCOD_ERR errors (606, failure to decode file) when opening files.
ctencrypt processes the specified files, indicating the status of each file and the total of successful and failed operations. Note that the FairCom Server must be shut down while these file modifications take place.
ctencrypt creates a temporary directory named temp\ctencrypt.tmp.<process_id> to store its transaction logs. This directory is normally deleted when ctencrypt shuts down.
Important: ctencrypt does not undo any changes in case of error. The files that it lists as successfully updated will use the new master password even if the utility failed to update other files.
Example File List
A semicolon can be specified at the start of a line to indicate a comment which is ignored.
; c-tree Advanced Encryption Conversion Listing File
; -----------------------------------------------------
; Created Wed Dec 01 01:38:00 2010
; transaction log files
L0000000.FCT
L0000002.FCA
L0000003.FCA
L0000004.FCA
L0000005.FCA
L0000006.FCS
L0000007.FCS
L0000008.FCS
L0000009.FCS
L0000010.FCT
; data files
mydatafile.dat
C:\My Documents\test.dat
vcusti
Note: All physical encrypted files, data and index files, must be specified in order to be modified. No attempt is made to determine associated files.
If the server was cleanly shutdown in such a manner that its transaction logs are no longer necessary, then they will not need to be included as part of this password change. If you wish to use the ctencrypt utility to modify any existing encrypted transaction logs (for example, archive logs for replication), their names must be specified in the list file. ctencrypt does not attempt to locate any transaction log files on its own.
Example Output
c-tree file encryption utility
This utility requires a master password in order to start.
Please enter master password:
Enter new master password :
Confirm new master password :
Changing master password for the specified files...
[ OK ] SYSLOGDT.FCS
[ OK ] vcusti
[ OK ] L0000000.FCT
[ OK ] L0000002.FCA
[ OK ] L0000003.FCA
[ OK ] L0000004.FCA
[ OK ] L0000005.FCA
[ OK ] L0000006.FCS
[ OK ] L0000007.FCS
[ OK ] L0000008.FCS
[ OK ] L0000009.FCS
[ OK ] L0000010.FCT
12 succeeded, 0 failed
Successfully changed master password for all specified files
Error Returns
Two new error codes have been added related new password management features:
- BMPW_ERR (932) - The specified encryption master password is incorrect.
- ICOD_ERR (933) - An encryption operation failed due to an unexpected internal error. See CTSTATUS.FCS for details.
ctfdmp - Forward Roll Utility
Operational Model:
- Standalone
ctfdmp
Used to restore data to a given time following a ctrdmp restore.
ctfdmp takes an optional !RP <name> argument to set the point in time to stop the forward roll. This argument is also used by the ctrdmp script option, as described in Rollback to New Restore Points with ctrdmp. To incrementally roll forward from there, rename the previous RSTPNT_CHKPNT*.FCS to S0000001.FCS (the start point for the ctfdmp), and supply a new !RP and transaction logs. More information on the !RP <name> can be found here: ctfdmp - Forward Roll Utility
Note: The ! prefix needs to be escaped when using the Unix Bash shell.
Environment Variable for Advanced Encryption Password
If this utility has advanced encryption enabled, it can read an encrypted password file instead of being prompted to enter the master password. To enable this, set the environment variable CTREE_MASTER_KEY_FILE to the name of the encrypted master password file.
ctfdmp accepts !RECOVER_DETAILS for additional progress notifications diagnostic output.
See also
- Maintaining Database Integrity in the c-tree Server Administrator's Guide
- ctrdmp - Dynamic Dump Recovery or System Rollback (ctrdmp - Backup Restore or System Rollback, Backup Restore Utility)
- Rollback to New Restore Points with ctrdmp
ctfileid - Update File IDs
The Update File ID utility, ctfileid, provides a convenient and safe way to update the fileid parameter of the file header. See the section Copying Server Controlled Files in the FairCom DB Programmer's Reference Guide for details for when this may be necessary. The file is opened exclusively, ensuring that the server does not have it open.
Operational Model:
- Client
- Standalone
The syntax for this utility is shown below:
ctfileid file [-ioq] [-n <size>] [-t] [-s <svn>] [-u <uid>] [-p <upw>]
- -i - Also update indexes related to data file.
- -o - Force open of corrupted files (ctOPENCRPT).
- -q - Quiet (do not output to stdout).
- -t - Uses the PUTHDR() mode ctTIMEIDhdr to update only the time ID portion of the file ID.
- -s <server name> - FairCom Server name.
- -u <user ID> - User name.
- -p <user password> - User password.
Note: ctfileid.c replaces the previous informal and undocumented utilities, updateid.c and newid.c.
Standalone Usage
An additional option is available to set the node size in standalone mode:
- -n <size> - Set node size (standalone only).
See Also:
ctfixbin - Fixing Affected Tables
Based on the output of the ctchkbin utility, execute the ctfixbin utility on a particular table to set the binflag property of CT_ARRAY and CT_2STRING fields to the appropriate value.
Operational Model:
- Standalone
Usage:
ctfixbin.exe table_name action [-s server] [-u username] [-a password] [-d database]
- table_name is the name of a table to fix (without the .dat extension)
- action is one of the following:
- 1 - set binflag to CTDB_BINARY_UNKNOWN
- 2 - set binflag to CTDB_BINARY_WITHOUT_LENGTH
- 3 - set binflag to CTDB_BINARY_WITH_LENGTH
- -d database - Scan database. Default is ctreeSQL
- -s server - Default is FAIRCOMS
- -u username - Default is ADMIN
- -a password - Default is ADMIN
Example
ctfixbin.exe admin_tb13 2 -s FAIRCOMS -d ctreeSQL -u ADMIN -a ADMIN
ctidmp - Examine Dump Files
Operational Model:
- Standalone
Usage:
ctidmp [dump file name]
Description
The ctidmp utility lists the contents of a dynamic dump file or a specific extent of a dump broken into multiple files with the !EXT_SIZE keyword. Compile and link this utility with a FairCom DB Standalone Single-user TRANPROC library.
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.
ctfdmp - Forward Roll Utility
Operational Model:
- Standalone
Used to restore data to a given time following a ctrdmp restore. For more information on performing forward rolls using ctfdmp, see the FairCom Database Roll Forward Guide.
Command syntax:
CTFDMP [!#FCB <maximum number of files>]
[!PAGE_SIZE <bytes per buffer page>]
[ !RP <filename> ]
[ !REDIRECT <old> <new> ]
[ !RECOVER_MEMLOG <N> ]
[ !RECOVER_DETAILS ]
[!TRAN_RECOVERY ]
[!SKIP]
Note: The ! prefix needs to be escaped when using the Unix Bash shell.
ctfdmp !#FCB and !PAGE_SIZE should be used only if the application uses more than the default number of #FCB or if the PAGE_SIZE is larger than the default. If either of the first two command-line arguments is used, they both must be specified.
!SKIP is optional and does not cause an error termination if a file required during the forward roll is not accessible. Extreme care must be exercised if !SKIP is used because the forward roll cannot ensure data integrity for skipped files.
ctfdmp accepts !RECOVER_DETAILS for additional progress notifications diagnostic output.
ctfdmp takes an optional !RP <name> argument to set the point in time to stop the forward roll. This argument is also used by the ctrdmp script option, as described in Rollback to New Restore Points with ctrdmp. To incrementally roll forward from there, rename the previous RSTPNT_CHKPNT*.FCS to S0000001.FCS (the start point for the ctfdmp), and supply a new !RP and transaction logs.
For information on !REDIRECT, !RECOVER_MEMLOG, !RECOVER_DETAILS, AND TRAN_RECOVERY, see Restore Script Options. (Note that TRAN_RECOVERY here is called !DIAGNOSTICS TRAN_RECOVERY in the Restore Script Options.)
Environment Variable for Advanced Encryption Password
If this utility has advanced encryption enabled, it can read an encrypted password file instead of being prompted to enter the master password. To enable this, set the environment variable CTREE_MASTER_KEY_FILE to the name of the encrypted master password file.
See also
- Maintaining Database Integrity in the c-tree Server Administrator's Guide
- ctrdmp - Dynamic Dump Recovery or System Rollback (ctrdmp - Backup Restore or System Rollback, Backup Restore Utility)
- Rollback to New Restore Points with ctrdmp
ctrbldif - IFIL-based Rebuild Utility
A rebuild utility using the IFIL definitions stored in the header of a file:
Operational Model:
- Client
- Standalone
Usage:
ctrbldif DataFileName [<UserId> [<Password> [<ServerName>]]] <options>
Description
ctrbldif reads the IFIL structure from DataFileName and calls RebuildIFileXtd() to rebuild DataFileName and its associated indexes.
The following switches can be added in the location specified by <options> above:
- -callback - In V11.5 and later: When used with a FairCom DB Server this will provide additional feedback on the rebuild progress.
- -idxseg=<M>@<S> - If creating index, use M automatic segments of size S. Size is specified in megabytes, or you can specify MB or GB as a suffix. For example: -idxseg=10@1GB
- -local - causes the utility to use a standalone (local side) connection instead of a client connection when linked with a LOCLIB library.
- -oldsec - Use prev10.3 security attribute behavior.
- -online - In V13 and later: Rebuild the index while it remains available to other users.
- -purge - Purge duplicate records.
- -repairdata - Attempt repair if damaged data records are detected.
- -skipdatascan - In V11.5 and later, if you know your datafile is in a good state, you can use this option to skip the initial datafile validity scan for faster rebuilds.
- -sortmem=<N> - Use N KB of memory for sorting. This option can be used to increase the rebuild speed for large files.
- -updifil - Update the IFIL resource within the data file.
- -x8 - Use extended create blocks read from data and index files.
FairCom DB Standalone Options
- -temppath= - directory path, <temporary_path>, to create temporary sort and purged record files. (This standalone option is the equivalent of the TMP_PATH server configuration option.) The default location is the current directory.
- -<sectors> - sector size, <sectors>. (in multiples of 128). The sector parameter is especially useful if you need to adjust a file’s PAGE_SIZE (index node size) to match the FairCom Server. FairCom DB standalone models default to 16 sectors (2048 byte node size) while the FairCom Server defaults to 64 sectors (8192 bytes).
FairCom Server Options (Must be passed before any optional switches)
- <UserID> : client user name to logon to a FairCom Server.
- <UserPassword> : client user password to authenticate to a FairCom Server.
- <ServerName> : FairCom Server name for a client to connect.
Environment Variable to Enable Advanced Encryption
In V11.5 and later, c-tree supports enabling advanced encryption at run time using an environment variable. Set the environment variable CTREE_ADVANCED_ENCRYPTION to YES to enable advanced encryption if it is supported. This environment variable can be used to allow c-tree utilities to enable advanced encryption even if they haven't been updated yet to automatically enable advanced encryption when needed. Examples include the rebuild and compact utilities, ctrbldif and ctcmpcif.
Note: If c-tree does not support advanced encryption and this environment variable is set, the c-tree initialization will fail.
Considerations
- Even without the -x8 option, some extended create block settings such as the huge file, extended header, and 6-byte transaction number options, are always applied to new files.
- This option requires all associated index files that are referenced in the data file's IFIL structure to exist, as the utilities use OpenIFile() to open the data file and all associated index files to read the extended create block values.
- When an application calls the standalone version of the Xtd8 file compact or rebuild functions (for example, CMPIFILX8() or RBLIFILX8()), index files created by the compact or rebuild no longer have the 6-byte transaction number attribute enabled if the specified extended create block's x8mode field has the ctNO6BTRAN bit set.
- A rebuild or compact will fail with the new error code TFLN_ERR (943) when a client library that supports the new rebuild or compact option format attempts to use this feature with a FairCom Server that does not support this new format.
See Also:
Option to set index's automatic segment attributes
If a segmented index file was deleted and rebuilt using the ctrbldif utility or the rebuild API function, the new index file was not segmented. The index file's segment attributes, which are stored in the index file, were lost when the index file was deleted.
Beginning with V10.3, an option is provided with the rebuild and compact utilities that causes index files that are created by the utilities to be created using automatic segments of the specified size and maximum. The option is:
-idxseg=M@S
where M is the maximum number of segments and S is the segment size. S is interpreted as megabytes by default. Two suffixes, MB and GB, are also supported. MB indicates that the value is in megabytes and GB indicates that the value is in gigabytes.
Examples:
50 segments of 10 MB each:
ctrbldif test.dat -idxseg=50@10
100 segments of 300 MB each:
ctrbldif test.dat -idxseg=100@300MB
20 segments of 3 GB each:
ctrbldif test.dat -idxseg=20@3GB
Note: If the index files exist, the -idxseg option has no effect. It is only when the rebuild or compact utility creates new index files because the old index files do not exist that the -idxseg option affects the automatic segment properties of the index files.
-oldsec - Updates in handling of security attributes
In V10.3 and later, the ctrbldif utility assigns data file owner/group/permissions to index files and ctcmpcif assigns original data file owner/group/permissions to compacted data/index files.
The rebuild and compact utilities now read the permission mask, owner, and group settings from the original data file and after the rebuild or compact is completed, the utilities assign these same attributes to the new files.
A command-line option has been added to the utilities to restore the previous security attribute behavior. Use the -oldsec option to cause the rebuild and compact utilities to set the security attributes as they did before this revision. For example:
ctrbldif mark.dat -oldsec ADMIN ADMIN FAIRCOMS
The -oldsec option can be used if rebuild and compact are failing with error 455 (user does not belong to group) if you delete an index then run the rebuild or compact utility on the data file using a user account that does not belong to the group that is assigned to the data file.
Note: These changes only apply to the client and server versions of these utilities. Setting the security attributes is not supported in standalone mode, so the standalone rebuild and compact utilities behave as follows:
1) When the standalone mode rebuild utility creates new index files instead of reusing the new index files (for example if the original index files have been deleted before running the rebuild utility), the new index files are assigned a permission mask of zero (no restrictions on permissions), and the owner and group are unassigned (empty).
2) The standalone mode compact utility always preserves the security attributes of the data file. If the index files do not exist, the newly-created index files are assigned the same values as the standalone rebuild does when it creates new index files.
ctrdmp - Backup Restore or System Rollback
Used to restore backups created with ctdump.
Operational Model:
Standalone
Usage:
ctrdmp [ dumpscript ] [ -x ]
- dumpscript - The name of a valid dynamic dump restore script
- -x - Read dump stream from stdin
A successful ctrdmp completion always writes the following message to CTSTATUS.FCS:
DR: Successful Dump Restore Termination
A failed ctrdmp writes the following message to CTSTATUS.FCS when ctrdmp terminates normally:
DR: Dump Restore Error Termination...: <cterr>
where <cterr> is the error code.
When the -x option is specified, the !DUMP keyword in the dump script is ignored and the dump stream is read from standard input.
This might be combined with the ctdump output redirection to pipeline a backup and restore operation:
ctdump -s FAIRCOMS -u admin -p ADMIN -t test6.dmp -c -x| ctrdmp test6.dmp -x
Note: If an error occurs during the restore phase, no backup exists on disk.
If encrypted files are being restored and input redirection is used, ctrdmp is not able to prompt for the master password during the recovery phase of the restore. In this case, an alternate means of providing the master password is required, such as using the CTREE_MASTER_KEY_FILE environment variable.
If for some reason ctrdmp terminates prematurely (for example, a fatal error causes ctrdmp to terminate abnormally), the “Dump Restore Error Termination...” message might not be written to CTSTATUS.FCS. In that case, ctrdmp might have written error messages to standard output or to CTSTATUS.FCS before terminating that helps explain the reason for ctrdmp terminating prematurely.
Note: A 32-bit ctrdmp could fail with error 75 if run on transaction logs created by a 64-bit FairCom Server, which might support more than 2048 connections.
The ctfdmp, ctldmp, and ctrdmp utilities display the FairCom DB version used to compile them when they are run.
Dump and Restore Version Compatibility
The ctrdmp (ctrdmp - Backup Restore or System Rollback, Backup Restore Utility) utility is used to restore a Dynamic Dump and the ctfdmp utility can be used to roll forward. Occasionally an update to the FairCom Database Engine may cause an incompatibility between versions. For this reason you must use the ctrdmp from the same release from which the dump was created. It is important to save a copy of the ctrdmp utility that is compatible with each dump file.
Restore Recovery Options
The ctrdmp utility now supports the RECOVER_DETAILS and RECOVER_MEMLOG transaction recovery options (the same options that FairCom Server supports).
If you specify !RECOVER_DETAILS YES in your dump restore script, ctrdmp will log progress messages to the file CTSTATUS.FCS as it performs its automatic recovery.
Environment Variable for Advanced Encryption Password
If this utility has advanced encryption enabled, it can read an encrypted password file instead of being prompted to enter the master password. To enable this, set the environment variable CTREE_MASTER_KEY_FILE to the name of the encrypted master password file.
ctrdmp supports options to help analyze recovery behavior. The following options behave like their corresponding server configuration options:
- !DIAGNOSTICS TRAN_RECOVERY logs detailed recovery steps to RECOVERY.FCS.
- !RECOVER_DETAILS YES logs additional recovery progress messages to CTSTATUS.FCS.
See also
- Maintaining Database Integrity in the c-tree Server Administrator's Guide
|
In This Section Rollback to New Restore Points with ctrdmp ctrdmp options to convert path separators to operating system's native path separator |
Rollback to New Restore Points with ctrdmp
In V11 and later, ctrdmp is able to rollback to a Restore Point. Restore Points permit server clients to establish quiet spots in the transaction log where there are no active transactions.
Prior to the V11 modifications, ctrdmp could either perform a dynamic dump recovery or rollback to a specified date and time. ctrdmp has been extended such that, as an alternative to specifying a date and time, the rollback script can provide the name of a Restore Point file.
A typical ctrdmp script file used for a rollback looks like:
!ROLLBACK
!DATE MM/DD/YYYY
!TIME HH:MM:SS
....
Now the script can be composed as follows:
!RP <Restore Point File Name>
....
The Restore Point File Name generated by the server is either of the following:
- RSTPNT_NO_CHK.YYYYMMDD_HHMMSS.FCS for a Lightweight Restore Point
- RSTPNT_CHKPNT.YYYYMMDD_HHMMSS.FCS for a Checkpoint Restore Point
Note that, as with the !ROLLBACK script keyword, the !RP keyword must be the first entry in the script file.
See also
- ctrdmp - Dynamic Dump Recovery or System Rollback (ctrdmp - Backup Restore or System Rollback, Backup Restore Utility)
- ctfdmp - Forward Dump Utility
ctrdmp options to convert path separators to operating system's native path separator
The dynamic dump restore utility, ctrdmp, supports options for converting path separators to the operating system's native path separator. These options are useful when restoring a dynamic dump that was created on an operating system that uses a different path separator. For example, using ctrdmp on a Linux system to restore a dynamic dump that was created on a Windows system.
!CONVERT_PATHSEP
The dynamic dump restore script option !CONVERT_PATHSEP instructs ctrdmp to convert path separators to the native path separator. ctrdmp applies this conversion to:
- filenames read from the dump stream file
- filenames read from transaction logs that are included in the dynamic dump
- data and index filenames in IFIL resources of all data files restored by ctrdmp
Note: If the file name begins with a drive letter (for example, C:) or a UNC reference (for example, \\machinename\sharename), it is not changed. In these cases, we recommend using the !REDIRECT option in the dynamic dump restore script to replace these references with the desired target directory names.
The dynamic dump restore script option !REDIRECT_IFIL instructs ctrdmp to apply the !REDIRECT rules that are specified in the dump restore script to the data and index filenames in the IFIL resources of the data files restored by ctrdmp.
An alternative to the !REDIRECT_IFIL option is to run the ctredirect utility after ctrdmp completes.
Example
As an example, consider a backup made on a Windows system of the c-tree data and index files accounts.dat and accounts.idx that are stored in the directory E:\mydata. In this example, the data file name in the IFIL resource is E:\mydata\accounts.
Here is an example dynamic dump backup script:
!DUMP backup.fcd
!FILES
E:\mydata\accounts.*
!END
Below is an example dynamic dump restore script to run on a Unix system that uses a !REDIRECT option to redirect E:\mydata to myrestoredir, which is a subdirectory in the directory where ctrdmp is being run. it uses the !REDIRECT_IFIL option to update the IFIL resource in accounts.dat based on the redirect rule:
!DUMP backup.fcd
!REDIRECT E:\mydata myrestoredir
!REDIRECT_IFIL
!CONVERT_PATHSEP
!FILES
E:\mydata\accounts.*
!END
In this example, accounts.dat and accounts.idx are restored to the myrestoredir directory, and then the data file name E:\mydata\accounts in accounts.dat is changed to myrestoredir/accounts. If the !REDIRECT_IFIL option had not been used, only the path separators would have been changed, so the data file name in the IFIL resource would have been changed to E:/mydata/accounts.
Limitations: The byte ordering of the two systems must be the same so that ctrdmp can restore the dump.
ctsbld - Superfile rebuild pre-pass
The FairCom DB Superfile Recover Utility reconstructs data file members in place and empties index file members. Index file members must be rebuilt via RBLIFIL() or ctindx.
Operational Model:
- Standalone
Usage:
ctsbld <superfile name>
Description
ctsbld processes the superfile in place. This utility “cleans” the data files and empties the index files. This utility may also be incorporated into your application using the function SuperfilePrepassXtd(). Afterward, the superfile must be processed by the RebuildIFile() function before it is usable. This utility is only operational in single-user mode. The SuperfilePrepassXtd() function is available in single-user and client/server models.
ctsbldm - Rebuild Superfile Index Members
Operational Model:
- Standalone
Usage:
ctsbldm <DataFileName> [<Optional PageSize>]
For example:
ctsbldm suphost!myfile.dat 16384
Description
Ordinarily, the procedure to rebuild a superfile is to use ctsbld to prepare the entire superfile, making the data good and returning space used by the indexes. Then each set of ISAM files is rebuilt. This approach is used since a superfile entwines all of the member files and no assumptions are made about the integrity of the members.
ctsbldm permits the indexes associated with a non-corrupt superfile member data file to be rebuilt without having to process the entire superfile. It assumes that the data file contains an IFIL describing all the indexes, that the data file is not corrupt, and that the superfile is in good shape except for the indexes in question.
One possible use for this utility is when recovery cannot repair an index. This rarely occurs, but may be caused by a loop in the index leaf nodes. If this index is a member of a superfile, we can now attempt to rebuild just the indexes, and not process the entire superfile. The utility forces all indexes associated with the data file to be rebuilt.
The utility operates by opening the data and index files, deleting the index files, and then rebuilding the index files.
ctscmp - Superfile Compact Utility
Operational Model:
- Standalone
Usage:
ctscmp <filename> [Options] [Y] [new_sect_size]
Arguments
- <filename>: The name of the superfile to compact or scan.
- Options:
- -resetdistinct: Reset distinct key count attribute in IIDX ikeydup fields.
- -scanonly: Scan the superfile only; do not compact it. No new superfile will be created. The -scanonly option generates details from the header, extended header, IFIL, and DODA. It outputs the number of key values, active records, deleted records and resource records. Using this utility with the -scanonly option is useful for comparing superfiles before and after compacting them.
- -aes32: Enable AES encryption with 32 byte key.
- -aes24: Enable AES encryption with 24 byte key.
- -aes16: Enable AES encryption with 16 byte key.
- -cleartext: Disable file encryption.
- -v11: Allows compatability with V11.
- Y: An optional parameter; if specified, the utility compacts the file without prompting to confirm (otherwise you will be prompted).
- <new_sect_size>: An optional sector size of the resulting file (sect*128 = page size) to use for the new superfile. If omitted, the new superfile is created using the same page size as the original superfile.
Description
The superfile compact utility, ctscmp, compacts and rebuilds a superfile and all its members provided the required IFIL resources are present in the superfile data members. It creates a compacted version of the file in place, using a temporary file named CTREE.TMP as a destination and then renaming it.
Use cases for this functionality include eliminating wasted disk space, changing page size or encryption attributes, or repairing problems with an index.
The utility is designed for the Standalone single-user model. It supports processing data and index member names with extensions other than .dat and .idx.
A “% complete” progress indicator has been added to the ctscmp utility.
The ctscmp utility uses a standard error and warning message format. Error messages begin with the text ‘Error:’ and warning messages with the text ‘Warning:’, so errors and warnings can easily be located in the ctscmp output.
The default ctscmp behavior is to preserve existing encryption settings. Options to enable or disable encryption have been added. Working with AES encrypted files requires the correct master password and a master password verification file "ctsrvr.pvf". See Master Password Verification Options.
There is an ISAM-based version of the superfile compact utility named ctscmpi. This version uses ISAM c-tree functions rather than low-level c-tree functions to add records to the new compacted superfile. The advantage of the ISAM approach is that records are indexed as they are added, so the utility does not require a separate rebuild phase to repopulate the indexes as the ctscmp utility does. Using this technique can significantly reduce the time required to compact a superfile.
The ctscmp utility returns a non-zero value when it fails. This can be useful for a script that calls the utility to be able to detect when it fails.
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.
ctsqlmgr - Migration Utility
The ctsqlmgr utility is used for migrating tables. This utility physically relocates data files for use with FairCom DB SQL.
It is important to note the migrated new tables could very well not be accessible with your existing ISAM application. If you have requirements to share data between existing ISAM applications and FairCom DB SQL you should consider using the FairCom DB SQL Import Utility.
Operational Model:
- Standalone
Usage:
ctsqlmgr <original file> <destination file> [-s <sect>] [-m <memory KB>]
- -s - The number of sectors.
- -m - The amount of memory (in KB) to use during the rebuild process (50Mb default).
See Also
- Migrating to FairCom DB SQL in the SQL Server Operations and Utilities Guide