Replication Server replicates the DDL changes generated by alter... modify owner so that the transfers in object ownership at the primary Adaptive Server database are applied to the replicate Adaptive Server database. However, if there is a change in object ownership for an object qualified with an owner, in a replication definition where the owner name is required, Replication Server does not automatically alter the replication definition to reflect the change.
Suppose you create a replication definition for the authors table with Mario as the owner—mario.authors, and subsequently the database adminstrator transfers the table owner to Angela. As a result, Replication Server cannot replicate any insert, delete, or update operations to the replicate authors table because Replication Server receives these operations for replication to angela.authors but the replication definition still has mario.authors.
To ensure that data replicates continuously and correctly, coordinate any changes to object ownership with corresponding changes to affected replicated definitions and database replication definitions.
Executing rs_send_repserver_cmd at the primary database allows you to order the change to the replication definition to be always after executing alter... modify owner. It is more difficult to coordinate the transfer of object ownership with the modifications to the replication definition or database replication definition if you execute alter replication definition or alter database replication definition at the Replication Server.
exec rs_send_repserver_cmd ‘alter replication definition replication_definition_name alter [primary] owner from current_owner to new _owner'
exec rs_send_repserver_cmd ‘alter database replication definition database_replication_definition_name alter owner from current_owner to new _owner [for tablename]'Omit the for tablename option if you want to change the owners for all tables in the database replication definition .
Altering the owner in the replication definition creates a new version of the replication definition. If there are already multiple versions of the replication definition, Replication Server only modifies the current version to ensure that any data in the inbound queue replicates with the proper replication definition version. This allows for the transfer of table ownership to occur without having to drain the queues.
exec rs_send_repserver_cmd ‘alter replication definition * alter owner with primary at data_server.database from old_owner to new _owner’
rs_helpreptable primary_database, current_owner, '*'