Show TOC

alter subscriptionLocate this document in the navigation structure

Moves a subscription between replicate connections of the same replicate database that use the same Replication Server, without the need to re-materialize. The subscription may be for a database replication definition, table replication definition, function replication definition, or publication. You can also you change a subscription’s user and init-table options.

Syntax

For database subscription

alter subscription <subname>
for database replication definition <repdefname>
with primary at <pri_dataserver.pri_database>
{{move replicate from <data_server1>.<database1> to <data_server2>.<database2>} |
{with replicate at <data_server.database>}
[user <username> password <password>]
[[not] [create | create or truncate | truncate | recreate] replicate table]]}

For other subscription

alter subscription <subname>
for {<table_repdef> | <func_repdef> | {publication <pub>}} 
move replicate from <data_server1>.<database1> to <data_server2>.<database2>
Parameters
sub_name

The name of the subscription, which must conform to the rules for naming identifiers. The subscription name must be unique for the replication definition, where applicable, and for the replicate data server and database.

for table_rep_def

Specifies the table replication definition the subscription is for.

user <username> password <password>

Set the user who performs the select and mark operations at the primary for materialization.

[not] [create | create or truncate | truncate | recreate] replicate table

Change the way a materialized table is added to the replication path. At most one of the init-table options (create, create or truncate, truncate, or recreate) can be in force at a time. For details and restrictions, see .create subscription

for function_rep_def

Specifies the name of the function replication definition the subscription is for.

for publication pub_name

Specifies the publication the subscription is for.

for database replication definition db_repdef

Specifies the database replication definition the subscription is for.

with primary at <data_server.database>

Includes this clause for a subscription for a publication or a database replication definition. Specifies the location of the primary data. If the primary database is part of a warm standby application that uses logical connections, <data_server.database> is the name of the logical data server and database. You can also specify an alternate primary connection name in the clause if you are configuring a multi-path replication system.

move replicate from <data_server1.database1> to <data_server2.database2>

Specifies that you want to move the <sub_name> subscription from the <data_server1.database1> replicate connection to the <data_server2.database2> connection .

If the replicate database is part of a warm standby application, <data_server.database> is the name of the logical data server and database. You can also specify an alternate replicate connection name in the clause if you are configuring a multi-path replication system.

Examples
Example 1

For example, to move the sub1 subscription for the rep1 replication definition from the RDS.rdb1 connection to the RDS.rdb2 connection, enter:

alter subscription sub1 for rep1
move replicate from RDS.rdb1
to RDS.rdb2
Usage
  • Use alter subscription to move subscriptions between replicate connections if you have created one or more alternate replicate connections. See Replication Server Administration Guide Volume 2 > Performance Tuning > Multi-Path Replication > Moving Subscriptions Between Connections.
  • Execute alter subscription at the Replication Server of the database where the replicated data will be stored.

  • See the Replication Server Administration Guide Volume 1 for more information about subscriptions and the role they play in replication.

  • You cannot use alter subscription if the primary Replication Server version is earlier than 1570. Instead, you must drop and re-create the subscription at the connection you want.

  • To move multiple subscriptions that must replicate through the same path, suspend log transfer for the primary connections and then resume log transfer after you move all the subscriptions.

Note

Executing alter subscription move replicate is not allowed while the database subscription is being materialized.

Permissions
To execute create subscription, you must have the following login names and permissions:
  • The same login name and password at the replicate Replication Server, primary Replication Server, and primary Adaptive Server database.

  • “create object” or “sa” permission at the replicate Replication Server where you enter this command.

  • “create object”, “primary subscribe”, or “sa” permission at the primary Replication Server.

  • select permission on the primary table in the primary Adaptive Server database.

  • execute permission on the rs_marker stored procedure in the primary Adaptive Server database.

  • The replicate database maintenance user must have select, insert, update, and delete permissions on the replicate table, and execute permissions for functions used in replication.