Contents Index Tutorial: Adaptive Server Anywhere replication using Interactive SQL and dbxtract Set up the consolidated database

SQL Remote User's Guide
  Tutorials for Adaptive Server Anywhere Users
    Tutorial: Adaptive Server Anywhere replication using Interactive SQL and dbxtract

Preparing for the replication tutorial


This section describes the steps you need to take to prepare for the tutorial. These steps include the following:

To create the databases and directories for the tutorial

  1. Create a directory to hold the files you make during this tutorial; for example c:\tutorial.

    mkdir c:\tutorial
  2. The tutorial uses two databases: a consolidated database named hq.db and a remote database named field.db. Change to the tutorial directory and create these databases using the following statements at a command prompt:

    dbinit hq.db
    dbinit field.db
  3. Create a subdirectory for each of the two user IDs in the replication system. Create these subdirectories using the following statements at a command prompt:

    mkdir c:\tutorial\hq
    mkdir c:\tutorial\field

The next step is to add a pair of tables to the consolidated database.

To add the tables to the consolidated database

  1. Connect to hq.db from Interactive SQL with a user ID of DBA and a password of SQL.

  2. Execute the following CREATE TABLE statement to create the SalesRep table:

    CREATE TABLE SalesRep (
       rep_key CHAR(12) NOT NULL,
       name CHAR(40) NOT NULL,
       PRIMARY KEY ( rep_key )
    );
  3. Execute the following CREATE TABLE statement to create the Customer table:

    CREATE TABLE Customer (
       cust_key CHAR(12) NOT NULL,
       name CHAR(40) NOT NULL,
       rep_key CHAR(12) NOT NULL,
       FOREIGN KEY REFERENCES SalesRep,
       PRIMARY KEY ( cust_key )
    );

You are now ready for the rest of the tutorial.


Contents Index Tutorial: Adaptive Server Anywhere replication using Interactive SQL and dbxtract Set up the consolidated database