Aracılığıyla paylaş


sp_addmergepullsubscription_agent (Transact-SQL)

Eşitleme için birleştirme istek temelli abonelik zamanlamak için kullanılan yeni bir Aracısı iş ekler yayın.Bu saklı yordam, abonelik veritabanı abone adresindeki yürütülür.

Konu bağlantısı simgesiTransact-sql sözdizimi kuralları

Sözdizimi

sp_addmergepullsubscription_agent [ [ @name = ] 'name' ] 
        , [ @publisher = ] 'publisher' 
        , [ @publisher_db = ] 'publisher_db'
        , [ @publication =] 'publication' 
    [ , [ @publisher_security_mod e= ] publisher_security_mode ] 
    [ , [ @publisher_login = ] 'publisher_login' ] 
    [ , [ @publisher_password = ] 'publisher_password' ] 
    [ , [ @publisher_encrypted_password = ] publisher_encrypted_password ] 
    [ , [ @subscriber = ] 'subscriber' ] 
    [ , [ @subscriber_db = ] 'subscriber_db' ] 
    [ , [ @subscriber_security_mode = ] subscriber_security_mode ] 
    [ , [ @subscriber_login = ] 'subscriber_login' ] 
    [ , [ @subscriber_password= ] 'subscriber_password' ] 
    [ , [ @distributor = ] 'distributor' ] 
    [ , [ @distributor_security_mode = ] distributor_security_mode ] 
    [ , [ @distributor_login = ] 'distributor_login' ] 
    [ , [ @distributor_password = ] 'distributor_password' ] 
    [ , [ @encrypted_password = ] encrypted_password ] 
    [ , [ @frequency_type = ] frequency_type ] 
    [ , [ @frequency_interval = ] frequency_interval ] 
    [ , [ @frequency_relative_interval = ] frequency_relative_interval ] 
    [ , [ @frequency_recurrence_factor = ] frequency_recurrence_factor ] 
    [ , [ @frequency_subday = ] frequency_subday ] 
    [ , [ @frequency_subday_interval = ] frequency_subday_interval ] 
    [ , [ @active_start_time_of_day = ] active_start_time_of_day ] 
    [ , [ @active_end_time_of_day = ] active_end_time_of_day ] 
    [ , [ @active_start_date = ] active_start_date ] 
    [ , [ @active_end_date = ] active_end_date ] 
    [ , [ @optional_command_line = ] 'optional_command_line' ] 
    [ , [ @merge_jobid = ] merge_jobid ] 
    [ , [ @enabled_for_syncmgr = ] 'enabled_for_syncmgr' ] 
    [ , [ @ftp_address = ] 'ftp_address' ] 
    [ , [ @ftp_port = ] ftp_port ] 
    [ , [ @ftp_login = ] 'ftp_login' ] 
    [ , [ @ftp_password = ] 'ftp_password' ]  
    [ , [ @alt_snapshot_folder = ] 'alternate_snapshot_folder' ] 
    [ , [ @working_directory = ] 'working_directory' ] 
    [ , [ @use_ftp = ] 'use_ftp' ] 
    [ , [ @reserved = ] 'reserved' ] 
    [ , [ @use_interactive_resolver = ] 'use_interactive_resolver' ] 
    [ , [ @offloadagent = ] 'remote_agent_activation' ] 
    [ , [ @offloadserver = ] 'remote_agent_server_name'] 
    [ , [ @job_name = ] 'job_name' ] 
    [ , [ @dynamic_snapshot_location = ] 'dynamic_snapshot_location' ]
    [ , [ @use_web_sync = ] use_web_sync ]
        [ , [ @internet_url = ] 'internet_url' ]
    [ , [ @internet_login = ] 'internet_login' ]
        [ , [ @internet_password = ] 'internet_password' ]
    [ , [ @internet_security_mode = ] internet_security_mode ]
        [ , [ @internet_timeout = ] internet_timeout ]
    [ , [ @hostname = ] 'hostname' ]
        [ , [ @job_login = ] 'job_login' ] 
    [ , [ @job_password = ] 'job_password' ] 

Bağımsız değişkenler

  • [ @name = ] 'name'
    Is the name of the agent.name is sysname, with a default of NULL.

  • [ @publisher = ] 'publisher'
    Is the name of the Publisher server.publisher is sysname, with no default.

  • [ @publisher_db = ] 'publisher_db'
    Is the name of the Publisher database.publisher_db is sysname, with no default.

  • [ @publication = ] 'publication'
    Is the name of the publication.publication is sysname, with no default.

  • [ @publisher_security_mode = ] publisher_security_mode
    Is the security mode to use when connecting to a Publisher when synchronizing.publisher_security_mode is int, with a default of 1.If 0, specifies SQL Server Authentication.If 1, specifies Windows Authentication.

    Güvenlik notuGüvenlik Notu

    Mümkünse Windows Kimlik Doğrulaması kullanın.

  • [ @publisher_login = ] 'publisher_login'
    Is the login to use when connecting to a Publisher when synchronizing.publisher_login is sysname, with a default of NULL.

  • [ @publisher_password = ] 'publisher_password'
    Is the password used when connecting to the Publisher.publisher_password is sysname, with a default of NULL.

    Güvenlik notuGüvenlik Notu

    Boş parola kullanmayın. Güçlü bir parola kullanın. Mümkün olduğunda, zamanında güvenlik kimlik bilgileri bilgilerini girmesini ister.Bir komut dosyasında kimlik bilgileri bilgilerini depolamak, yetkisiz erişimi önlemek için dosyayı güvenli gerekir.

  • [ @publisher_encrypted_password = ]publisher_encrypted_password
    Ayar publisher_encrypted_password artık desteklenmiyor.Çalışırken küme bu bit parametresi 1 bir hata neden olur.

  • [ @subscriber = ] 'subscriber'
    Is the name of the Subscriber.subscriber is sysname, with a default of NULL.

  • [ @subscriber_db = ] 'subscriber_db'
    Is the name of the subscription database.subscriber_db is sysname, with a default of NULL.

  • [ @subscriber_security_mode = ] subscriber_security_mode
    Is the security mode to use when connecting to a Subscriber when synchronizing.subscriber_security_mode is int, with a default of 1.If 0, specifies SQL Server Authentication.If 1, specifies Windows Authentication.

    Not

    Bu parametre onaylanmaz ve komut dosyaları geriye dönük uyumluluk için korunur.Birleştirme Aracısı, Windows kimlik doğrulaması kullanarak yerel abone her zaman bağlanır.Bu parametre için bir değer belirtilirse, bir uyarı iletisi döndürülür, ancak değeri göz ardı edilir.

  • [ @subscriber_login = ] 'subscriber_login'
    Is the Subscriber login to use when connecting to a Subscriber when synchronizing.subscriber_login is required if subscriber_security_mode is set to 0.subscriber_login is sysname, with a default of NULL.

    Not

    Bu parametre onaylanmaz ve komut dosyaları geriye dönük uyumluluk için korunur.Bu parametre için bir değer belirtilirse, bir uyarı iletisi döndürülür, ancak değeri göz ardı edilir.

  • [ @subscriber_password = ] 'subscriber_password'
    Is the Subscriber password for SQL Server Authentication.subscriber_password is required if subscriber_security_mode is set to 0.subscriber_password is sysname, with a default of NULL.

    Not

    Bu parametre onaylanmaz ve komut dosyaları geriye dönük uyumluluk için korunur.Bu parametre için bir değer belirtilirse, bir uyarı iletisi döndürülür, ancak değeri göz ardı edilir.

  • [ @distributor = ] 'distributor'
    Is the name of the Distributor.distributor is sysname, with a default of publisher; that is, the Publisher is also the Distributor.

  • [ @distributor_security_mode = ] distributor_security_mode
    Is the security mode to use when connecting to a Distributor when synchronizing.distributor_security_mode is int, with a default of 0.0 belirtir SQL Server kimlik doğrulaması.1 Windows kimlik doğrulamasının kullanılacağını belirtir.

    Güvenlik notuGüvenlik Notu

    Mümkünse Windows Kimlik Doğrulaması kullanın.

  • [ @distributor_login = ] 'distributor_login'
    Is the Distributor login to use when connecting to a Distributor when synchronizing.distributor_login is required if distributor_security_mode is set to 0.distributor_login is sysname, with a default of NULL.

  • [ @distributor_password = ] 'distributor_password'
    Is the Distributor password.distributor_password is required if distributor_security_mode is set to 0.distributor_password is sysname, with a default of NULL.

    Güvenlik notuGüvenlik Notu

    Boş parola kullanmayın. Güçlü bir parola kullanın. Mümkün olduğunda, zamanında güvenlik kimlik bilgileri bilgilerini girmesini ister.Bir komut dosyasında kimlik bilgileri bilgilerini depolamak, yetkisiz erişimi önlemek için dosyayı güvenli gerekir.

  • [ @encrypted_password = ] encrypted_password
    Ayar encrypted_password artık desteklenmiyor.Çalışırken küme bu bit parametresi 1 bir hata neden olur.

  • [ @frequency_type = ] frequency_type
    Is the frequency with which to schedule the Merge Agent.frequency_type is int, and can be one of the following values.

    Değer

    Açıklama

    1

    Birisaat

    2

    İsteğe bağlı

    4

    Günlük

    8

    Haftalık

    16

    Aylık

    32

    Aylık göreli

    64

    Otomatik başlatma

    128

    Yinelenen

    Null(default)

     

    Not

    Değeri belirterek 64 sürekli modunda çalıştırmak Birleştirme Aracısı olur.Bu ayara karşılık gelir -sürekli Aracısı parametresi.Daha fazla bilgi için bkz: Çoğaltma Birleştirme Aracısı.

  • [ @frequency_interval = ] frequency_interval
    The day or days that the Merge Agent runs.frequency_interval is int, and can be one of these values.

    Değer

    Açıklama

    1

    Pazar

    2

    Pazartesi

    3

    Salı

    4

    Çarşamba

    5

    Perşembe

    6

    Cuma

    7

    Cumartesi

    8

    Günü

    9

    Hafta içi

    10

    Hafta sonu gün

    Null(default)

     

  • [ @frequency_relative_interval = ] frequency_relative_interval
    Olan tarih Birleştirme Aracısı.This parameter is used when frequency_type is set to 32 (monthly relative).frequency_relative_interval is int, and can be one of these values.

    Değer

    Açıklama

    1

    First

    2

    İkinci

    4

    Üçüncü

    8

    Dördüncü

    16

    Last

    Null(default)

     

  • [ @frequency_recurrence_factor = ] frequency_recurrence_factor
    Is the recurrence factor used by frequency_type.frequency_recurrence_factor is int, with a default of NULL.

  • [ @frequency_subday = ] frequency_subday
    Is how often to reschedule during the defined period.frequency_subday is int, and can be one of these values.

    Değer

    Açıklama

    1

    Bir kez

    2

    İkinci

    4

    Dakika

    8

    Saat

    Null(default)

     

  • [ @frequency_subday_interval = ] frequency_subday_interval
    Is the interval for frequency_subday.frequency_subday_interval is int, with a default of NULL.

  • [ @active_start_time_of_day=] active_start_time_of_day
    Is the time of day when the Merge Agent is first scheduled, formatted as HHMMSS.active_start_time_of_day is int, with a default of NULL.

  • [ @active_end_time_of_day = ] active_end_time_of_day
    Is the time of day when the Merge Agent stops being scheduled, formatted as HHMMSS.active_end_time_of_day is int, with a default of NULL.

  • [ @active_start_date = ] active_start_date
    Is the date when the Merge Agent is first scheduled, formatted as YYYYMMDD.active_start_date is int, with a default of NULL.

  • [ @active_end_date = ] active_end_date
    Is the date when the Merge Agent stops being scheduled, formatted as YYYYMMDD.active_end_date is int, with a default of NULL.

  • [ @optional_command_line = ] 'optional_command_line'
    Is an optional command prompt that is supplied to the Merge Agent.optional_command_line is nvarchar(255), with a default of ' '.Varsayılan sorgu saat aşımı saat için artan aşağıdaki örnekte olduğu gibi Birleştirme Aracısı için ek parametreler sağlamak için kullanılan 600 saniye:

    @optional_command_line = N'-QueryTimeOut 600'
    
  • [ @merge_jobid = ] merge_jobid
    Is the output parameter for the job ID.merge_jobid is binary(16), with a default of NULL.

  • [ @enabled_for_syncmgr = ] 'enabled_for_syncmgr'
    Specifies if the subscription can be synchronized through Windows Synchronization Manager.enabled_for_syncmgr is nvarchar(5), with a default of FALSE.If false, the subscription is not registered with Synchronization Manager.If true, the subscription is registered with Synchronization Manager and can be synchronized without starting SQL Server Management Studio.

  • [ @ftp_address = ] 'ftp_address'
    Yalnızca geriye dönük uyumluluk için.

  • [ @ftp_port = ] ftp_port
    Yalnızca geriye dönük uyumluluk için.

  • [ @ftp_login = ] 'ftp_login'
    Yalnızca geriye dönük uyumluluk için.

  • [ @ftp_password = ] 'ftp_password'
    Yalnızca geriye dönük uyumluluk için.

  • [ @alt_snapshot_folder = ] 'alternate_snapshot_folder'
    Specifies the location from which to pick up the snapshot files.alternate_snapshot_folder is nvarchar(255), with a default of NULL.null, anlık görüntü dosyaları yayımcı tarafından belirtilen varsayılan konumdan alınmayı.

  • [ @working_directory = ] 'working_directory'
    Is the name of the working directory used to temporarily store data and schema files for the publication when FTP is used to transfer snapshot files.working_directory is nvarchar(255), with a default of NULL.

  • [ @use_ftp = ] 'use_ftp'
    Specifies the use of FTP instead of the typical protocol to retrieve snapshots.use_ftp is nvarchar(5), with a default of FALSE.

  • [ @reserved = ] 'reserved'
    Yalnızca bilgi amaçlı olarak belirtilmiştir. Desteklenmez. Gelecekteki uyumluluk garanti edilmez.

  • [ @use_interactive_resolver = ] 'use_interactive_resolver' ]
    Uses interactive resolver to resolve conflicts for all articles that allow interactive resolution.use_interactive_resolver is nvarchar(5), with a default of FALSE.

  • [ @offloadagent = ] 'remote_agent_activation'

    Not

    Uzaktaki aracı etkinleştirme onaylanmaz ve artık desteklenmiyor.Bu parametre, yalnızca geriye dönük uyumluluk komut dosyaları korumak için desteklenir.Ayar remote_agent_activation dışında bir değere false generate bir hata.

  • [ @offloadserver = ] 'remote_agent_server_name'

    Not

    Uzaktaki aracı etkinleştirme onaylanmaz ve artık desteklenmiyor.Bu parametre, yalnızca geriye dönük uyumluluk komut dosyaları korumak için desteklenir.Ayar remote_agent_server_name herhangi bir boş olmayan değere üretmek bir hata.

  • [ @job_name = ] 'job_name' ]
    Is the name of an existing agent job.job_name is sysname, with a default value of NULL.Bu parametre yalnızca olur ne zaman belirtilen abonelik (varsayılan) yeni oluşturulan iş yerine varolan bir işi kullanarak eşitlenir.Üye değilseniz, sysadmin sabit sunucu rolü, belirttiğiniz gerekir job_login ve job_password , belirttiğiniz job_name.

  • [ @dynamic_snapshot_location = ] 'dynamic_snapshot_location' ]
    The path to the folder where the snapshot files will be read from if a filtered data snapshot is to be used.dynamic_snapshot_location is nvarchar(260), with a default of NULL.Daha fazla bilgi için bkz: Parametreli satır filtreleri.

  • [ @use_web_sync = ] use_web_sync
    Indicates that Web synchronization is enabled.use_web_sync is bit, with a default of 0.1 http kullanarak Internet üzerinden istek temelli abonelik eşitlenebilir belirtir.

  • [ @internet_url = ] 'internet_url'
    Is the location of the replication listener (REPLISAPI.DLL) for Web synchronization.internet_url is nvarchar(260), with a default of NULL.internet_url is a fully qualified URL, in the format http://server.domain.com/directory/replisapi.dll.Sunucu bağlantı noktası 80 dışında bir bağlantı noktası üzerinde dinleme yapmak için yapılandırılmışsa, bağlantı noktası numarası de biçiminde sağlanmalıdır http://server.domain.com:portnumber/directory/replisapi.dll, nerede portnumber bağlantı noktası temsil eder

  • [ @internet_login = ] 'internet_login'
    Is the login that the Merge Agent uses when connecting to the Web server that is hosting Web synchronization using HTTP Basic Authentication.internet_login is sysname, with a default of NULL.

  • [ @internet_password = ] 'internet_password'
    Is the password that the Merge Agent uses when connecting to the Web server that is hosting Web synchronization using HTTP Basic Authentication.internet_password is nvarchar(524), with a default value of NULL.

    Güvenlik notuGüvenlik Notu

    Boş parola kullanmayın. Güçlü bir parola kullanın.

  • [ @internet_security_mode = ] internet_security_mode
    Is the authentication method used by the Merge Agent when connecting to the Web server during Web synchronization using HTTPS.internet_security_mode is int and can be one of these values.

    Değer

    Açıklama

    0

    Temel kimlik doğrulaması kullanılır.

    1 (varsayılan)

    Windows tümleşik kimlik doğrulaması kullanılır.

    Not

    Temel kimlik doğrulaması Web üzerinden eşitleme'yle birlikte kullanmanızı öneririz.Web üzerinden eşitleme kullanmak için Web sunucusu için bir ssl bağlantısı yapmanız gerekir.Daha fazla bilgi için bkz: Web eşitleme yapılandırma.

  • [ @internet_timeout = ] internet_timeout
    Is the length of time, in seconds, before a Web synchronization request expires.internet_timeout is int, with a default of 300 seconds.

  • [ @hostname = ] 'hostname'
    Overrides the value of HOST_NAME() when this function is used in the WHERE clause of a parameterized filter.hostname is sysname, with a default of NULL.

  • [ @job_login = ] 'job_login'
    Is the login for the Windows account under which the agent runs.job_login is nvarchar(257), with no default.Bu Windows hesabını her zaman Aracısı bağlantıları için abone ve Yayımcı ve dağıtımcı bağlantı için tümleşik Windows kimlik doğrulaması kullanılırken kullanılır.

  • [ @job_password = ] 'job_password'
    Is the password for the Windows account under which the agent runs.job_password is sysname, with no default.

    Güvenlik notuGüvenlik Notu

    kimlik doğrulaması bilgilerini komut dosyalarında depolar.En iyi güvenlik için oturum açma adlarını ve parolalarını zamanında sağlanmalı.

Dönüş Kodu Değerleri

0 (başarılı) veya 1 (hata)

Açıklamalar

sp_addmergepullsubscription_agent birleştirmede kullanılan çoğaltma için benzer işlevleri kullanır ve sp_addpullsubscription_agent.

Çoğaltma aracısı güvenlik modeli arasında önemli ölçüde değiştiği SQL Server 2000.Doğru yürütürken güvenlik ayarlarını belirleme konusunda bir örnek için sp_addmergepullsubscription_agent, bkz: Nasıl yapılır: Çekme abonelik (çoğaltma Transact-sql programlama) oluştur.

Örnek

-- This script uses sqlcmd scripting variables. They are in the form
-- $(MyVariable). For information about how to use scripting variables  
-- on the command line and in SQL Server Management Studio, see the 
-- "Executing Replication Scripts" section in the topic
-- "Programming Replication Using System Stored Procedures".

-- Execute this batch at the Subscriber.
DECLARE @publication AS sysname;
DECLARE @publisher AS sysname;
DECLARE @publicationDB AS sysname;
DECLARE @hostname AS sysname;
SET @publication = N'AdvWorksSalesOrdersMerge';
SET @publisher = $(PubServer);
SET @publicationDB = N'AdventureWorks2008R2';
SET @hostname = N'adventure-works\david8';

-- At the subscription database, create a pull subscription 
-- to a merge publication.
USE [AdventureWorks2008R2Replica]
EXEC sp_addmergepullsubscription 
  @publisher = @publisher, 
  @publication = @publication, 
  @publisher_db = @publicationDB;

-- Add an agent job to synchronize the pull subscription. 
EXEC sp_addmergepullsubscription_agent 
  @publisher = @publisher, 
  @publisher_db = @publicationDB, 
  @publication = @publication, 
  @distributor = @publisher, 
  @job_login = $(Login), 
  @job_password = $(Password),
  @hostname = @hostname;
GO

İzinler

Yalnızca üyeleri sysadmin sabit sunucu rolü veya db_owner sabit veritabanı rolü olabilir yürütmek sp_addmergepullsubscription_agent.