ctclosefile - Close Open Memory and ctKEEPOPEN files
It is easy to create memory files or set persisted files in a ctKEEPOPEN state. However, those files need to be closed at times and we do not have a utility to do so, only the CloseCtFileByName() API. This revision adds a simple utility, ctclosefile, allowing this functionality in a scripted environment.
ctclosefile will close a specified FairCom DB memory file or any file held open with a ctKEEPOPEN directive.
ctclosefile [-u user] [-p password] [-s server][-f filename] [-w file password ] {-a authfile}Parameters:
-u - User ID
-p - User Password
-s - Server (default: FAIRCOMS@localhost)
-f - File name
-w - File password
-a - Authentication file name
ctclntrn and cthghtrn - Manage Transaction Mark Numbers
The following utilities are provided in FairCom RTG/ISAM:
- ctclntrn - “Cleans” the high-water transactions marks within a FairCom DB index.
- cthghtrn - Displays the high-water transaction marks within an index file. This utility would typically be used when the FairCom Server transaction mark number gets too large
These utilities appear in the tools\cmdline folder.
For complete descriptions of these utilities, see the Command-Line Tools book on the FairCom website.
ctcmpcif - IFIL-based Compact Utility Included
The ctcmpcif utility has been added to the command-line utilities. 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 0x0010These 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.fkf2: set environment variable to the name of the master key file:
CTREE_MASTER_KEY_FILE=mykey.fkfIf 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
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:
ctfixdupscan - Detect and Fix Files that Suffer from File Definition Errors
New functionality has been added to the ctutil command line utility to detect and fix files that suffer from file definition errors that can cause the dupscan workaround to not function properly. To trigger this new functionality, rename a copy of the ctutil executable to ctfixdupscan. Executing this renamed copy of ctutil will cause it to function as an ad-hoc utility to detect and fix file definition errors. The syntax of the command-line tool is as follows:
ctfixdupscan file [-fix]where:
- file - File name without extension
- -fix - Fix error by copying the file in place
By default, the program checks if the specified file suffers from file definition errors. If the optional -fix parameter is specified after the file name, the file is fixed by copying it in place record-by-record.
ctmigra - Conversion Utility
Convert C-ISAM or Btrieve tables to FairCom RTG/ISAM.
Usage of FairCom RTG/ISAM ctmigra depends on your native data file types and your platform.
Usage
ctmigra ISAM|extfh [OPTIONS] SOURCE DESTwhere:
- SOURCE - name of the file to be copied.
- DEST - name of the file to which it will be copied.
Options for FairCom RTG/ISAM Files
- -n SERVERNAME or --dest-server=SERVERNAME where SERVERNAME is the name of the destination FairCom DB Server
- -u USERID or --dest-user=USERID where USERID is the user name of the destination FairCom DB Server
- -p PASSWORD or --dest-password=PASSWORD where PASSWORD is the user password of the destination FairCom DB Server
- -I STRING or --dest-idx-suffix=STRING where STRING is the suffix of destination index file name
- -N SERVERNAME or --source-server=SERVERNAME where SERVERNAME is the name of the source FairCom DB Server
- -U USERID or --source-user=USERID where USERID is the user name of the source FairCom DB Server
- -P PASSWORD or --source-password=PASSWORD where PASSWORD is the user password of the source FairCom DB Server
- -i STRING or --source-idx-suffix=STRING where STRING is the suffix of source index file name
- -l FILE or --log=FILE where FILE is the name of the file to log additional information. To redirect log to stderr use ‑ as FILE
- -b RECORDS or --batch-size=RECORDS where RECORDS is the number of records to read / write in batches
- -a (--append-ext) appends index extension instead of replacing data extension.
- -o OWNER (--owner=OWNER) specifies the ISAM file owner (can be used if you encountered an error 51 when attempting to migrate).
- -r (--replace) instructs ctmigra to replace the existing destination file (V11 and later).
- -e, --encrypt=CIPHER - Encrypt destination file with CIPHER algorithm.
- -z, --datacompress=TYPE[;LEV][;STR] - Compress destination data file with TYPE algorithm.
- -t, --transaction=no|yes|logging - Create destination data file with or without transaction support.
The last three options enable the following configuration options on the destination file (corresponding to -e, -z, and -t respectively):
<encrypt type="CIPHER">
<datacompress type="TYPE"= level="LEV" strategy="STR">
<transaction logging="no|yes">
See usage examples in the next topics. Notice that the Micro Focus COBOL Migration Example can be useful for Btrieve users.
External Library Configuration for Native File Access
For certain data types, such as ISAM, original external libraries are required to access native data formats.
- -s LIBRARY!FUNCTION or --source-lib=LIBRARY!FUNCTION where LIBRARY is the external dynamically loadable library and FUNCTION is the interface entry-point function to handle the source file
- -d LIBRARY!FUNCTION or --dest-lib=LIBRARY!FUNCTION where LIBRARY is the external dynamically loadable library and FUNCTION is the interface entry-point function to handle the destination file
Note: Current usage options are always available when no command-line options are supplied.
Examples
If you are using FairCom RTG COBOL:
ctmigra.exe extfh -s MFFH.DLL -n FAIRCOMS@localhost -r C:\mydata\abc-ISAM.dat abc-ctree.datIf you are using FairCom DB ISAM:
ctmigra.exe ISAM -s wISAM32.dll -n FAIRCOMS@localhost -r C:\mydata\abc-ISAM.dat abc-ctree.datFor more examples, see Micro Focus COBOL Migration Example.
ctmigra --quiet and --verbose options to select output information
These options for the ctmigra command-line utility suppress all output (--quiet or -q) or select the information to be sent to stdout (--verbose=LEVEL or -v). The --verbose parameter is a bitmask which can combine the following values:
1 - show message about final result
2 - show percentage progress
4 - show time spent in migration phases (read, write, finalize)
For example, to display everything, use --verbose=7, which is 1+2+4. If not specified, the --verbose level is 3 (1+2).
The --quiet option is identical to --verbose=0.
Alternative Usage
Most of the information you need for migration can be entered using the command-line parameters listed above. If you have additional considerations that require a more complex configuration, such as files that need special treatment, multiple clients or servers, etc., you can create a local configuration file (ctree.conf) for use during migration. (It can be edited as described in Editing a Configuration File.)
Note: The recommended best practice is to run ctmigra using the parameters listed above. If you must use the "alternative" approach described in this section, use the bulkaddition option in ctree.conf, which will greatly improve performance and it will optimize the index.
To use ctmigra with a local FairCom RTG/ISAM configuration file, use the following command:
ctmigra ISAM|extfh -c CONFIG_FILE SOURCE DESTwhere:
- SOURCE - name of the file to be copied
- DEST - name of the file to which it will be copied
- -c CONFIG_FILE or --config=CONFIG_FILE where CONFIG_FILE is a valid FairCom RTG/ISAM configuration file.
Be sure to include the bulkaddition option in ctree.conf.
Potential Errors and Troubleshooting
| ISAM Error: -7 | Your native source library is likely not available. Check the path to your native data file handling library and be sure it is specified with the --source-lib= option. |
| ISAM Error: 53 |
Attempted to open a non-ISAM file via a ISAM interface. This can possibly happen when you load a 32-bit ISAM DLL with a 64-bit version of the tool, or vice versa. |
In FairCom RTG V2, error messages displayed by the ctmigra utility have been enhanced as follows:
- It now displays actual file names instead of $SOURCE$ and $DEST$.
- It now displays an error message if the source or destination c-tree Servers are not running (c-tree error 133).
- It now displays an error message if the user/password is not correct (c-tree error 450/451) or GUEST logon is disabled (c-tree error 470).
- It now displays an error message if c-tree Server is not valid due to OEM version incompatibility (c-tree error 530).
- It now displays an error message if the specified external library cannot be loaded.
Behavior Change: This modification changes the behavior of the ctmigra tool.
Standalone Support for ctmigra
FairCom RTG supports the FairCom Standalone operational model for specific use cases. This differs from the default client/server model by not using the FairCom RTG Database Server (faircom.exe, or ctreesql.exe in versions prior to V3). By not going through the FairCom RTG Database Server, the database I/O can at times be faster, typically when there is only a single instance performing database I/O. If you are using multiple versions of ctmigra to migrate several files at the same time, then we don’t recommend using the Standalone model.
ctmigra --local=LIBRARY Option
The new ctmigra option --local=LIBRARY allows setting the FairCom RTG Standalone library where library is a FairCom RTG Standalone library.
The --local switch instructs ctmigra to work in the Standalone operational model. When this switch is set, the following switches are all disabled:
-n (or -N) used for specifying the FairCom RTG Server name
-u (or -U) for specifying the user ID
-p (or -P) used for specifying the user ID password
ctmigra --local-sect Option
This modification introduces a new option in ctmigra to set the number of node sectors when using the option --local. The new option is --local-sect=SECT where SECT is the number of node sectors to use in the <localinstance sect> attribute of the ctmigra auto-generated FairCom RTG configuration file.
The option --local-sect is indicated when the file migrated by the local engine (ctmigra option --local) will be open by a c-tree Server configured with a PAGE_SIZE set to a higher value then the default 8192 (8KB).
If --local-sect is not specified, the default value of <localinstance sect> is used, which is 64 resulting in a node of 8192 bytes (64 * 128 bytes) matching the default PAGE_SIZE of the c-tree Server.
If, for example, the c-tree Server has a PAGE_SIZE of 32768, the ctmigra --local command should also include --local-sect=256 so the local engine will create files that can be open by c-tree Server.
When this option is set, the following are all disabled:
- -n (or -N) used for specifying the FairCom RTG Server name
- -u (or -U) for specifying the user ID
- -p (or -P) used for specifying the user ID password
The option --local-sect=SECT where SECT is the number of node sectors can be used to specify the node size used to create the c-tree file.
The number of node sectors to use when performing data migration is important to ensure the data file created during the ctmigra process are of the same PAGE_SIZE being used by the FairCom RTG Server. The SECT setting provides a dynamic method for setting the matching FairCom RTG Server PAGE_SIZE setting. Note this equation: SECT*128 bytes = PAGE_SIZE. The default PAGE_SIZE for FairCom RTG V3 is now 32,768, therefore the default SECT value is 256. Here are SECT values for setting the more common PAGE_SIZE settings:
| SECT | PAGE_SIZE | |
|---|---|---|
| 64 | 8192 | Default FairCom RTG < V3 |
| 128 | 16384 | |
| 256 | 32768 | Default FairCom RTG V3 |
| 512 | 65536 |
If --local-sect is not specified, the default value of <localinstance sect> is used, which is 256 for V3, and 64 for FairCom RTG versions prior to V3.
If, for example, the c-tree Server has a PAGE_SIZE of 16384, the ctmigra --local command should also include --local-sect=128 so the local engine will create files that can be opened by c-tree Server.
The attributes bufs and dbufs allow setting c-tree standalone index and data number of cache buffers respectively. The maximum acceptable value is 32,767.
The sect attributes set the table node size (which should match the server PAGE_SIZE). The maximum is 512.
ctstat - Statistics Utility
The FairCom DB Server Statistics Utility, ctstat, is a client utility used to display statistics collected by the FairCom DB Server. ctstat, provides valuable real time monitoring of critical FairCom DB Server operations.
Usage
# ctstat report_type [-s svn] [-u uid] [-p upw]
[-i int [cnt]] [-h frq] [-d] [-m] [-t] [-mu]Reports:
| -vas | Admin-System Report |
| -vts | Tivoli-System Report |
| -vaf file... | Admin-File Report |
| -vtf file... | Tivoli-File Report |
| -vau user... | Admin-User Report by User Name |
| -vau handle... | Admin-User Report by User Handle |
| -vah handle... | Admin-User Report by Connection Handle |
| -func | Function Timing Report |
| -funcfile | Function Timing By File Report |
| -userinfo | User Report with stats from USERINFO() function |
| -isam | ISAM Activity Report |
| -sql | SQL Activity Report |
| -text | System Activity Report, Write System Snapshot to SNAPSHOT.FCS |
| -file [csv] | File Activity Report |
| -iotime on | off | Turn disk I/O call timing on or off |
| -wrktime on | off [reset] | Turn function call timing on or off; reset allows function-timing statistics to be reset |
The following memory statistics options require the use of the DIAGNOSTICS MEMTRACK keyword AFAF:
| -mf logfile | Log all memory allocations to the specified file |
| -ma logfile | Log aggregate memory allocations to the specified file |
| -mr min,max | Log only memory allocations in the range min,max |
| -ms | Output memory allocation statistics |
| -mu | Unload module debug symbols |
Options:
| -s svn | FairCom DB Server name |
| -u uid | User name |
| -p upw | User password |
| -i int [cnt] | Pause int seconds for optional cnt times |
| -h frq | Print a description header every frq outputs |
| -d | Show cache stats as delta |
| -m |
Show memory file stats when using -vaf report. The following additional statistics are output:
|
| -t | Output timestamp with header. |
| -mu |
Unload the module debug symbols (can be used if FairCom Support needs you to unload debug symbols, e.g., if the initial load of the symbols failed). Due to performance considerations, do not use debug symbols on a production system unless instructed by FairCom Support. |
cttrnmod - Change Transaction Mode Utility
cttrnmod allows an advanced user to change the transaction status of a FairCom DB data file and its associated index files. The utility can also be used to display the transaction status of a c-tree data file and its associated indexes.
It is expected only advanced database administrators will run this utility.
Operational Model:
- Client
Usage
cttrnmod (set <tranmode>|get) (-d <database>|-f <filelist>)
[-u <userid>] [-p <password>] [-s <servername>] [-n <sect>]Where
-
set <tranmode> - Set the transaction mode to one of the following:
- T - Full Transaction Control
- P - Partial Transaction Control (No Recoverability)
-
N - No Transaction Control (No Recoverability)
- repl=on - Enable replication (requires full transaction control)
- repl=off - Disable replication
- The following extended header attributes may also be set:
- {+,-}R - {Enable,Disable} Restorable deletes
- {+,-}C - {Enable,Disable} Transaction controlled deletes
- {+,-}A - {Enable,Disable} Auto transaction switching
- get - Display the current transaction mode
-
-d or -f - Operate on all files in the database or all listed files:
- -d <database> - Operate on all files in the c-tree database <database>
- -f <filename> - Operate on all files listed in the file <filelist>
- -u <userid> - Specify c-tree user ID
- -p <password> - Specify c-tree user password
- -s <servername> - Specify FairCom Server name to connect to. Default: FAIRCOMS
- -n <sect> - Specify node sector size. Default: 64 (PAGE_SIZE=8192)
The files to change are specified by either the -d <database> option or the -f <filelist> option. The -d <database> option specifies the name of a c-tree database -- when this option is specified, the utility operates on all files referenced in that database (excluding SQL system data and index files). The -f <filelist> option specifies the name of a text file containing names of c-tree data files, one per line -- when this option is specified, the utility operates on all files specified in that text file.
Note: Indexes created with ctPREIMG or ctTRNLOG are physically structured differently than indexes that do not support transactions. Thus a non-tran index cannot be converted to transaction control, and must be rebuilt after the conversion. If an index file is created ctPREIMG or ctTRNLOG, it can be accessed in all transaction and non-transaction access modes.
Important Performance Considerations
When turning transaction processing off for a file, it is possible to take an even larger performance hit under specific FairCom Server configurations. Be sure to remove or comment out the line COMPATIBILITY FORCE_WRITETHRU from your FairCom Server configuration file ctsrvr.cfg. While this option provides only the safest of data integrity for your non-transaction processing controlled files, it forces an enormous performance penalty for doing so. This keyword has historically been included by default with most FairCom Server installations.
Examples
The following example demonstrates turning off transaction control for all c-tree data files and their associated index files in the rdsdb database:
# cttrnmod set N -d rdsdb
Setting transaction mode to NON_TRAN for files in database rdsdb...
Tranmode Filemode Filename
-------- -------- --------
NON-TRAN 0x0000 .\rdsdb.dbs\admin_deptbl.dat
NON-TRAN 0x0000 .\rdsdb.dbs\admin_deptbl.idx
NON-TRAN 0x0000 .\rdsdb.dbs\admin_dept_multi_ndx.idx
NON-TRAN 0x0000 .\rdsdb.dbs\admin_dept_ndx.idx
NON-TRAN 0x0000 .\rdsdb.dbs\admin_emptbl.dat
NON-TRAN 0x0000 .\rdsdb.dbs\admin_emptbl.idx
NON-TRAN 0x0000 .\rdsdb.dbs\admin_emp_no_ndx.idx
NON-TRAN 0x0000 .\rdsdb.dbs\admin_emptbl1.dat
NON-TRAN 0x0000 .\rdsdb.dbs\admin_emptbl1.idx
NON-TRAN 0x0000 .\rdsdb.dbs\admin_emp_no_ndx1.idx
VERIFYING No Transaction Control...
VERIFY succeeded
3 Data Files Updated
0 Errors
The following example demonstrates reading the transaction status of the data and index files in the rdsdb database:
# cttrnmod get -d rdsdb
Reading transaction mode for files in database rdsdb...
Tranmode Filemode Filename
-------- -------- --------
ctTRNLOG 0x0031 .\rdsdb.dbs\admin_deptbl.dat
ctTRNLOG 0x0031 .\rdsdb.dbs\admin_deptbl.idx
ctTRNLOG 0x0031 .\rdsdb.dbs\admin_dept_multi_ndx.idx
ctTRNLOG 0x0031 .\rdsdb.dbs\admin_dept_ndx.idx
ctTRNLOG 0x0031 .\rdsdb.dbs\admin_emptbl.dat
ctTRNLOG 0x0031 .\rdsdb.dbs\admin_emptbl.idx
ctTRNLOG 0x0031 .\rdsdb.dbs\admin_emp_no_ndx.idx
ctTRNLOG 0x0031 .\rdsdb.dbs\admin_emptbl1.dat
ctTRNLOG 0x0031 .\rdsdb.dbs\admin_emptbl1.idx
ctTRNLOG 0x0031 .\rdsdb.dbs\admin_emp_no_ndx1.idx
ctTRANMODE Control (FairCom Database Engine V11 and later)
When using the Transaction Control utility, cttrnmod, to disable transaction support on a file with extended file mode ctTRANMODE, the utility could report that after successfully disabling ctTRNLOG, the file still has ctTRNLOG set. This is expected for a file with the ctTRANMODE bit set when using a TRANPROC c-tree application.
cttrnmod has been updated to disable ctTRANMODE and ctPIMGMODE bits when it sets a file to no-transaction support. It was also modified to support explicitly enabling or disabling one of these bits (depending on the file mode that is in effect at the time).
Replication
New replication actions have been added to the cttrnmod utility for flexible control of replication attributes.
- cttrnmod now displays replication state for a data file
- cttrnmod can change a file's replication state with the repl option
Note: Replication requires that the data file has a unique index and that the data and index files are using full (ctTRNLOG) transaction control.
Examples
- Enable full transaction logging on files:
# cttrnmod set T -f files.txt -u ADMIN -p ADMIN -s FAIRCOMS
Setting transaction mode to ctTRNLOG for files listed in file files.txt...
Replicate Tranmode Filemode Filename
--------- -------- -------- --------
NO ctTRNLOG 0x0032 ctreeSQL.dbs\admin_t.dat
ctTRNLOG 0x0032 ctreeSQL.dbs\admin_t.idx
ctTRNLOG 0x0032 ctreeSQL.dbs\admin_t_ti.idx
Note the "Replicate" column for current replication state information.
- Enable replication on files:
# cttrnmod set repl=on -f files.txt -u ADMIN -p ADMIN -s FAIRCOMS
Enabling replication for files listed in file files.txt...
Replicate Tranmode Filemode Filename
--------- -------- -------- --------
YES ctTRNLOG 0x0032 ctreeSQL.dbs\admin_t.dat
ctTRNLOG 0x8032 ctreeSQL.dbs\admin_t.idx
ctTRNLOG 0x8032 ctreeSQL.dbs\admin_t_ti.idx
Note: If cttrnmod is used to disable full transaction logging for a file, it also disables replication for that file.
ct_tpc and cttpca TPC A Test
ct_tpc
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. (The version included with FairCom RTG/ISAM supports that 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 cttpca for a C code version.
cttpca
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. (The version included with FairCom RTG/ISAM supports that 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.
startserver and stopserver Scripts
Scripts have been added to the FairCom RTG product to start and stop the server. These scripts, startserver, and stopserver, are equivalent to the FairCom DB scripts Unix sh (shell) scripts named startace and stopace.
Additional FairCom RTG/ISAM Command-Line Tools
These command-line tools are available in FairCom RTG/ISAM V3:
- ctidmp - Lists the contents of a dynamic dump file or a specific extent of a dump broken into multiple files.
- ctpass - Allows users to change their password.
- ctsysm - Monitors error, warning, and informational messages logged to the server status log, CTSTATUS.FCS. Allows monitoring by an automated external process, such as the Tivoli monitoring system from IBM.
- cttrap - Plays back a TRAP_COMM log file.
- ctclntrn - “Cleans” the high-water transactions marks within a FairCom DB index.
- cthghtrn - Displays the high-water transaction marks within an index file. This utility would typically be used when the FairCom Server transaction mark number gets too large.
- The ctinfo utility is now included in the FairCom RTG package. This utility retrieves IFIL and DODA structures from a FairCom DB file (and other header information).
For detailed information, see the Command-Line Tools guide on the FairCom website.