Show TOC

Changes to create subscriptionLocate this document in the navigation structure

The create subscription syntax has been modified and several new parameters added.

Syntax
create subscription <sub_name
>for {<table_repdef> | <func_repdef> | publication <pub> |
     database replication definition <db_repdef> }
     [ with primary at <server_name.db> ]
with replicate at <data_server>.<database
>[where {<column_name> | @<param_name>}
     {< | > | >= | <= | = | &} <value
>[and {<column_name> | @<param_name>}
     {< | > | >= | <= | = | &} <value>]...]
[without holdlock [direct_load [init replicate table with {create | create_or_truncate | truncate | recreate}]
[user <username> password <pass>][<num_of_selects> selects][hold_resource_on_error]]| 
incrementally | without materialization]
[subscribe to truncate table] [for new articles]
Parameters

Replication Server 15.7.1 SP200 adds these parameters:

  • init replicate table with create – Creates the table at the replicate database. If the table already exists, the materialization fails.
  • init replicate table with create_or_truncate – Creates the table at the replicate database. If the table already exists, Replication Server uses the existing table after truncation.
  • init replicate table with truncate – Truncates the table at the replicate database. If the table does not exist, materialization fails.
  • init replicate table with recreate – Drops the table at the replicate database and recreates the table.
    Note Materialization does not fail if the replicate table does not already exists.
  • hold_resource_on_error – Holds the subscription resource if the subscription created with direct_load materialization results in an error. The default is not hold resource when a subscription created with the direct_load option results in an error.
  • <num_of_selects> selects – enables multiple select threads to improve the materialization performance for subscriptions created with the direct_load option. The default value is 1, and valid values are 1 – 10. You can use this option only with the direct_load option, and it is available only when the primary database is either IBM DB2 9.7 or later, or Oracle, and when the function string rs_select is not customized. This number is adjusted down to 1 otherwise, or when there are not many rows in the primary table.

See create subscription in the Reference Manual.