How to: Initialize a Subscription Manually (Replication Transact-SQL Programming)

While the initial snapshot is normally used to initialize a subscription, subscriptions to publications can be initialized without using a snapshot, provided that the schema and initial data are already present at the subscriber.

ms147897.note(ko-kr,SQL.90).gif중요:
If there is activity on a database published using transactional replication between the time data and schema are copied to the Subscriber and the time at which the subscription is manually initialized, changes resulting from this activity might not be replicated to the Subscriber.

Subscriptions can be initialized manually using replication stored procedures.

To manually initialize a pull subscription to a transactional publication

  1. Ensure that the schema and data exist on the subscription database. For more information, see 스냅숏 없이 트랜잭션 구독 초기화.

  2. At the Publisher on the publication database, execute sp_addsubscription. Specify @publication, @subscriber, the name of the database at the Subscriber containing the published data for @destination_db, a value of pull for @subscription_type, and a value of replication support only for @sync_type. For more information, see 방법: 끌어오기 구독 만들기(Replication Transact-SQL Programming).

  3. At the Subscriber, execute sp_addpullsubscription. For updating subscriptions, see How to: Create an Updatable Subscription to a Transactional Publication (Replication Transact-SQL Programming).

  4. At the Subscriber, execute sp_addpullsubscription_agent. For more information, see 방법: 끌어오기 구독 만들기(Replication Transact-SQL Programming).

  5. Start the Distribution Agent to transfer replication objects and download the latest changes from the Publisher. For more information, see 방법: 끌어오기 구독 동기화(Replication Programming).

To manually initialize a push subscription to a transactional publication

  1. Ensure that the schema and data exist on the subscription database. For more information, see 스냅숏 없이 트랜잭션 구독 초기화.

  2. At the Publisher on the publication database, execute sp_addsubscription. Specify the name of the database at the Subscriber containing the published data for @destination_db, a value of push for @subscription_type, and a value of replication support only for @sync_type. For updating subscriptions, see How to: Create an Updatable Subscription to a Transactional Publication (Replication Transact-SQL Programming).

  3. At the Publisher on the publication database, execute sp_addpushsubscription_agent. For more information, see 방법: 밀어넣기 구독 만들기(Replication Transact-SQL Programming).

  4. Start the Distribution Agent to transfer replication objects and download the latest changes from the Publisher. For more information, see 방법: 밀어넣기 구독 동기화(Replication Programming).

To manually initialize a pull subscription to a merge publication

  1. Ensure that the schema and data exist on the subscription database. This can be done by restoring a backup of the publication database at the Subscriber. For more information, see 스냅숏 없이 병합 구독 초기화.

  2. At the Publisher, execute sp_addmergesubscription. Specify @publication, @subscriber, @subscriber_db, and a value of pull for @subscription_type. This registers the pull subscription.

  3. At the Subscriber on the database containing the published data, execute sp_addmergepullsubscription. Specify a value of none for @sync_type.

  4. At the Subscriber, execute sp_addmergepullsubscription_agent. For more information, see 방법: 끌어오기 구독 만들기(Replication Transact-SQL Programming).

  5. Start the Merge Agent to transfer replication objects and download the latest changes from the Publisher. For more information, see 방법: 끌어오기 구독 동기화(Replication Programming).

To manually initialize a push subscription to a merge publication

  1. Ensure that the schema and data exist on the subscription database. This can be done by restoring a backup of the publication database at the Subscriber. For more information, see 스냅숏 없이 병합 구독 초기화.

  2. At the Publisher on the publication database, execute sp_addmergesubscription. Specify the name of the database at the Subscriber containing the published data for @subscriber_db, a value of push for @subscription_type, and a value of none for @sync_type.

  3. At the Publisher on the publication database, execute sp_addmergepushsubscription_agent. For more information, see 방법: 밀어넣기 구독 만들기(Replication Transact-SQL Programming).

  4. Start the Merge Agent to transfer replication objects and download the latest changes from the Publisher. For more information, see 방법: 밀어넣기 구독 동기화(Replication Programming).

참고 항목

관련 자료

복제된 데이터베이스 백업 및 복원
방법: 수동으로 구독 초기화(SQL Server Management Studio)
스냅숏 없이 병합 구독 초기화
스냅숏 없이 트랜잭션 구독 초기화

도움말 및 정보

SQL Server 2005 지원 받기