Tocreate the publication
1. Connect to the database from Interactive SQL, and execute the following
statement:
CREATE PUBLICATION SalesRepData (
TABLE SalesRep,
TABLE Customer SUBSCRIBE BY rep_key
)
Setup a subscr iption Eachuser ID that is to receive changes to the publication must have a
subscription. The subscription can only be created for a user who has
REMOTEpermissions. TheGRANT REMOTE statement contains the
addressto use when sending the messages.
Tocreate the subscription
1. Connect to the database from Interactive SQL, and execute the following
statement:
CREATE SUBSCRIPTION
TO SalesRepData (’rep1’)
FOR field_user ;
Thevalue rep1 is the rep_key value we will give to the user field_user in
theSalesRep table.
Thefull CREATE SUBSCRIPTION statement allows control over the data
insubscriptions; allowing users to receive only some of the rows in the
publication. For more information, see “CREATESUBSCRIPTION
statement”on page 358.
TheCREATE SUBSCRIPTION statement identifies the subscriber and
defineswhat they receive. However,it does not synchronize data, or start the
sendingof messages.
Set up the remote database
Theremote database needs to be configured in order to send and receive
messagesand participate in a SQL Remote setup. Like the consolidated
database,the remote database needs a CURRENT PUBLISHER to identify
thesource of outgoing messages, and it needs to have the consolidated
databaseidentified as a subscriber. Theremote database also needs the
publicationto be created and needs a subscription created for the
consolidateddatabase. The remote database also needs to be synchronized
withthe consolidated database; that is, it needs to have a current copy of the
datain order for the replication to start.
44