Tocreate the message type
1. In Interactive SQL, create the file message type using the following
statement:
CREATE REMOTE MESSAGE
TYPE file
ADDRESS ’hq’
Theaddress (hq) for a file link is a directory in which files containing the
messageare placed. Itis taken relative to the SQLRemote environment
variableor registry entry. As you have not set this value, the address is taken
relativeto the directory from which the Message Agent is run. Youshould
runthe Message Agent from your tutorial directory for the addresses to be
interpretedproperly.
Forinformation about setting the SQLRemote value, see “Setting
messagetype control parameters” on page 214.
Grant PUBLISH and REMOTEat the consolidated database
Inthe hierarchical replication system supported by SQL Remote, each
databasemay have one consolidated database immediately above it in the
hierarchyand many databases immediately below it on the hierarchy
(remotedatabases).
PUBLISHpermission identifies the current database for outgoing messages,
andthe REMOTE permission identifies each database receiving messages
fromthe current database.
Permissionscan only be granted by a user with DBA authority. To carry out
theseexamples you should connect using the Interactive SQL utility to hq as
userID DBA, with password SQL.
GRANTPUBLISH to
identifyoutgoing
messages
Eachdatabase that distributes its changes to other databases in the replication
systemis a publisher database. Eachdatabase in the replication system that
publisheschanges to a database is identified by a single user ID. You set that
IDfor your database using the GRANT PUBLISH statement. Thissection
describessetting permissions for the consolidated database (
hq.db
).
Tocreate a publisher for the database
1. Connect to the database using Interactive SQL, and type the following
statement:
GRANT CONNECT
TO hq_user
IDENTIFIED BY hq_pwd ;
GRANT PUBLISH TO hq_user ;
42