SQL Remote User's Guide
Tutorials for Adaptive Server Anywhere Users
Tutorial: Adaptive Server Anywhere replication using Sybase Central
Setting up a consolidated database
In SQL Remote's hierarchical replication system, each database may have zero or one database immediately above it (the consolidated database) and zero or more databases immediately below it (remote databases).
In this tutorial, the current database is the consolidated database of a two-level system. It has no database above it, and only one remote database below it.
The following diagram illustrates the two databases:
For any database in a SQL Remote replication setup, there are three permissions that may be granted to identify databases on the hierarchy:
PUBLISH permission Identifies the current database in all outgoing messages
REMOTE permission Identifies each database receiving messages from the current database that is below it on the hierarchy
CONSOLIDATE permission Identifies a database receiving messages from the current database that is directly above it on the hierarchy.
Permissions can only be granted by a user with DBA authority. To carry out these examples you should connect from Sybase Central to the hq database as user ID DBA, with password SQL.
Any database, consolidated or remote, that distributes changes to other databases in the replication system is a publisher database. Each database in the replication system is identified by a single user ID. You set that ID for your database by adding a publisher to the database. This section describes setting permissions for the consolidated hq database.
First create a user ID named hq_user, who will be the publisher user ID.
To create a new user as the publisher
Select the Users & Groups folder.
From the File menu, choose New
The User Creation wizard appears.
Enter the name hq_user, with password hq_pwd, and click Finish.
Right-click the hq_user icon and choose Change to Publisher from the popup menu.
A database can have only one publisher. You can find out who the publisher is at any time by opening the Users & Groups folder.
Each remote database is identified in the consolidated database by a user ID with REMOTE permissions. Whether the remote database is a personal database server or a network server with many users, it needs a single user ID to represent it to the consolidated database.
In a mobile workgroup setting, remote users may already be users of the consolidated database, and so no new users would need to be added; although they would need to be set as remote users.
When a remote user is added to a database, the message system they use and their address under that message system need to be stored along with their database user ID.
To add a remote user
Select the SQL Remote Users folder.
From the File menu, choose New
The Create a New Remote User wizard appears.
Create a remote user with user ID field_user with the following options:
Enter the password field_pwd.
Ensure that Remote DBA authority is selected, so that the user can run the Message Agent.
Select the message type FILE, and enter the address field.
As with the publisher address, the address of the remote user is taken relative to the SQLREMOTE environment variable or registry entry. As you have not set this value, the address is taken relative to the directory from which the Message Agent is run. You should run the Message Agent from your tutorial directory for the addresses to be interpreted properly.
For information about setting the SQLREMOTE value, see Setting message type control parameters.
Ensure that the Send Then Close option is selected.
(In many production environments you would not choose Send Then Close, but it is convenient for this tutorial.)
When you have finished, click Finish to create the remote user.
You have now created the users who will use this system.