Sds2db
From SRB
Contents |
NAME
Sds2db - Convert a datascope database to a conventional SQL database.
SYNOPSIS
Sds2db [-qrv] [-n max_num_row_synch] [-d database_name] [-t table_prefix] [-f field_prefix] [-k key_relation_file] srbObj(datascope_descriptor) srbObj(sqldb)
Sds2db -h
Sds2db -p srbObj(sqldb)
Sds2db -c database_name srbObj(sqldb)
DESCRIPTION
Sds2db converts and synchronizes a srbObj(datascope_descriptor) , which is a Antelope Datascope database descriptor, to a srbObj(sqldb) , which is a DAI object pointing to a convensional SQL database output, or a file. To learn about DAI object, please refer to the document DAI. This program create tables in SQL DB, corresponding to the tables in Antelope Datasceop DB. Also, it creates a descriptor table, DS_DESC_, for all other converted tables. DS_DESC_ stores information such as the prefix, table creation time, and lock.
OPTIONS
- -h
- displays command options
- -n
- max_num_row_synch Up to how many rows to synchronize for each table. This option can be used for performance testing.
- -d
- database_name Name of this database/project. It can be any string, as long as it is unique among all the database/project you have in the SQL database schema. If this option is not speicified, a unique name is generated based on your SRB username and time.
- -t
- table_prefix Prefix for the table names, in SQL database. This is needed because Antelope Datascope database uses words, which is reserved in SQL databases, as table names. This option will define a prefix and add it in front of the datascope table names, to form table names in SQL database.
- -f
- field_prefix Prefix for the field names, in SQL database. This is needed because Antelope Datascope database uses words, which is reserved in SQL databases, as field names. This option will define a prefix and add it in front of the datascope field names, to form field names in SQL database.
- -r
- Reset lock. This program sets a lock to all tables, belonging to the same convertion project. This is done by updating the lock field in table DS_DESC_. It resets the lock after the convertion/synchronization is complete. The locks are here to prevent racing condition, more than one program working on the same set of tables. However, if the program is terminated in the middle of synchronization, the lock will be on still. This option resets the locks on the tables. I
- -k
- key_relation_file. Out put key relations of Antelope Tables to a file, instead of stdout. Antelope Datascope tables uses the concept of primary/foreign keys. However, it is not strictly enforced to be unique and not null. Thus Sds2db does not apply the keys read from Antelope tables to SQL tables. Instead, it output the key relations for references. The format is "child_table.child_column->parent_table.parent_column\n".
- -c
- database_name Delete all tables, belonging to the specific database convertion project. It can be used when there is a unrecoverable error in SQL db. I
EXAMPLES
"Sds2db -d LACOFD -t LACOFD_ -f LACOFD_ LACOFD.ds -k /tmp/key_rel.txt ora_dai_dscope"
Convert an Antelope DB, registered as LACOFD.ds, to An Oracle DB, registered as ora_dai_dscope. Using LACOFD as the database/project name. Using LACOFD_ as the table prefix and field prefix, output key relations to file "/tmp/key_rel.txt".
"Sds2db -c LACOFD ora_dai_dscope"
Detelete all converted tables, under project name LACOFD, in Oracle DB, registed as ora_dai_dscope.
Bugs
This program only supports ORACLE 9 or newer version, at this time.


