Help For Compress

Though the information shown here refers to DirectTalk/2, it is applicable to the Windows NT version as well.

COMPRESS is a DirectTalk/2 user requester that will compress any DirectTalk/2 database. When DirectTalk/2 deletes data from a database, the data is not physically removed from the file until the database is compressed. This program mimics the function provided by the Compress feature in the Voice Application Developer. Compressing a database will remove this previously deleted information and reduce the file size. This program will back up a database file before starting compression. You may specify wild cards to have the program compress more that one database with a single invocation of the program. There are two methods available to compress a database:

  1. sequential read/write - This is the same method used by the Compress feature in the Voice Application Developer. Each record is read from the original database and written to the new database in ASCII search order based on the record key ie. 0001, 0002, 0003, 0004, etc.
  2. optimum read/write - This method was recommended by Paul Herman and Joe Fanelli, two of the original DirectTalk/2 developers. This method provides for optimum balancing of the binary tree used to search the database when it is read. With this method, all of the keys are read into memory. Each record is read and written starting with the median key and working out to the first (lowest) and last (highest) key, alternating back and forth For example, for a database with 5 records keyed sequentially 1 to 5, the records will be written in the following order: 3, 2, 4, 1, 5. (Using the sequential method, they would be written as follows: 1, 2, 3, 4, 5.) The optimum method is the default method used by COMPRESS.

COMPRESS is executed with the following command format:

COMPRESS <options> filemask <server>

where the items in < > are optional.

<server> is the name of the DirectTalk/2 GSI node and is optional. If not specified, the program will assume the node name is GSSSN01.
filemask is the mask used to determine which databases to compress. You mayuse the search characters, '?' and '*', in the mask. To compress all database files on your system, execute COMPRESS *.* <server>. Do not specify any path as part of the filemask. The program will locate the actual path for all DirectTalk/2 databases as needed.
options> are optional. The following options are supported:
/K path -- tells COMPRESS to keep backups of the original databases and to place them in the specified directory. For example, to compress every database, keeping a backup of each database in the C:\DTBACKUP directory:

COMPRESS /K C:\DTBACKUP *.*

COMPRESS will attempt to create the directory if it does not already exist. The backup directory cannot be the same as where DirectTalk/2 stores its databases (usually x:\DTALK\DATASERV).

/T file -- tells COMPRESS to use another file for its temporary database file. Input must be in 8.3 FAT format.
/S -- read and write each database record sequentially. This is the same method used by the Voice Application Developer.
/W time -- makes COMPRESS pause the specified amount of time after telling DirectTalk/2 to close a database file. Time should be specified in milliseconds ie. /W 500 will force a 1/2 second pause at every database close. This parameter should never be needed and may slow the execution of COMPRESS significantly. Occasionally, it was observed that COMPRESS would get an error indicating the database file was in use when it attempted to rename the file to the backup name and the file had just been closed by the Database Server. This problem was seen only on a couple of very fast systems running DirectTalk/2 2.0.
/H -- causes help to be displayed. If /H is used, all other options and parameters are ignored.

Notes

  1.  Before compression is started, each database is backed up to $$COMPSS.$$$. This file cannot exist before starting COMPRESS. As each database is successfully compressed, the backup file is deleted. If all databases are compressed without error, it is deleted as the program completes execution. The name of the temporary work file can be changed, if desired. See the /T option above.
  2. The program will produce informational messages showing you the amount of space reclaimed as a result of the compression and the number of files processed actually processed by COMPRESS.
  3. COMPRESS will display an informational message and continue processing if any of the files found matching the mask are not DirectTalk/2 database files or the files are read-only.
  4. DirectTalk/2 must be installed and running for COMPRESS to work.
  5. The program will fail if another DirectTalk/2 process or application has one or more records locked in any database.
  6. You must install and run COMPRESS on the DirectTalk/2 system where the databases are physically located. Otherwise, COMPRESS will fail as it will not be able to back up the database(s).
  7. COMPRESS must be kept and run from the DTALK directory. If you intend to use the /H (display help) option, COMPRESS.HLP must be kept there also.

 

Return to top of this page

Return to the main page.