SQL Remote User's Guide
A Tutorial for Adaptive Server Enterprise Users
Tutorial: Adaptive Server Enterprise replication
Setting up the consolidated database
There are three stages to producing a remote Adaptive Server Anywhere database:
Extract the schema and data into a set of files. You do this using the ssxtract utility.
Create an Adaptive Server Anywhere database.
Load the schema and data into the database.
With all the information included, the next step is to extract an Adaptive Server Anywhere database for user field_user. The following command line (entered all on one line, from the tutorial directory) carries out this procedure:
ssxtract -v -c "eng=server-name; dbn=hq;uid=sa;pwd=sysadmin" C:\tutorial\field field_user
The options have the following meaning.
-v Verbose mode. For development work, this provides additional output.
-c Connection string option. The connection string is supplied in double quotes following the -c
.
eng=server-name Specifies the server to which the extraction utility is to connect.
dbn=hq Specifies the database on the server to use; in this case hq.
uid=sa The login ID to use to log on to the database.
pwd=sysadmin The password to use to log on to the database.
C:\tutorial\field The directory in which to place files holding the data.
field_user The user ID for which to extract the database.
For more information on extraction utility options, see The extraction utility.
Running this command produces the following files:
Reload script The reload script is named reload.sql, and is placed in the current directory.
Data files Files containing data to load into the database. In this case, these files are empty.
You can create an Adaptive Server Anywhere database using the dbinit utility. A simple Adaptive Server Anywhere database is a file, unlike Adaptive Server Enterprise databases.
You should create the Adaptive Server Anywhere database so that it is compatible with Adaptive Server Enterprise database behavior, unless you have set options in your Adaptive Server Enterprise server that are different from the default.
To create a database file named field.db
Enter the following command from the c:\tutorial\field directory:
dbinit -b -c -k field.db
The -b
option forces use of blank padding in string comparisons. The -c
option enforces case sensitivity for string comparisons. The -k
option makes the system catalog more compatible with Adaptive Server Enterprise.
You can load the data into the database using the Adaptive Server Anywhere Interactive SQL utility or the rtsql utility. rtsql is an alternative to Interactive SQL for batch processes only, and is provided for the runtime database.
To load the data into the database using Interactive SQL
Start an Adaptive Server Anywhere server running on the field database:
dbeng9 field.db
Connect to the server using the Interactive SQL utility:
dbisql -c "eng=field;dbn=field;uid=DBA;pwd=SQL"
The user ID and password must be entered in upper case, as the Adaptive Server Anywhere database was created as case-sensitive.
Load the data using the READ command:
READ C:\TUTORIAL\RELOAD.SQL
To load the data into the database as a batch process
Start an Adaptive Server Anywhere server running on the field database:
dbeng9 field.db
Run the script from Interactive SQL:
dbisql -c "eng=field;dbn=field;uid=DBA;pwd=SQL" reload.sql
The user ID and password must be entered in upper case, as the Adaptive Server Anywhere database was created as case-sensitive.
The system is now ready for replication.
For the next step, inserting and replicating data, see the section Start replicating data.