Granting permissions for a primary database

If a replicate database holds primary data, then it is also a primary database. In a primary database, special permissions are necessary on two replication objects: subscriptions and request functions.

When subscriptions are created, the rs_marker stored procedure is executed at the primary database. Any database user who can create subscriptions must have permission to execute rs_marker.

A primary database may also receive transactions via request function delivery from clients at replicate sites. These transactions are executed at the primary site as if by the user executing the request function. Any user login name with permission to execute request functions must also have permission to execute rs_update_lastcommit, which executes in every DSI transaction.

The permission requirements are the same for request functions and request stored procedures. Refer to Chapter 10, “Managing Replicated Functions” for more information on using request functions.

The following grant commands allow any user in the database to execute rs_marker and rs_update_lastcommit:

grant execute on rs_marker to public
grant execute on rs_update_lastcommit to public

These stored procedures should only be executed by Replication Server on behalf of users. Sybase Central or rs_init grants these permissions to “public.” You may want to restrict permissions to the database users who are allowed to create subscriptions, execute request functions, or request stored procedures.