Joining depository databases

The TrezorJoiner program is the utility used for manipulation with depository databases on Sybase platforms. It allows to join depositories, or "cut out" defined time period from depository database. The result in the both cases is a new depository database.

The program operation is controlled by the script, which is located in the file JOBS.TXT in the current dictionary. The script consists of two parts. The SETTINGS part contains the settings that are valid during the script execution. The WORK part contains a sequence of operations that control the creation of depository databases. Using one script allows to create several new depository databases.


Realisation

All operations are performed in the work directory defined in the SETTINGS part - the parameter WorkDirectory. Depository databases are first copied into this directory, and then are used for work. The result database is created also in this directory and then, after compression, is copied to DestinationTrezorPath. These facts imply the high demand on enough free disk space on the disk.


Monitoring

The current information on the program run is displayed on the screen on the fly. Run of the program TrezorJoiner is logged into the file TrezorJoin.Log, which is created in the current program directory. If the file already exists, new logs are to be saved into it.


Example

The control script for the depository DEPOSITORY1.CDB created by joining the depositories Depository_2000_06_01_00.cdb, Depository_2000_06_02_00.cdb, Depository_2000_06_03_00.cdb. The new depository will comprise the data within the time period from 12:00:00 31-05-2000 to 12:00:00 02-06-2000. If the size of the new depository is 800 MB (not compressed), then no more data are to be written into it. The depository DEPOSITORY2.CDB will be created by joining the depositories Depository_2000_06_04_00.cdb, Depository_2000_06_05_00.cdb, Depository_2000_06_06_00.cdb, Depository_2000_06_07_00.cdb, Depository_2000_06_08_00.cdb, Depository_2000_06_09_00.cdb,Depository_2000_06_10_00.cdb. The only limitation for the joining is the maximal size of the new depository uncompressed - 1200 MB. The result depositories after compression are to be placed into the directory d:\FinalDepositories.

[SETTINGS] 
 DriverName = Adaptive Server Anywhere 6.0 
 EngineName = dbeng6 
 WorkDirectory = d:\JoinTrezorWork 
 DestinationTrezorPath = d:\CompleteTrezors 
 TemplateDir = D:\D2000.V41\Templates

[WORK] 
 StartTime = "12:00:00 31-05-2000" 
 StopTime = "12:00:00 02-06-2000" 
 MaxTrezorSize = 800 NEW ADD I:\D2000.V41\Compress\Depository_2000_06_01_00.cdb 
 ADD I:\D2000.V41\Compress\Depository_2000_06_02_00.cdb 
 ADD I:\D2000.V41\Compress\Depository_2000_06_03_00.cdb 
 PACK DEPOSITORY1 StartTime = StopTime = MaxTrezorSize = 1200 
 UNPACK I:\D2000.V41\Depository_2000_06_04_00.cdb 
 ADD I:\D2000.V41\Depository_2000_06_05_00.cdb 
 ADD I:\D2000.V41\Depository_2000_06_06_00.cdb 
 ADD I:\D2000.V41\Depository_2000_06_07_00.cdb 
 ADD I:\D2000.V41\Depository_2000_06_08_00.cdb 
 ADD I:\D2000.V41\Depository_2000_06_09_00.cdb 
 ADD I:\D2000.V41\Depository_2000_06_10_00.cdb 
 PACK DEPOSITORY2 
 END

Parameters in the SETTINGS part

[SETTINGS] Required key word that marks the script part.
DriverName = Adaptive Server Anywhere 6.0 Name of the installed ODBC driver. The name can be found in Control Panel\ODBC Data Source Administrator\Drivers.
EngineName = dbeng6 Optional parameter - name of the engine installed. For Sybase 6 - dbeng6. If is defined, TrezorJoiner will start Engine with optimal parameters.
WorkDirectory = d:\JoinTrezorWork Path to the work dictionary. The path destination must be on a disk with enough free space.
DestinationTrezorPath = d:\CompleteTrezors Path for saving the result depository databases.
TemplateDir = D:\D2000V41\Templates Path to the depository database template.

Parameters in the WORK part

[WORK] Required key word that marks the script part.
StartTime = "00:00:00 01-06-2000" Optional parameter - begin time and date for data in new depository database. It is used as a filter during the execution of the command ADD.
StopTime = "12:00:00 05-06-2000" Optional parameter - end time and date for data in new depository database. It is used as a filter during the execution of the command ADD.
MaxTrezorSize = 800 Optional parameter - maximal size (in MB) of new depository database. After reaching the given size, no more data are to be written into the database.
NEW Creates a new database. There is used the template of the depository database.
UNPACK path\Trezor_2000_06_01_00.cdb Creates a new database. There is used the expanded depository, that is stated in the command. No data are deleted from the stated depository database. The parameters StartTime and StopTime are ignored in this case.
ADD path\Trezor_2000_06_02_00.cdb Adds the defined depository database to the newly created database. If the parameters StartTime and StopTime was set before this command, they will be used as filters for writing the data into the new database. If the parameter MaxTrezorSize was set, it is continuously checked.
PACK TREZOR_NAME Compression of new depository database. The name of the result database will be stated in this command and the database will be stored in the directory, that was defined by the parameter DestinationTrezorPath in the part SETTINGS.
END The command terminates TrezorJoiner.

Related pages:

Napíšte komentár