Aracılığıyla paylaş


sp_addpublication_snapshot (Transact-SQL)

Anlık Görüntü Aracısı belirtilen yayın oluşturur.Bu saklı yordam, yayın Veritabanı yayımcısına sırasında yürütülür.

Security noteSecurity Note:

Yayımcı, uzak Dağıtımcı, tüm parametreleri için sağlanan değerler ile yapılandırılırken dahil job_login ve job_password, dağıtıcı düz metin olarak gönderilir. Bu saklı yordamını çalıştırmadan önce yayımcısına uzak Dağıtımcı arasındaki bağlantı şifreleme.Daha fazla bilgi için bkz: SQL Server bağlantıları için şifreleme.

Topic link iconTransact-SQL sözdizimi kuralları

sp_addpublication_snapshot [ @publication= ] 'publication'
    [ , [ @frequency_type= ] frequency_type ]
    [ , [ @frequency_interval= ] frequency_interval ]
    [ , [ @frequency_subday= ] frequency_subday ]
    [ , [ @frequency_subday_interval= ] frequency_subday_interval ]
    [ , [ @frequency_relative_interval= ] frequency_relative_interval ]
    [ , [ @frequency_recurrence_factor= ] frequency_recurrence_factor ]
    [ , [ @active_start_date= ] active_start_date ]
    [ , [ @active_end_date= ] active_end_date ]
    [ , [ @active_start_time_of_day= ] active_start_time_of_day ]
    [ , [ @active_end_time_of_day= ] active_end_time_of_day ]
    [ , [ @snapshot_job_name = ] 'snapshot_agent_name' ]
    [ , [ @publisher_security_mode = ] publisher_security_mode ]
    [ , [ @publisher_login = ] 'publisher_login' ]
    [ , [ @publisher_password = ] 'publisher_password' ] 
    [ , [ @job_login = ] 'job_login' ]
    [ , [ @job_password = ] 'job_password' ]
    [ , [ @publisher = ] 'publisher' ]

Bağımsız değişkenler

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

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

    Değer

    Açıklama

    1

    Bir kez.

    4 (varsayılan)

    Günlük.

    8

    Haftalık.

    16

    Aylık.

    32

    Aylık, frekans aralığı bağlantılıdır.

    64

    Ne zaman SQL Server Aracı'nı başlatır.

    128

    Bilgisayar boştayken çalıştırma

  • [ @frequency_interval=] frequency_interval
    Is the value to apply to the frequency set by frequency_type.frequency_interval is int, and can be one of the following values.

    Frequency_type değeri

    Frequency_interval etkisi

    1

    frequency_interval kullanılmaz.

    4 (varsayılan)

    Her frequency_interval Günlük, varsayılan gün.

    8

    frequency_interval bir veya daha fazlasını (birlikte bir | (Bit düzey VEYA) mantıksal işleç):

    1 = Sunday |

    2 = Monday |

    4 = Tuesday |

    8 Çarşamba = |

    16 = Thursday |

    32 = Friday |

    64 Cumartesi =

    16

    Üzerinde frequency_interval ayın günü.

    32

    frequency_interval aşağıdakilerden biridir:

    1 = Sunday |

    2 = Monday |

    3 = Tuesday |

    4 Çarşamba = |

    5 = Thursday |

    6 = Friday |

    7 = Saturday |

    8 = Day |

    9 = Weekday |

    10 = $ Hafta günü

    64

    frequency_interval kullanılmaz.

    128

    frequency_interval kullanılmaz.

  • [ @frequency_subday=] frequency_subday
    Is the unit for freq_subday_interval.frequency_subday is int, and can be one of these values.

    Değer

    Açıklama

    1

    Bir kez

    2

    Ikinci

    4 (varsayılan)

    Dakika

    8

    Saat

  • [ @frequency_subday_interval=] frequency_subday_interval
    Is the interval for frequency_subday.frequency_subday_interval is int, with a default of 5, which means every 5 minutes.

  • [ @frequency_relative_interval=] frequency_relative_interval
    Is the date the Snapshot Agent runs.frequency_relative_interval is int, with a default of 1.

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

  • [ @active_start_date=] active_start_date
    Is the date when the Snapshot 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 Snapshot Agent stops being scheduled, formatted as YYYYMMDD.active_end_date is int, with a default of 99991231, which means December 31, 9999.

  • [ @active_start_time_of_day=] active_start_time_of_day
    Is the time of day when the Snapshot 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 Snapshot Agent stops being scheduled, formatted as HHMMSS.active_end_time_of_day is int, with a default of 235959, which means 11:59:59 P.M.as measured on a 24-hour clock.

  • [ @snapshot_job_name = ] 'snapshot_agent_name'
    Is the name of an existing Snapshot Agent job name if an existing job is being used.snapshot_agent_name is nvarchar(100) with a default value of NULL.Bu parametre, dahili ve yeni bir yayın oluştururken belirtilmemelidir.If snapshot_agent_name , ardından belirtilen job_login ve job_password NULL olmalıdır.

  • [ @ publisher_security_mode= ] publisher_security_mode
    Is the security mode used by the agent when connecting to the Publisher.publisher_security_mode is smallint, with a default of 1.0 belirtir.SQL Server Kimlik doğrulaması ve 1 Windows kimlik doğrulamasını belirtir.Değeri 0 için mutlaka belirtilmeli olmayan-SQL Server Yayımcılar. When possible, use Windows Authentication.

  • [ @ publisher_login= ] 'publisher_login'
    Is the login used when connecting to the Publisher.publisher_login is sysname, with a default of NULL.publisher_login must be specified when publisher_security_mode is 0.If publisher_login null ve publisher_security_mode olan 1ve ardından içinde belirtilen Windows hesabıjob_login sunucuya bağlanırken kullanılacak Yayımcı.

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

    Security noteSecurity Note:

    kimlik doğrulaması bilgileri, komut dosyalarında depolamayın.Güvenliğini artırmanıza yardımcı olmak için , çalıştırma sırasında oturum açma adlarını ve parolaları sağlamanızı öneririz.

  • [ @ job_login= ] 'job_login'
    Is the login for the Windows account under which the agent runs.job_login is nvarchar(257), with a default of NULL.Bu Windows hesabını, her zaman dağıtımcı Aracısı bağlantılarda kullanılır.Yeni bir anlık görüntü Aracısı iş oluştururken bu parametreyi sağlamanız gerekir.

    Not

    Için olmayan-SQL Server Yayımcı, bu belirtilen aynı oturum açma olmalıdır sp_adddistpublisher (Transact-SQL).

  • [ @ job_password= ] 'job_password'
    Is the password for the Windows account under which the agent runs.job_password is sysname, and it has a default of NULL.Yeni bir anlık görüntü Aracısı iş oluştururken bu parametreyi sağlamanız gerekir.Job_password NULL ve rapor anlık görüntü görüntü görüntüsünü oluşturan kullanıcı sysadmin, parametre için SQL Server Agent altında çalıştığı hesabın varsayılan.

    Security noteSecurity Note:

    kimlik doğrulaması bilgileri, komut dosyalarında depolamayın.Güvenliğini artırmanıza yardımcı olmak için , çalıştırma sırasında oturum açma adlarını ve parolaları sağlamanızı öneririz.

  • [ Yayımcı'ın = ] 'publisher'
    Specifies a non-SQL Server Publisher.publisher is sysname, with a default of NULL.

    Not

    publisher bir anlık görüntü Aracısı en oluştururken kullanılmamalıdır bir SQL Server Yayımcı.

Dönüş Kodu Değerleri

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

Remarks

sp_addpublication_snapshot anlık görüntü çoğaltması çoğaltması, işlem çoğaltma ve birleştirme çoğaltma için kullanılır.

İzinler

Yalnızca üyeleri sysadmin sabit sunucu rolü veya db_owner sabit veritabanı rolü için yürütmek sp_addpublication_snapshot.