Aracılığıyla paylaş


sp_adddistributiondb (Transact-SQL)

Yeni bir dağıtım veritabanı oluşturur ve dağıtımcı şema yükler.dağıtım veritabanı, yordamlar ve şema meta veriler çoğaltmaya kullanılan depolar.Bu saklı yordam dağıtım veritabanı oluşturup, gerekli tabloları ve çoğaltma dağıtım etkinleştirmek için gereken saklı yordamlar yüklemek için asıl veritabanı dağıtımcı sırasında yürütülür.

Topic link iconTransact-SQL sözdizimi kuralları

sp_adddistributiondb [ @database= ] 'database' 
    [ , [ @data_folder= ] 'data_folder' ] 
    [ , [ @data_file= ] 'data_file' ] 
    [ , [ @data_file_size= ] data_file_size ] 
    [ , [ @log_folder= ] 'log_folder' ] 
    [ , [ @log_file= ] 'log_file' ] 
    [ , [ @log_file_size= ] log_file_size ] 
    [ , [ @min_distretention= ] min_distretention ] 
    [ , [ @max_distretention= ] max_distretention ] 
    [ , [ @history_retention= ] history_retention ] 
    [ , [ @security_mode= ] security_mode ] 
    [ , [ @login= ] 'login' ] 
    [ , [ @password= ] 'password' ] 
    [ , [ @createmode= ] createmode ]
    [ , [ @from_scripting = ] from_scripting ]

Bağımsız değişkenler

  • [ @database=] database'
    Is the name of the distribution database to be created.database is sysname, with no default.Belirtilen veritabanı zaten var ve bir dağıtım veritabanı işaretli değil, dağıtım etkinleştirmek için gereken nesneleri daha sonra yüklenir ve veritabanı Dağıtım veritabanı olarak işaretlendi.Belirtilen veritabanı Dağıtım veritabanı olarak zaten etkinse, bir hata döndürülür.

  • [ @data_folder=] **'**data_folder'
    Is the name of the directory used to store the distribution database data file.data_folder is nvarchar(255), with a default of NULL.If NULL, the data directory for that instance of Microsoft SQL Server is used, for example, C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Data.

  • [ @data_file=] 'data_file'
    Is the name of the database file.data_file is nvarchar(255), with a default of database.null ise, saklı yordam bir veritabanı adı kullanarak bir dosya adı oluşturur.

  • [ @data_file_size=] data_file_size
    Is the initial data file size in megabytes (MB).data_file_size is int, with a default of 5MB.

  • [ @log_folder=] 'log_folder'
    Is the name of the directory for the database log file.log_folder is nvarchar(255), with a default of NULL.NULL,'ın bu örneğinin veri dizini SQL Server (örneğin, kullanılır C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Data).

  • [ @log_file=] 'log_file'
    Is the name of the log file.log_file is nvarchar(255), with a default of NULL.null ise, saklı yordam bir veritabanı adı kullanarak bir dosya adı oluşturur.

  • [ @log_file_size=] log_file_size
    Is the initial log file size in megabytes (MB).log_file_size is int, with a default of 0 MB, which means the file size is created using the smallest log file size allowed by SQL Server.

  • [ @min_distretention=] min_distretention
    Is the minimum retention period, in hours, before transactions are deleted from the distribution database.min_distretention is int, with a default of 0 hours.

  • [ @max_distretention=] max_distretention
    Is the maximum retention period, in hours, before transactions are deleted.max_distretention is int, with a default of 72 hours.En büyük dağıtım saklama süresi eski olan yinelenmiş komutları aldığınız abonelikler etkin olarak işaretlenir ve yeniden gerekir.RAISERROR 21011 etkin olmayan her abonelik için verilir.Değeri 0 hareketleri yinelenmiş anlamına gelir, depolanmayan dağıtım veritabanı.

  • [ @history_retention=] history_retention
    Is the number of hours to retain history.history_retention is int, with a default of 48 hours.

  • [ @security_mode=] security_mode
    Is the security mode to use when connecting to the Distributor.security_mode is int, with a default of 1.0 belirtir.SQL Server kimlik doğrulaması; 1 Windows tümleşik kimlik doğrulamasını belirtir.

  • [ @login=] 'login'
    Oturum açma adı, dağıtımcı olarak bağlanırken, dağıtım veritabanı oluşturmak için kullanılır.This is required if security_mode is set to 0.login is sysname, with a default of NULL.

  • [ @password=] 'password'
    Parola, dağıtımcı olarak bağlanırken kullanılır.Gereklidir security_mode olan küme için 0. password olan sysname, varsayılan değeri NULL ile.

  • [ @createmode=] createmode
    createmode olan int, varsayılan 1 ' in ve aşağıdaki değerlerden biri olabilir.

    Değer

    Açıklama

    0

    Identified for informational purposes only. Not supported. Future compatibility is not guaranteed.

    1 (varsayılan)

    DATABASE CREATE veya varolan veritabanını kullan ve uygulayın Instdist.SQL dosyası dağıtım veritabanında çoğaltma nesneleri oluşturmak için.

    2

    Identified for informational purposes only. Not supported. Future compatibility is not guaranteed.

  • [ @from_scripting = ] from_scripting
    Identified for informational purposes only. Not supported. Future compatibility is not guaranteed.

Dönüş Kodu Değerleri

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

Remarks

sp_adddistributiondb çoğaltma tüm türleri kullanılır.Ancak, bu saklı yordam, yalnızca bir dağıtımcı çalışır.

Yürüterek dağıtımcı yapılandırmalısınız. sp_adddistributor çalıştırmadan öncesp_adddistributiondb.

Çalışma sp_adddistributor ' nı çalıştırmak için öncesp_adddistributiondb.

İzinler

Yalnızca üyeleri sysadmin sabit sunucu rolü çalıştırabilirsinizsp_adddistributiondb.