sp_addpullsubscription_agent (Transact-SQL)

Dodaje nowe zadanie zaplanowane agenta, używane do synchronizacji subskrypcja ściąganej transakcyjnych publikacja.Ta procedura przechowywana jest wykonywany przez subskrybent do baza danych subskrypcja.

Topic link iconKonwencje składni języka Transact-SQL

sp_addpullsubscription_agent [ @publisher = ] 'publisher'
    [ , [ @publisher_db = ] 'publisher_db' ]
        , [ @publication = ] 'publication'
    [ , [ @subscriber = ] 'subscriber' ]
    [ , [ @subscriber_db = ] 'subscriber_db' ]
    [ , [ @subscriber_security_mode = ] subscriber_security_mode ]
    [ , [ @subscriber_login = ] 'subscriber_login' ]
    [ , [ @subscriber_password = ] 'subscriber_password' ]
    [ , [ @distributor = ] 'distributor' ]
    [ , [ @distribution_db = ] 'distribution_db' ]
    [ , [ @distributor_security_mode = ] distributor_security_mode ]
    [ , [ @distributor_login = ] 'distributor_login' ]
    [ , [ @distributor_password = ] 'distributor_password' ]
    [ , [ @optional_command_line = ] 'optional_command_line' ]
    [ , [ @frequency_type = ] frequency_type ]
    [ , [ @frequency_interval = ] frequency_interval ]
    [ , [ @frequency_relative_interval = ] frequency_relative_interval ]
    [ , [ @frequency_recurrence_factor = ] frequency_recurrence_factor ]
    [ , [ @frequency_subda y= ] 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 ]
    [ , [ @distribution_jobid = ] distribution_jobid OUTPUT ]
    [ , [ @encrypted_distributor_password = ] encrypted_distributor_password ]
    [ , [ @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' ]
    [ , [ @publication_type = ] publication_type ]
    [ , [ @dts_package_name = ] 'dts_package_name' ]
    [ , [ @dts_package_password = ] 'dts_package_password' ]
    [ , [ @dts_package_location = ] 'dts_package_location' ]
    [ , [ @reserved = ] 'reserved' ]
    [ , [ @offloadagent = ] 'remote_agent_activation' ]
    [ , [ @offloadserver = ] 'remote_agent_server_name']
    [ , [ @job_name = ] 'job_name' ]
    [ , [ @job_login = ] 'job_login' ] 
    [ , [ @job_password = ] 'job_password' ] 

Argumenty

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

  • [ @publisher_db=] **'**publisher_db'
    Is the name of the Publisher database.publisher_db is sysname, with a default value of NULL.publisher_db is ignored by Oracle Publishers.

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

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

    Uwaga

    Tego parametru została zastąpiona i jest utrzymywana w celu zapewnienia zgodności z poprzednimi wersjami skryptów.

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

    Uwaga

    Tego parametru została zastąpiona i jest utrzymywana w celu zapewnienia zgodności z poprzednimi wersjami skryptów.

  • [ @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 NULL.0 Określa, SQL Server Uwierzytelnianie. 1 Określa uwierzytelnianie systemu Windows.

    Uwaga

    Tego parametru została zastąpiona i jest utrzymywana w celu zapewnienia zgodności z poprzednimi wersjami skryptów.Agent dystrybucji zawsze łączy się z lokalnym subskrybent przy użyciu uwierzytelnianie systemu Windows.Jeśli wartość inną niż NULL lub 1 określono tego parametru, zwracany jest komunikat ostrzegawczy.

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

    Uwaga

    Tego parametru została zastąpiona i jest utrzymywana w celu zapewnienia zgodności z poprzednimi wersjami skryptów.Jeżeli określono wartość tego parametru, zwracany jest komunikat ostrzegawczy, ale wartość jest ignorowana.

  • [ @subscriber_password=] 'subscriber_password'
    Is the Subscriber password.subscriber_password is required if subscriber_security_mode is set to 0.subscriber_password is sysname, with a default of NULL.Jeśli używane jest hasło abonenta, są automatycznie szyfrowane.

    Uwaga

    Tego parametru została zastąpiona i jest utrzymywana w celu zapewnienia zgodności z poprzednimi wersjami skryptów.Jeżeli określono wartość tego parametru, zwracany jest komunikat ostrzegawczy, ale wartość jest ignorowana.

  • [ @distributor=] 'distributor'
    Is the name of the Distributor.distributor is sysname, with a default of the value specified by publisher.

  • [ @distribution_db=] 'distribution_db'
    Is the name of the distribution database.distribution_db is sysname, with a default value of NULL.

  • [ @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 1. 0 Określa, SQL Server Uwierzytelnianie. 1 Określa uwierzytelnianie systemu Windows.

    Security noteSecurity Note:

    When possible, use Windows Authentication.

  • [ @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.

    Security noteSecurity Note:

    Nie należy używać pustego hasła.Należy używać silnego hasła.Jeśli jest to możliwe, monituje użytkowników o wprowadzenie poświadczenia zabezpieczeń w czasie wykonywania.Jeśli poświadczenia muszą być przechowywane w pliku skryptu, należy zabezpieczyć plik, aby uniemożliwić nieautoryzowany dostęp.

  • [ @optional_command_line=] 'optional_command_line'
    Opcjonalne wiersz polecenia jest dostarczany do agenta dystrybucji.For example, -DefinitionFile C:\Distdef.txt or -CommitBatchSize 10.optional_command_line is nvarchar(4000), with a default of empty string.

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

    Wartość

    Description

    1

    Jeden raz

    2 (domyślnie)

    Na żądanie

    4

    Dzienne

    8

    Co tydzień

    16

    Miesięczne

    32

    Względna miesięczne

    64

    Autostart

    128

    Cykliczne

    Uwaga

    Określanie wartości 64 powoduje, że Agent dystrybucji do pracy w trybie ciągłym.Odpowiada to ustawieniu -Ciągłe parametr dla agenta.Aby uzyskać więcej informacji zobacz Replication Distribution Agent.

  • [ @frequency_interval=] frequency_interval
    Is the value to apply to the frequency set by frequency_type.frequency_interval is int, with a default of 1.

  • [ @frequency_relative_interval=] frequency_relative_interval
    Jest to data Agent dystrybucji.This parameter is used when frequency_type is set to 32 (monthly relative).frequency_relative_interval is int, and can be one of the following values.

    Wartość

    Description

    1 (domyślnie)

    First

    2

    Sekundy

    4

    Trzecia

    8

    Czwarty

    16

    Last

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

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

    Wartość

    Description

    1 (domyślnie)

    Tylko raz

    2

    Sekundy

    4

    Minuta

    8

    Godziny

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

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

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

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

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

  • [ @distribution_jobid =] distribution_jobidOUTPUT
    Is the ID of the Distribution Agent for this job.distribution_jobid is binary(16), with a default of NULL, and it is an OUTPUT parameter.

  • [ @encrypted_distributor_password=] encrypted_distributor_password
    Ustawienie encrypted_distributor_password nie jest już obsługiwany. Podjęto próbę zestaw to bit Parametr 1 spowoduje błąd.

  • [ @enabled_for_syncmgr=] 'enabled_for_syncmgr'
    Is whether the subscription can be synchronized through Microsoft Synchronization Manager.enabled_for_syncmgr is nvarchar(5), with a default of FALSE.Jeśli false, subskrypcja nie został zarejestrowany z menedżer synchronizacji. Jeśli true, subskrypcja jest zarejestrowany z menedżer synchronizacji i mogą być synchronizowane bez konieczności uruchamiania SQL Server Management Studio.

  • [ @ftp_address=] 'ftp_address'
    Tylko zgodność z poprzednimi wersjami.

  • [ @ftp_port=] ftp_port
    Tylko zgodność z poprzednimi wersjami.

  • [ @ftp_login=] 'ftp_login'
    Tylko zgodność z poprzednimi wersjami.

  • [ @ftp_password=] 'ftp_password'
    Tylko zgodność z poprzednimi wersjami.

  • [ @alt_snapshot_folder= ] **'**alternate_snapshot_folder'
    Specifies the location of the alternate folder for the snapshot.alternate_snapshot_folder is nvarchar(255), with a default of NULL.

  • [ @ working_directory= ] "working_director'
    Is the name of the working directory used to store data and schema files for the publication.working_directory is nvarchar(255), with a default of NULL.Nazwa powinna być określona w formacie UNC.

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

  • [ @ publication_type = ] publication_type
    Specifies the replication type of the publication.publication_type is a tinyint with a default of 0.Jeśli 0, publikacja jest typ transakcji.Jeśli 1, publikacja jest migawka.Jeśli 2, publikacja jest rodzajem korespondencji seryjnej.

  • [ @ dts_package_name= ] "dts_package_name'
    Specifies the name of the DTS package.dts_package_name is a sysname with a default of NULL.Na przykład, aby określić pakiet DTSPub_Package, ten parametr może być @dts\_package\_name = N'DTSPub_Package'.

  • [ @ dts_package_password= ] "dts_package_password'
    Specifies the password on the package, if there is one.dts_package_password is sysname with a default of NULL, which means a password is not on the package.

    Uwaga

    Jeśli musisz określić hasło dts_package_name jest określony.

  • [ @ dts_package_location= ] "dts_package_location'
    Specifies the package location.dts_package_location is a nvarchar(12), with a default of subscriber.Być może lokalizacja pakiet dystrybutor or Subskrybent.

  • [ @ zarezerwowane= ] "reserved'
    Identified for informational purposes only. Not supported. Future compatibility is not guaranteed.

  • [ @ offloadagent= ] 'remote_agent_activation"

    Uwaga

    Aktywacja agenta zdalnego została zastąpiona i nie jest już obsługiwany.Ten parametr jest obsługiwany tylko w celu zachowania zgodności ze starszymi wersjami skryptów.Ustawienie remote_agent_activation wartość inną niż false spowoduje wystąpienie błędu.

  • [ @ offloadserver= ] 'remote_agent_server_name"

    Uwaga

    Aktywacja agenta zdalnego została zastąpiona i nie jest już obsługiwany.Ten parametr jest obsługiwany tylko w celu zachowania zgodności ze starszymi wersjami skryptów.Ustawienie remote_agent_server_name do każdej wartości NULL nie spowoduje wystąpienie błędu.

  • [ @ job_name= ] 'job_name"
    Is the name of an existing agent job.job_name is sysname, with a default value of NULL.Ten parametr jest określony tylko wtedy, gdy subskrypcja zostaną zsynchronizowane przy użyciu istniejącego zadanie, a nie do nowo utworzonego zadanie (ustawienie domyślne).Jeśli nie jesteś członkiem sysadmin roli serwera stałe, należy określić job_login i job_password Po określeniu job_name.

  • [ @ job_login= ] "job_login'
    Is the login for the Windows account under which the agent runs.job_login is nvarchar(257), with no default.To konto systemu Windows jest zawsze używana dla połączeń agenta subskrybent.

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

    Security noteSecurity Note:

    Jeśli jest to możliwe, monituje użytkowników o wprowadzenie poświadczenia zabezpieczeń w czasie wykonywania.Jeśli poświadczenia muszą być przechowywane w pliku skryptu, należy zabezpieczyć plik, aby uniemożliwić nieautoryzowany dostęp.

Wartości kodów powrotnych

0 (sukces) lub 1 (brak)

Remarks

sp_addpullsubscription_agent jest używana w przypadku replikacja migawka i replikacji transakcyjnej.

Uprawnienia

Tylko członkowie sysadmin Rola serwera lub db_owner ustalone rola bazy danych mogą być wykonać sp_addpullsubscription_agent.