Udostępnij za pośrednictwem


sp_change_log_shipping_secondary_database (Transact-SQL)

Zmienia ustawienia pomocnicza baza danych.

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

sp_change_log_shipping_secondary_database
[ @secondary_database = ] 'secondary_database',
[, [ @restore_delay = ] 'restore_delay']
[, [ @restore_all = ] 'restore_all']
[, [ @restore_mode = ] 'restore_mode']
[, [ @disconnect_users = ] 'disconnect_users']
[, [ @block_size = ] 'block_size']
[, [ @buffer_count = ] 'buffer_count']
[, [ @max_transfer_size = ] 'max_transfer_size']
[, [ @restore_threshold = ] 'restore_threshold'] 
[, [ @threshold_alert = ] 'threshold_alert'] 
[, [ @threshold_alert_enabled = ] 'threshold_alert_enabled'] 
[, [ @history_retention_period = ] 'history_retention_period']

Argumenty

  • [ @ restore_delay = „restore_delay"
    The amount of time, in minutes, that the secondary server waits before restoring a given backup file.restore_delay is int and cannot be NULL.Wartość domyślna to 0.

  • [ @ restore_all = „restore_all"
    Jeśli zestaw na 1, serwer pomocniczy przywraca wszystkie kopie zapasowe dziennik transakcji dostępny po uruchomieniu zadanie przywracanie.Otherwise, it stops after one file has been restored.restore_all is bit and cannot be NULL.

  • [ @ restore_mode = „restore_mode"
    Tryb przywracanie dla pomocnicza baza danych.

    0 = dziennika przywracanie z NORECOVERY.

    1 = dziennika przywracanie z STANDBY.

    restore jest bit i nie może mieć wartości NULL.

  • [ @ disconnect_users = „disconnect_users"
    Jeśli zestaw na 1, użytkownicy jest odłączony od pomocnicza baza danych podczas operacji przywracanie.Default = 0.disconnect_users is bit and cannot be NULL.

  • [ @ block_size = „block_size"
    The size, in bytes, that is used as the block size for the backup device.block_size is int with a default value of -1.

  • [ @ buffer_count = „buffer_count"
    The total number of buffers used by the backup or restore operation.buffer_count is int with a default value of -1.

  • [ @ max_transfer_size = „max_transfer_size"
    The size, in bytes, of the maximum input or output request which is issued by SQL Server to the backup device.max_transfersize is int and can be NULL.

  • [ @ restore_threshold = „restore_threshold"
    The number of minutes allowed to elapse between restore operations before an alert is generated.restore_threshold is int and cannot be NULL.

  • [ @ threshold_alert = „threshold_alert"
    Is the alert to be raised when the backup threshold is exceeded.threshold_alert is int, with a default of 14420.

  • [ @ threshold_alert_enabled = „threshold_alert_enabled"
    Określa, czy alert ma być uruchamiany, gdy backup_threshold został przekroczony. 1 = enabled; 0 = disabled.threshold_alert_enabled is bit and cannot be NULL.

  • [ @ history_retention_period = „history_retention_period"
    Is the length of time in minutes in which the history will be retained.history_retention_period is int.Wartość równą 1440 użyte są nieokreślone.

Wartości kodów powrotnych

0 (sukces) lub 1 (brak)

Zestawy wyników

None

Remarks

sp_change_log_shipping_secondary_database musi być uruchamiane wzorzec bazy danych serwer pomocniczy.Ta procedura przechowywana wykonuje następujące czynności:

  1. Zmienia ustawienia w log_shipping_secondary_database rekordy, w razie potrzeby.

  2. Zmienia się rekord monitor lokalny log_shipping_monitor_secondary serwer pomocniczy, przy użyciu dostarczonych argumentów, jeśli to konieczne.

Uprawnienia

Tylko członkowie sysadmin roli serwera stałe można uruchomić tę procedurę.

Przykłady

Ten przykład ilustruje przy użyciu sp_change_log_shipping_secondary_database zaktualizować parametry pomocnicza baza danych dla bazy danych LogShipAdventureWorks.

EXEC master.dbo.sp_change_log_shipping_secondary_database 
 @secondary_database =  'LogShipAdventureWorks'
,  @restore_delay = 0
,  @restore_all = 1
,  @restore_mode = 0
,  @disconnect_users = 0
,  @threshold_alert = 14420
,  @threshold_alert_enabled = 1
,  @history_retention_period = 14420