Reference Guide
Contents
1. FairCom Command-Line Tools ... 1
1.1 File Locations ... 1
2. Administrative Utilities - Client ... 2
2.1 ctadmn - Server Administrator Utility ... 2
2.2 ctcmpcif - IFIL-based Compact Utility ... 2
Updates in handling of security attributes ... 3
2.3 ctdbpartidxent - Utility to Enable GUIx Key Count Optimization ... 4
2.4 ctdump - Dynamic Dump Utility ... 5
Scripting a Dynamic Dump ... 6
2.5 ctfilbkif - File Block Utility ... 7
2.6 ctfileid - Update File IDs ... 9
2.7 ctpass - Password Utility ... 9
2.8 ctpathmigr - Change Internal Path Separators ... 10
2.9 ctquiet - Quiesce c-treeACE Utility ... 10
2.10 ctrbldif - IFIL-based Rebuild Utility... 11
Option to set index's automatic segment attributes ... 12
Updates in handling of security attributes ... 13
2.11 ctsqlcdb - c-treeACE SQL Database Maintenance Utility ... 14
2.12 ctsqlimp - SQL Import Utility ... 14
2.13 ctsqlutl - c-treeSQL Maintenance Utility ... 16
2.14 ctstat - Statistics Monitoring Utility ... 16
2.15 ctstop - Server Stop Utility ... 18
2.16 ctsysm - Server Status Monitoring Utility ... 19
2.17 cttrap - Communications Trap Playback utility ... 20
2.18 cttrap - TRAP_COMM Utility... 21
2.19 cttrnmod - Change Transaction Mode Utility ... 23
2.20 dbdump - Data Unload Utility ... 26
2.21 dbload - Data Load Utility ... 27
2.22 dbschema - Schema Export Utility ... 29
2.23 ISQL ... 30
2.24 sa_admin - Command-line security administration utility ... 31
ADMINISTRATOR OPTIONS ... 32
USER OPTIONS ... 32
GROUP OPTIONS ... 34
FILE OPTIONS ... 35
3.1 ctcfgset - Server Configuration File Encoding Utility ... 37
3.2 ctcmdset - Configuration File Encoding Utility ... 38
3.3 ctcpvf - Master Password Verification File Utility ... 38
3.4 ctfchk - File Checksum Utility ... 39
3.5 cthghtrn - Displays the high-water mark for transactions ... 40
3.6 ctredirect - IFIL Update Utility for Redirected Filenames ... 40
3.7 cttrnmod - Change Transaction Mode Utility ... 42
4. Utilities - Client ... 46
4.1 ctinfo - ISAM File Info ... 46
4.2 ctixmg - Incremental ISAM / Resource sample ... 47
4.3 ctsfex - Superfile Data Export Utility ... 47
4.4 ctvlqa - Variable-length quality assurance utility ... 48
4.5 ISQL ... 49
5. Utilities - Low Level ... 50
5.1 ctalgn - Change Alignment ... 50
5.2 CTCMPC - File compaction ... 50
5.3 ctcnfg - System Configuration Example ... 51
5.4 CTCV43 - Convert V4.3 Data File to c-tree Format ... 51
5.5 ctcv67 - Extended File Conversion Utility ... 51
5.6 ctdidx - Create flat key file ... 54
5.7 ctdmpidx - Index Dump Utility ... 54
5.8 ctflat - Create c-treeACE file from a flat file ... 55
5.9 ctflvrfy - Index Verify Utility ... 56
5.10 ctindx - Create index file from flat key file ... 58
5.11 ctpkey - Print key utility ... 59
5.12 ctpotp - Parameter to OTP conversion ... 59
5.13 ctptoi - Parameter to IFIL conversion ... 59
5.14 ctrbld - Parameter file rebuild utility ... 60
5.15 ctsfil - Superfile contents ... 60
5.16 ctunf1 - File Reformatting Utility ... 60
5.17 ctupdpad - Update the c-treeDB Pad Resource Utility ... 62
5.18 ctvfyidx - Index Verify Utility... 62
5.19 ctvfyfil - File Verify Utility... 63
6. Utilities - Standalone ... 64
6.1 ct_ver - Display c-treeACE version that created file ... 64
6.2 ctchkbin - Checking for affected tables ... 64
6.3 ctclntrn Utility - Clean Transaction Mark ... 65
Updates in handling of security attributes ... 69
6.5 ctencrypt - Utility to Change Master Password ... 69
6.6 ctfdmp - Forward Dump Utility ... 71
6.7 ctfileid - Update File IDs ... 73
6.8 ctfixbin - Fixing Affected Tables... 73
6.9 ctidmp - Examine Dump Files... 73
6.10 ctinfo - ISAM File Info ... 74
6.11 ctldmp - Transaction Log Dump ... 74
6.12 ctrbldif - IFIL-based Rebuild Utility... 75
Option to set index's automatic segment attributes ... 76
Updates in handling of security attributes ... 76
6.13 ctrdmp - Dynamic Dump Recovery or System Rollback ... 77
6.14 ctsbld - Superfile rebuild pre-pass ... 78
6.15 ctsbldm - Rebuild Superfile Index Members ... 78
6.16 ctscmp - Superfile Compact Utility... 79
6.17 ctsfex - Superfile Data Export Utility ... 80
6.18 ctsqlmgr - Migration Utility ... 80
7. Utilities to Dump and Deploy SP, UDF & Triggers ... 82
7.1 dbschema – Option to dump SP, UDF, and triggers ... 82
7.2 dbdeploy – Utility to deploy SP, UDF, and triggers ... 82
7.3 Password Security ... 83
7.4 Requirements to Develop and Deploy (JDK, JRE) ... 83
8. Index ... 85
1. FairCom Command-Line Tools
The FairCom products ship with a wealth of utilities for developers
and administrators. This book documents the command-line tools
that are available with your product.
1.1
File Locations
The command-line tools are provided in the following folders:
All tools:
All command-line tools: All administrative tools:
Client-side administrative tools Administrative Utilities - Client (page 2) Standalone administrative tools Administrative Utilities - Standalone (page 37) All other utilities:
Client-side utilities Utilities - Client (page 46) Low-level utilities Utilities - Low Level (page 50) Standalone utilities Utilities - Standalone (page 64)
Note: The exact set of tools and utilities and their directory structure depends on the FairCom product you have installed.
2. Administrative Utilities - Client
These utilities are intended for administrators. They are run from the client-side. They are located in the following folder:
All tools:
All command-line tools: All administrative tools:
Client-side administrative tools tools\cmdline\admin\client Standalone administrative tools
All other utilities: Client-side utilities Low-level utilities Standalone utilities
Note: The exact set of tools and utilities and their directory structure depends on the FairCom product you have installed.
2.1
ctadmn - Server Administrator Utility
ctadmn [<AdminId> <AdminPassword> [ <filepassword> [ <ServerName> ]]]]
Used by the Server Administrator to manage users, groups, and files.
See Also
Administrator Utilities > c-treeACE Server Administrator Utility
(http://docs.faircom.com/doc/ctserver/8286.htm) in the c-tree Server Administrators Guide
2.2
ctcmpcif - IFIL-based Compact Utility
New Standalone Usage
# ctcmpcif DataFileName [-purge] [-updifil] [-temppath=<temporary_path>] [-<sectors>]
where:
-purge - purge duplicate records.
-updifil - update IFIL resources in the data file.
-temppath=<temporary_path> - the temporary file directory. The default is the current directory.
-<sectors> - the sector size to use. The sector parameter is especially useful if you need to adjust a file’s PAGE_SIZE to match the c-treeACE Server.
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 indices. 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.
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.
Updates in handling of security attributes
In V10.3 and later, the ctrbldif utility now 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. It is desirable for the newly rebuilt or compacted files to preserve the original security attributes as much as possible and the index file security attributes should match the data file security attributes.
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.
2.3
ctdbpartidxent - Utility to Enable GUIx Key Count
Optimization
Enhancements to partitioned file query efficiency required changes to certain header bits of the files. While these are default with newly created tables, existing tables with partitioned files will need to have this bit enabled to take advantage of the new optimizations.
A command-line utility that can be used to enable the partition file global unique index (GUIx) key count optimization for partitioned files. The usage is as follows:
usage: ctdbpartidxent -u <username> -p <password> -s <servername> -m on|off -d <dbname> -t <tblname>
Options
-u <username> User name
-p <password> User password
-s <servername> c-tree Server name
-m on|off Enable or disable the partition file GUIx key count optimization (default=on)
-d <dbname> Database name (default=update all databases)
-t <tblname> Table name (default=update all tables)
Example
Enables optimization for all tables in the ctreeSQL database on server FAIRCOMS:
ctdbpartidxent -u ADMIN -p ADMIN -s FAIRCOMS -d ctreeSQL
The ctinfo utility has also been updated to display the file definition bits. To check if the GUIx key count optimization is enabled, look for the DEF_MARK_PRTENT bit to be set, as shown below:
File Definition Mask Details
Note:ctdbpartidxent also attempts to rename partition files to ensure they are properly named should a rebuild be required.
2.4
ctdump - Dynamic Dump Utility
The user may pass a User ID, Password, Dump Script name, and Server Name to a ctdump
utility, which schedules a dynamic dump. The syntax is as follows:
ctdump [adminuser adminpass] dumpscript [servername] adminuser: ADMIN group User ID
adminpass: Administrator password
dumpscript: Name of the dynamic dump script file on the server system. A path relative to the server system may be included.
servername: Optional server name.
For new options added in c-treeACE V11, see V11 Dynamic dump enhancements (page 6). The following demonstrates example usage of this utility:
ctdump ADMIN ADMIN thescript FAIRCOMS
The following error codes are related to dynamic dump operations:
Error Name Error Code Explanation
FUNK_ERR 13 Cannot determine file type. Possibly a c-tree V4.3 file?
READ_ERR 36 Failed to read file, either a corrupted or non-tree file.
TCOL_ERR 537 Transaction log collision. Two sets of transaction logs in the same directory?
FCPY_ERR 796 Immediate dump restore file copy failed.
DRST_ERR 797 Immediate dump restore failed.
See Also
For a complete discussion of dynamic dumps, see Maintaining Database Integrity (http://docs.faircom.com/doc/ctserver/8373.htm) in the c-treeACE Server Administrator's Guide.
Scripting a Dynamic Dump
In V11 and later, the Dynamic Dump can send a script to the server and receive a dump stream and/or status messages from the server. The following capabilities are available for scripting a dynamic dump:
1. When scheduling a dynamic dump, the client can send the dump script to the server. Prior to V11, the only option was to create the dump script on the server beforehand and the client passed the name of the existing dump script file to the server.
2. When running a dynamic dump, the client can request that status messages be sent to it while the dump is performed and/or the dump stream file can also be sent to the client process.
To use these options, call the function dyndmpsetopt() before calling dyndmp():
extern NINT dyndmpsetopt(NINT option,pVOID value);
The following are the supported options. All options are disabled by default.
DDOPT_SENDSCRIPT - Send dump script to server. Set value to the script name, or set it to NULL to disable this option. Example:
dyndmpsetopt(DDOPT_SENDSCRIPT, ""script.txt"");
DDOPT_RECVSTREAM - Receive dump stream from server. Set value to YES to enable this option or NO to disable this option. Example:
dyndmpsetopt(DDOPT_RECVSTREAM, (pVOID) YES);
DDOPT_RECVSTATUS - Receive status messages from server. Set value to YES to enable this option or NO to disable this option. Example:
dyndmpsetopt(DDOPT_RECVSTATUS, (pVOID) YES);
DDOPT_SETCALLBK - Set callback function. Set value to the callback function pointer, or set it to NULL to disable the use of the callback function. Example:
extern ctCONV NINT mycallback(pVOID pctx,pVOID pdata,NINT datalen,NINT opcode);
dyndmpsetopt(DDOPT_SETCONTEXT, &mycallback);
DDOPT_SETCONTEXT - Set callback function context pointer. Set value to the context pointer that will be passed to the callback function. Example:
mystruct mycontext;
dyndmpsetopt(DDOPT_SETCONTEXT, &mycontext);
DDOPT_SETBUFSIZ - Set communication buffer size. Set value to the buffer size to use. Example:
dyndmpsetopt(DDOPT_SETBUFSIZ, (pVOID) 100000); Notes:
1) The dump options remain in effect for all dynamic dumps performed by the current connection until they are changed.
2) When the DDOPT_RECVSTREAM or DDOPT_RECVSTATUS options are used, the following
dynamic dump script options are ignored:
COPY_NONCTREE - Non-c-tree files cannot be copied.
DATE and TIME - No scheduling of dump for later time.
FREQ - No repeat of dump.
SEGMENT - No segmenting of dump stream.
In V11 and later, the ctdump utility supports these features through command-line options:
usage: ctdump [-s svn] [-u uid] [-p upw] [-t script] [-b bufsiz] [-n] [-c] [-o backup]
Options:
-s svn - c-tree Server name
-u uid - User name
-p upw - User password
-t - Dump script name
-b bufsiz - Use buffer size of bufsiz bytes
-c - Send dump script from client
-n - Send progress notifications to the client
-o backup_filename - Write dump stream from server to file on client Example:
# ctdump -u ADMIN -p ADMIN -o backup.fcd -c -t script.txt -s FAIRCOMS -n
Results:
c-treeACE(tm) Version 11.1.0.46197(Build-150826) Dynamic Backup Utility Copyright (C) 1992 - 2015 FairCom Corporation
ALL RIGHTS RESERVED.
Reading dump stream from server with buffer size of 100000 Start dump. Estimated dump size: 2691072
FAIRCOM.FCS 86% 100% [ 2328576 of 2326528 bytes] SYSLOGDT.FCS 89% 100% [ 86016 of 81920 bytes] SYSLOGIX.FCS 99% 100% [ 266240 of 262144 bytes] S0000000.FCS 100% 100% [ 4096 of 128 bytes] S0000001.FCS 100% 100% [ 4096 of 128 bytes] L0000001.FCS 100% 100% [ 2048 of 679 bytes] End dump. Actual dump size: 2705408
Dynamic Dump has been successfully written to the file backup.fcd.
2.5
ctfilbkif - File Block Utility
ctfilbkif
ctfilblkif will block, or unblock a specified c-treeACE file. The default behavior is to block access
to the specified file. Pass the -u option to unblock a file.
Usage
ctfilblkif [-s server][-f filename][-u] {-p password|-a authfile} -s: Server (default: FAIRCOMS@localhost)
-f: file name -u: unblock file
-a: Authentication file name -p: Admin Password
See also
2.6
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 c-treeACE Programmer's Reference Guide (http://www.faircom.com/doc/ctreeplus/29354.htm) for details for when this may be necessary. The file is opened exclusively, ensuring that the server does not have it open. The syntax for this utility is shown below:
ctfileid file [-ioq] [-n <size>] [-s <svn>] [-u <uid>] [-p <upw>] -i: Also update indices related to data file
-o: Force open of corrupted files (ctOPENCRPT)
-q: Quiet (do not output to stdout)
-n <size>: Set node size (stand-alone only)
-s <svn>: c-treeACE Server name
-u <uid>: User name
-p <upw>: User password
Note: ctfileid.c is located in ctree\samples\special\utils and replaces the previous informal and
undocumented utilities, updateid.c and newid.c.
2.7
ctpass - Password Utility
c-treeACE Server utility to allow users to change their password.
The following steps are required for a user to change the password associated with their own User ID:
1. Run the utility program ctpass as any other program in the environment. 2. Enter your current User ID.
3. Enter the current password for your User ID, if you have one. (Maximum 63 characters. Maximum nine characters for V9 and prior).
4. Continue by entering the current name of the c-treeACE Server (i.e., the default name or another name, supplied in the c-treeACE Server configuration file).
5. Now change your password by entering the new password.
6. To be sure to enter the new password, you may be asked to enter it twice before it will be accepted. If the same name is not entered both times, try again.
Note: Whenever input is requested, the user may enter a question mark (?) to receive HELP.
After the new password is entered and confirmed, a message saying your User ID password has been successfully updated will be displayed. After being updated successfully, the new password must be used with the User ID to log on to the c-treeACE Server.
Note: All users can change their own passwords. In addition, users who are members of the
ADMIN group can change the password of all accounts that are not members of the ADMIN group. Only the super ADMIN account (named ADMIN) can change a password for an account that is a member of the ADMIN group.
2.8
ctpathmigr - Change Internal Path Separators
The ctpathmigr utility is used to change embedded path separators for c-treeACE SQL databases when migrating between Unix and Windows platforms. This functionality was previously available in the ctpath utility. This utility changes database and IFIL resource path separators from the native format of the system where the utility is run (i.e., \ for Windows; / for Unix) to the non-native format. It should be run before moving the files.
Syntax
ctpathmigr [-s <server>] [-u <user>] [-p <password>] [-d <database>]
Description
ctpathmigr with command line arguments returns 0 when the execution detected no errors, or a value different than 0 when errors were detected and the error messages are written to the screen.
If you omit the -d database switch, all databases in the session will be scanned.
Command line options should start with a '-' or '/' character. Use a lowercase character for the option (e.g., -s not -S).
Command line switches may have optional spaces between the switch and the argument. Example: -s FAIRCOMS or -sFAIRCOMS are the same.
Command line options may be entered in any order.
2.9
ctquiet - Quiesce c-treeACE Utility
The ctquiet utility allows an administrator to quiet the server from a script. An interactive option is available in the ctadmn utility.
Usage
ctquiet [-s server][-f][-u][-w command] {-p password|-a authfile} -s Server (default: FAIRCOMS@localhost)
-f Full consistency - files are flushed to disk from cache (default: crash consistency - no flush). See below.
-u Unquiet server
-w Execute command on successful quiet. Waits for SIGINT to unquiet server
-a Authentication file name
-p Admin Password
The -a authfile option takes as argument an encrypted settings file (using ctcmdset.exe) with the plaintext form given as:
; User Id USERID ADMIN ; User Password PASSWD <pass>
Note: This utility provides a -f option, which enables full consistency (also known as a "clean quiesce") in which files are flushed to disk from cache. When this option is used, the system does not require any files to be rebuilt.
The default is the -f option is off, which results in "crash consistency" (also known as a "dirty quiesce"). The default means that transaction logs are required and, if present, the transaction logs are used to get back into a clean state once recovery completes.
If files are NOT under transaction control, the -f option is strongly recommended, otherwise you will have to do a rebuild to get the files back to a clean state.
A quiesced state allows a physical copy of files to be taken that can then be restored at a later time. For systems that provide hardware based snapshot features, this allows extremely fast system backups to take place while maintaining full data integrity.
Notes
When you quiesce the server, as long as the connection that quiesced the server remains connected, all other connections are blocked. Only if that connection goes away do we allow the ADMIN user to logon again and undo the quiesce.
After the server is quiet and the ctquiet utility disconnects, one ADMIN connection is allowed to reconnect. There is no prevention of a separate process connecting as ADMIN while the server is in a quiet state and precluding the unquiet call.
There is a subtle distinction between a "quiet" state, and a file blocked with the ctFILBLK()
call. While in the quiet state, files are not physically closed and cannot be moved or replaced while in this mode. Compare this to a "blocked" state, where the file can be replaced, as the OS file handle has been released.
When the optional -w COMMAND switch is used, the behavior of ctquiet is modified to perform as follows:
a. After successfully quieting the server, it makes a system call to execute COMMAND. b. It remains connected and waits for SIGINT to unquiet the server. If ctquiet is killed before
receiving SIGINT, the server will remain in a quiet state until a new connection unquiets the server.
When connecting to a quieted server with the intent to remove the quiet state when the original caller of ctquiet has disconnected you must now set the USERPRF_ADMSPCL bit.
2.10 ctrbldif - IFIL-based Rebuild Utility
UsageA rebuild utility using the IFIL definitions stored in the header of a file:
ctrbldif DataFileName [ -x8 ] [ -purge ] [ -updifil ] [ -<sectors> ] [ -temppath=<temporary_path> ] [ -sortmem=<n> ] [ <UserId> ] [ <UserPassword> ] [ <ServerName> ]
Description
ctrbldif reads the IFIL structure from DataFileName and calls RebuildIFileXtd() to rebuild
DataFileName and its associated indices.
-updifil - update the IFIL resource within the data file.
-x8 - use extended create blocks read from data and index files.
-sortmem=<n> - use N KB of memory for sorting. This option can be used to increase the rebuild speed for large files.
c-treeACE 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 c-treeACE Server. c-treeACE standalone models default to 16 sectors (2048 byte node size) while the c-treeACE Server defaults to 64 sectors (8192 bytes).
c-treeACE Server options
<UserID> : client user name to logon to a c-treeACE Server.
<UserPassword> : client user password to authenticate to a c-treeACE Server.
<ServerName> : c-treeACE Server name for a client to connect.
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 c-treeACE Server that does not support this new format.
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.
Updates in handling of security attributes
In V10.3 and later, the ctrbldif utility now 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. It is desirable for the newly rebuilt or compacted files to preserve the original security attributes as much as possible and the index file security attributes should match the data file security attributes.
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.
2.11 ctsqlcdb - c-treeACE SQL Database Maintenance Utility
Usagectsqlcdb <command> <dbname> [<servername>]
Valid Commands:
-add: Adds a reference to an existing database
-create: Creates a new database
-drop: Removes a reference to an existing database
-exist: Returns 1 if database exists, 0 if not, 2 on error
-list <servername>: Lists databases available from the server
-create_preimage: Creates a preimage only database (supporting only atomicity; no transaction logs for durability.)
Or the following command syntax copies an existing database and adds a reference to the new copy:
-copy <dbname> <newname> [<servername>]
-copy also includes non c-tree files when present in the database directory area. where:
• <dbname> is the database name, and
• <servername> is the optional c-treeACE SQL name.
The -copy command supports virtual tables (called "Multi Record Tables" or "MRT tables").
2.12 ctsqlimp - SQL Import Utility
ctsqlimp is used as follows (after creating the database file):
ctsqlimp <filename> [-d database] [-s server] [-u userid] [-a password] [-n symbolic] [-o userid]
[-i] [-r] [-k] [-c] [-x] [-p|-P] [-z] [-g] [-b|-B] [-j]
[-w script] [-m idxname] [-e xmlfile] [-f s|z|sz] [-l size] [-q prefix] [-h]
<filename>: data file name/path (relative paths to c-treeACE SQL directory)
-d database : database name (default: ctreeSQL)
-s server: c-treeACE SQL Server name (default: FAIRCOMS)
-u userid: userid for logging into c-treeACE SQL
-a password: password for authorization
-n symbolic: set SQL table name to symbolic symbolic
-o userid: set owner of table to userid
-i: non interactive mode: ignore errors and continue
-r: remove existing linked table (file is not deleted)
-k: skip fields that don't comply with conventional identifiers rules
-c: allow table names not complying with conventional identifiers rules
-p: promote unsigned integer to greater signed type
-P: promote unsigned types to greater signed type and set check for fitting value
-z: allow indices with missing string terminator in key segments
-g: ignore existing index name in IFIL resource
-b: (lowercase) switch grants all permissions on the table to the public
-B: (uppercase) switch grants read-only permissions on the table to the public
Note: If both -B and -b are specified, the read-only setting takes precedence. Notice that the owner of the table and the DBA have all the permissions.
This introduces a change in behavior for existing applications because this switch is now-case sensitive.
-j: non-interactive relink of existing table
-w script: write CREATE statements into script file script instead of importing the table
-m idxname: set index idxname as primary key
-e xmlfile: get DODA definitions from external XML file xmlfile
-f s | z | sz: force string padding to (s)paces (z)eroes or (sz)spaces zero terminated
-l size: specify LONGVAR* field size threshold
-q prefix: prefix SQL table name with prefix (when the -q option is combined with the symbolic table name option, -n, the prefix is prepended to the symbolic name instead to the table name)
-h: display usage help
Note: The parameters are case-sensitive. By default they are lower case unless otherwise stated.
Example
To make existing c-tree files mydata.dat (containing proper IFIL and DODA resources) and
mydata.idx accessible via c-treeACE SQL, follow these steps:
1. Create a database named ctreeSQL.
2. Copy your ISAM custmast.dat and custmast.idx files into the ctreeSQL.dbs subdirectory of the server's working directory.
3. Ensure c-treeACE SQL is running, as ctsqlimp is a client application.
4. Run the ctsqlimp utility found in the /tools/cmdline/admin/client/ directory of your c-treeACE installation:
ctsqlimp custmast.dat -u ADMIN -a ADMIN -s FAIRCOMS
5. Run the Interactive SQL, isql, utility and issue the command:
SELECT * FROM custmast;
See Also
Migrating to c-treeACE SQL (http://docs.faircom.com/doc/sqlops/41034.htm) in the c-treeSQL Server Operations and Utilities Guide
2.13 ctsqlutl - c-treeSQL Maintenance Utility
The c-treeSQL Maintenance Utility, ctsqlutl, is a general purpose program to perform
maintenance on the c-treeSQL Server. At this time only the "rename column" (-rencol ) command has been implemented. Please refer to the V8.14 Update Guide, Section 14.7, for complete details.
Syntax
The ctsqlutl utility syntax is as follows:
ctsqlutl [options] -rencol table_name column newcolumn table_name: Name of the table
column: Current name of the column you are going to rename
newcolumn: Name of the columns after renaming
Options
-o owner_name: Owner of table
-d database_name: Database name (default: ctreeSQL)
-s server_name: c-treeSQL Server name (default: FAIRCOMS)
-u userid: userid for logging onto the c-treeSQL Server
-a password: Password for authentication
-h: Display usage help
2.14 ctstat - Statistics Monitoring Utility
The c-treeACE Statistics Utility, ctstat, is a client utility used to display statistics collected by c-treeACE. ctstat, provides valuable real time monitoring of critical c-treeACE operations.
Usage
# ctstat report_type [-s svn] [-u uid] [-p upw] [-i int [cnt]] [-h frq] [-d] [-m] [-t]
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
-var Admin-Replication Reader Report
-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
-sqlidx Shows index scan statistics
-sqlcache Shows SQL cache information
-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 or reset the function-timing statistics
-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
-filelocks datafile
List all locks on a data file
-filelocks file [N]
List all locks on a data file. Displays the Nth key. See -filelocks Notes below.
-userlocks user List all locks held by a user. See -userlocks Notes below.
Options:
-s svn c-treeACE Server name
-u uid User name
-p upw User password
-i int [cnt] Pause int seconds for optional cnt times.
In V11 and later, standard output is flushed after the interval determined by -i
so that output is written to the file immediately. This better handles cases where output is redirected to a file.
-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:
• phyrec - Last byte offset of file for non-memory file or current memory in use for memory file.
• mhghbyt - Largest amount of memory used for memory file since file was created.
• memcnt - Current number of memory records.
-t Output timestamp with header.
-filelocks Notes
The -filelocks option lists all locks on a data file and, optionally, displays the Nth key. The lock offset and the associated keys are not read at the same time. Since we are reading records locked by other users to generate the key, there is no guaranteed relationship between the lock and the displayed key. The following are possible scenarios:
1. The displayed key is from before or after any changes made by the lock holder.
2. The locked offset no longer holds a valid record (it has been deleted, or updated and moved). 3. The locked offset could have been locked/modified/unlocked more than once between the
time the lock offset was acquired and the time the record is read, so the offset could hold an entirely different record than what was originally locked.
The -filelocks file [key] command supports c-tree's standard wildcard filename matching for the specified file, allowing locks from multiple files to be displayed. The standard wildcards (used by
ctsrvr.cfg keywords such as MEMORY_FILE and REPLICATE, etc) are:
* - Multi-character match
? - Single-character match
^ - Negation (must be first character)
-userlocks Notes
For the -userlocks report:
If UserID is a number, it is interpreted as a task ID.
If UserID is a string, it is interpreted as a name, and information on locks held by each task ID with a matching name is returned.
Because the -userlocks report may generate a large number of server calls (for each task ID and file), the -userlocks report interval may be increased up to 60 seconds, depending on the number of matching users and files involved.
See Also
ctstat - Statistics Utility (http://docs.faircom.com/doc/ctserver/52856.htm) in the c-tree Server Administrator's Guide
2.15 ctstop - Server Stop Utility
Usagectstop [ -auto ] [<ServerName> <AdminId> <AdminPassword>]
This utility shuts down a c-treeACE Server.
Passing the -auto switch to ctstop without specifying a ServerName, Password, or AdminID
shuts down a c-treeACE Server with the defaults shown below:
The ctstop utility supports passing in ServerName, Password, and AdminID when the -auto
switch is used.
The optional delay value is the number of seconds to wait before shutting down, with a default of no delay.
2.16 ctsysm - Server Status Monitoring Utility
The c-treeACE Server status monitoring utility, ctsysm, facilitates the monitoring of error, warning, and informational messages logged to the server status log, CTSTATUS.FCS, by the c-treeACE Server. Using this utility, the c-treeACE Server status log can be monitored by an automated external process such as the Tivoli monitoring system from IBM.
To use the ctsysm utility, the c-treeACE Server must be configured to log messages to the system log. This can be achieved by adding the following keyword to the server's configuration file:
SYSLOG CTSTATUS
With this keyword in place, the server logs each entry in the CTSTATUS.FCS file to the system log files (SYSLOGDT.FCS and SYSLOGIX.FCS).
The utility can read the system log from the beginning each time it starts up, or it can save its current position and start again from that set position by specifying the -f command line option. The following is the supported command line usage of the c-treeACE Server Status Monitoring Utility:
ctsysm [-s svn] [-u uid] [-p upw] [-r rpt] [-c cfg] [-f fil] [-l log] -s svn - c-treeACE Server name
-u uid - user name
-p upw - user password
-r rpt - repeat interval in seconds (for example, -r 1 is a one-second delay before checking for new messages)
-c cfg - config file
-f fil - save/restore state to file
-l log - status log name (SYSLOGDT.FCS)
-e - direct ctsysm error messages to standard output in the same format as messages read from the server status log
Example
The following command causes ctsysm to monitor the c-treeACE Server system log for the server FAIRCOMS (-s FAIRCOMS) for status messages, checking for new messages every second (-r 1), saving the position of the last entry read to the file ctsysm.log (-f ctsysm.log).
ctsysm -s FAIRCOMS -u ADMIN -p ADMIN -r 1 -c ctsysm.cfg -f ctsysm.log
The ctsysm utility outputs messages in the following format:
<timestamp> <code> <subsystem> <action> <text>
Sample output from the utility is shown below (each message is output as a single line but is shown split into two lines here):
Thu Jul 29 16:44:04 2004 I0455 STUP NONE - User# 01 Alternative server name... FAIRCOMS
Thu Jul 29 16:44:04 2004 I0492 STUP NONE - User# 01 Compatibility bit maps: 00000000 00002000x
Thu Jul 29 16:44:04 2004 I0491 STUP NONE - User# 01 Diagnostic bit maps: 00000000 00000000x
Thu Jul 29 16:44:04 2004 I0490 STUP NONE - User# 01 64-bit File Address Support
Thu Jul 29 16:44:04 2004 I0489 STUP NONE - User# 01 6 Byte Transaction Numbers
Thu Jul 29 16:44:04 2004 I0488 STUP NONE - User# 01 NOWAIT usrsema enabled
Note: When the repeat (-r) option is used, the utility can be stopped by sending it a SIGINT signal.
See Also
c-treeACE Server Status Monitoring Utility, ctsysm
(http://docs.faircom.com/doc/ctserver/34515.htm) in the c-tree Server Administrator's Guide
2.17 cttrap - Communications Trap Playback utility
Usagecttrap <Trap Comm Log File Name> [-p <password_file>][-x] [<Server>]
Where:
<TrapCommLogFileName> - the name of the file to be played back.
<ServerName> - the optional name of the server.
-p <password_file> - use a text file containing a list of user names and passwords, one per line (see Using a Password File, below).
-x - skip serialization. cttrap serializes all the recorded operations and enforces the original call ordering when allowing multiple client threads to replay the original operation. The -x
option allows for faster replay, although it increases the likelihood of causing errors or differences in the final state of the data that did not exist in the original.
Description
cttrap is a multi-threaded client application that "plays back" a TRAP_COMM log file. Whenever a multi-threaded Client library is created, cttrap will also be generated. The default TRAP_COMM file name is TRAPCOMM.FCS.
When the DIAGNOSTICS TRAP_COMM keyword is active, the trap file, TRAPCOMM.FCS, is created in the server directory by default. To prepend a path onto the trap file name (to route it to a separate disk or directory), add an entry of the form DIAGNOSTIC_STR <trap file path>. For example, if the trap file is located in /bigdisk/TRAPCOMM.FCS, the configuration file needs to contain the following:
DIAGNOSTIC_STR /bigdisk/
Using a Password File
To allow cttrap to connect to a password-protected server when reading from a
containing a list of user names and passwords, one per line. For example, the file pass.txt might contain the entries:
ADMIN ADMIN myusername mypswd
Then cttrap can be run as follows:
cttrap TRAPCOMM.FCS -p pass.txt FAIRCOMS
The passwords must match the passwords on the server where the playback occurs, not necessarily where the playback was recorded.
Up to 16 user user name/password entries can be specified in the cttrap password file. If you wish to support more entries, change #define MAXUPW in cttrap.c and recompile the utility.
2.18 cttrap - TRAP_COMM Utility
The DIAGNOSTICS TRAP_COMM Server keyword allows developers to ‘record’ the communication traffic coming in to a Server and play it back with the cttrap utility.
DIAGNOSTICS TRAP_COMM
When activated, the DIAGNOSTICS TRAP_COMM keyword instructs the Faircom Server to log incoming communications packets to TRAPCOMM.FCS prior to execution. This log can be played back using the cttrap utility and a debug Server to observe the results of the client requests, allowing the developer to exactly duplicate and repeat client activities.
cttrap Utility Usage
cttrap <Trap Comm Log File Name> [-p <password_file>][-x] [<Server>]
Where:
<TrapCommLogFileName> - the name of the file to be played back.
<ServerName> - the optional name of the server.
-p <password_file> - use a text file containing a list of user names and passwords, one per line (see Using a Password File, below).
-x - skip serialization. cttrap serializes all the recorded operations and enforces the original call ordering when allowing multiple client threads to replay the original operation. The -x
option allows for faster replay, although it increases the likelihood of causing errors or differences in the final state of the data that did not exist in the original.
Description
cttrap is a multi-threaded client application that "plays back" a TRAP_COMM log file. Whenever a multi-threaded Client library is created, cttrap will also be generated. The default TRAP_COMM file name is TRAPCOMM.FCS.
When the DIAGNOSTICS TRAP_COMM keyword is active, the trap file, TRAPCOMM.FCS, is created in the server directory by default. To prepend a path onto the trap file name (to route it to a separate disk or directory), add an entry of the form DIAGNOSTIC_STR <trap file path>.
For example, if the trap file is located in /bigdisk/TRAPCOMM.FCS, the configuration file needs to contain the following:
DIAGNOSTIC_STR /bigdisk/
Using a Password File
To allow cttrap to connect to a password-protected server when reading from a
TRAPCOMM.FCS file, use the -p <password_file> option to specify the name of a text file
containing a list of user names and passwords, one per line. For example, the file pass.txt might contain the entries:
ADMIN ADMIN myusername mypswd
Then cttrap can be run as follows:
cttrap TRAPCOMM.FCS -p pass.txt FAIRCOMS
The passwords must match the passwords on the server where the playback occurs, not necessarily where the playback was recorded.
Up to 16 user user name/password entries can be specified in the cttrap password file. If you wish to support more entries, change #define MAXUPW in cttrap.c and recompile the utility.
2.19 cttrnmod - Change Transaction Mode Utility
cttrnmod allows an advanced user to change the transaction status of a c-treeACE 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 indices.
It is expected only advanced database administrators will run this utility.
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) The following extended header attributes may also be set:
• {+,-}R {Enable,Disable} Restorable deletes
• {+,-}C {Enable,Disable} Transaction controlled deletes
get Display the current transaction mode.
-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 c-treeACE 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: Indices created with ctPREIMG or ctTRNLOG are physically structured differently than indices 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
Important Performance Considerations
When turning transaction processing off for a file, it is possible to take an even larger
performance hit under specific c-treeACE Server configurations. Be sure to remove or comment out the line COMPATIBILITY FORCE_WRITETHRU from your c-treeACE 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 c-treeACE Server installations.
Example
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 (c-treeACE V11 and c-treeRTG V2 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).
Usage
cttrnmod (set <tranmode>|get) (-d <database>|-f <filelist>)
[-u <userid>] [-p <password>] [-s <servername>] [-n <sect>]
Current Options
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 <filelist> - 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 c-tree Server name to connect to. Default: FAIRCOMS
-n <sect> - Specify node sector size. Default: 64 (PAGE_SIZE=8192)
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 a new 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
1. 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. 2. 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.
2.20 dbdump - Data Unload Utility
The dbdump utility writes the data in a database to a file. The format of the exported data is specified by the record description given in an input command file.
The dbdump command accepts the commands file name, the database name and a command option.
Syntax
dbdump -f commands_file [-u user_name] [-a password] [-n] [-z] [-p] [-l] database_name
Options
-u user_name - The user name c-treeSQL uses to connect to the database. If omitted, the default value depends on the environment. (On UNIX, the value of the DH_USER
environment variable specifies the default user name. If DH_USER is not set, the value of the USER environment variable specifies the default user name.)
-a password - The password c-treeSQL uses to connect to the database. If omitted, the default value depends on the environment. (On UNIX, the value of the DH_PASSWD environment variable specifies the default password.)
-n - Parse the commands file and display errors, if any, without exporting data. If the parsing is successful, the following message displays on stdout:
No errors in the commands file.
-z (10.3 and later) - The number of records to fetch per call is controlled by the -z switch. To be consistent with the switch of dbload, it defaults to 1.
-l (10.3 and later) - The -l switch controls the progress output frequency in terms of record reads (the output is generated whenever the number of record reads since the last output becomes greater than or equal to the specified value).
-p (10.3 and later) - The dbdump -p command-line switch activates the new query passthru mechanism, which does not perform any major change in the query. When this switch is in use, dbdump interprets the query in the command file, converts it to lowercase, and wraps everything that is considered an identifier with double-quotes. This can cause a syntax error if the command file contains functions. For example, consider the following statement:
SELECT RTRIM(cm_custnumb),...
The default behavior of dbdump results in the following statement, which would cause a syntax error:
select "rtrim" ( "cm_custnumb" ) ,...
Using the dbdump-p switch results in this statement, which does not cause an error:
select rtrim ( cm_custnumb ) ,...
database_name - Name of the database.
See Also
Data Unload Utility: dbdump (http://docs.faircom.com/doc/isql/32623.htm) in the c-treeSQL ISQL Tools and Reference Guide
2.21 dbload - Data Load Utility
The dbload utility loads records from an input data file into tables of a database. The format of the data file is specified by a record description given in an input commands file.
The dbload command does not directly specify an input file, but instead names a commands file that in turn specifies data input files. The dbload command accepts the commands file name, the database name, and a list of command options.
Syntax
dbload -f commands_file [ options ] database_name
options - One or more of the options as described below
database_name - Name of the database.
Options
-u user_name - The user name c-treeSQL uses to connect to the database. If omitted, the default value depends on the environment. (On UNIX, the value of the DH_USER
environment variable specifies the default user name. If DH_USER is not set, the value of the USER environment variable specifies the default user name.)
-a password - The password c-treeSQL uses to connect to the database. If omitted, the default value depends on the environment. (On UNIX, the value of the DH_PASSWD environment variable specifies the default password.)
-z maximum multiple inserts - The maximum number of records to be inserted at one time in each bulk insert (used to improve performance)
-l logfile - Specifies the file into which the error logging is done. stderr is the default.
dbload also writes statistics to the file:
• Number of records read
• Number of records skipped
• Number of records loaded
• Number of records rejected
-b badfile - The file into which the bad rows that were not loaded, are written. By default
badfile is put in the current directory.
-c commit_frequency - Store the specified number of records before committing the transaction. The default frequency is 100 records.
-e maxerrs - The maximum number of tolerable errors. The default number is 50 errors.
-s skipcount - Skip the specified number of rows in the first data file. If multiple files are specified, the rows are skipped only in the first file. The default number is zero rows.
-m maxrows - Stop storing rows at the specified number.
-n - Parse the commands file and display errors, if any, without doing the database load. If the parsing is successful, the following message displays on stdout: "No errors in the
commands file."
See Also
Data Load Utility: dbload (http://docs.faircom.com/doc/isql/32580.htm) in the c-treeSQL ISQL Tools and Reference Guide
2.22 dbschema - Schema Export Utility
The dbschema utility generates c-treeACE SQL statements to recreate the specified database elements and data.
The c-treeACE SQL utility, dbschema, recreates specified database elements and data.
Syntax
dbschema [ -h ] [ -d ] [-u user_name ] [-a password ] [ -o outfile ] [ -p [ user_name.]procedure_name [ , ... ] ]
[ -t [ user_name.]table_name [ , ... ] ] [ -T [ user_name.]trigger_name [ , ... ] ] [ database_name ]
Description
Generates c-treeSQL statements to recreate the specified database elements and data. If the
dbschema statement omits all arguments, it displays definitions for all elements (tables, views, indexes, procedures, and triggers) for the default database on the screen.
Options
-h - Displays brief online help of dbschema syntax and options.
-d - In conjunction with the -t option, specifies that dbschema generates c-treeSQL
INSERT statements for data in the tables, in addition to CREATE statements. The output of the dbschema command invoked with the -d option can be directed to a command file and executed in interactive c-treeSQL to duplicate and load table definitions.
-u user_name - The user name c-treeSQL uses to connect to the database. c-treeSQL verifies the user name against a corresponding password before it connects to the database. If omitted, the default value depends on the environment. (On UNIX, the value of the
DH_USER environment variable specifies the default user name. If DH_USER is not set, the value of the USER environment variable specifies the default user name.)
-a password - The password c-treeSQL uses to connect to the database. c-treeSQL verifies the password against a corresponding user name before it connects to the database. If omitted, the default value depends on the environment. (On UNIX, the value of the
DH_PASSWD environment variable specifies the default password.)
-o outfile - Redirects the output to the specified file. The default is standard output.
-t [ user_name.]table_name [ , ... ] - A comma-separated list of tables and views for which definitions should be generated. Specify a list of specific tables, or use the % to generate definitions for all tables.
Note: With the -t option, the % character is not a true wildcard character. It substitutes for the entire table_name argument and cannot be used for pattern matching within in a character string. This differs from the behavior of the % in the -p and -T options.
By default, dbschema generates definitions for tables owned by the current user. Use the optional user_name qualifier to specify a table owned by a different user.
-p [ user_name.]procedure_name [ , ... ] - A comma-separated list of stored procedures for which definitions should be generated. The table names in the list can include the ‘%’ and underscore, ‘ _ ’, characters, which provide pattern-matching semantics: