sp_change_log_shipping_secondary_database(Transact-SQL)

보조 데이터베이스 설정을 변경합니다.

항목 링크 아이콘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']

인수

  • [ @restore_delay = ] 'restore_delay'
    지정된 백업 파일을 복원하기까지 보조 서버가 대기하는 시간(분)입니다. restore_delayint이며 NULL일 수 없습니다. 기본값은 0입니다.
  • [ @restore_all = ] 'restore_all'
    1로 설정될 경우 보조 서버는 복원 작업 실행 시 모든 사용 가능한 트랜잭션 백업을 복원합니다. 그렇지 않으면 하나의 파일이 복원된 후 중지합니다. restore_allbit이며 NULL일 수 없습니다.
  • [ @restore_mode = ] 'restore_mode'
    보조 데이터베이스의 복원 모드입니다.

    0 = NORECOVERY로 로그를 복원합니다.

    1 = STANDBY로 로그를 복원합니다.

    restorebit이며 NULL일 수 없습니다.

  • [ @disconnect_users = ] 'disconnect_users'
    1로 설정될 경우 복원 작업 수행 시 보조 데이터베이스에서 사용자 연결이 끊어집니다. 기본값은 0입니다. disconnect_usersbit이며 NULL일 수 없습니다.
  • [ @block_size = ] 'block_size'
    백업 장치의 블록 크기로 사용되는 크기(바이트)입니다. block_sizeint이며 기본값은 -1입니다.
  • [ @buffer_count = ] 'buffer_count'
    백업 또는 복원 작업에서 사용하는 버퍼의 총 수입니다. buffer_countint이며 기본값은 -1입니다.
  • [ @max_transfer_size = ] 'max_transfer_size'
    SQL Server에서 백업 장치로 발급하는 최대 입력 또는 출력 요청의 크기(바이트)입니다. max_transfersizeint이며 NULL일 수 있습니다.
  • [ @restore_threshold = ] 'restore_threshold'
    복원 작업 간 허용되는 시간(분)입니다. 이 시간이 지나면 경고가 발생합니다. restore_thresholdint이며 NULL일 수 없습니다.
  • [ @threshold_alert = ] 'threshold_alert'
    백업 임계값이 초과될 때 발생하는 경고입니다. threshold_alertint이며 기본값은 14420입니다.
  • [ @threshold_alert_enabled = ] 'threshold_alert_enabled'
    backup_threshold가 초과될 때 경보 발생 여부를 지정합니다. 1은 설정, 0은 해제를 나타냅니다. threshold_alert_enabledbit이며 NULL일 수 없습니다.
  • [ @history_retention_period = ] 'history_retention_period'
    기록이 보존되는 기간(분)입니다. history_retention_periodint입니다. 값이 지정되지 않으면 1440이 사용됩니다.

반환 코드 값

0(성공) 또는 1(실패)

결과 집합

없음

주의

sp_change_log_shipping_secondary_database는 보조 서버의 master 데이터베이스에서 실행되어야 합니다. 이 저장 프로시저는 다음을 수행합니다.

  1. 필요에 따라 log_shipping_secondary_database 레코드의 설정을 변경합니다.
  2. 필요한 경우 제공된 인수를 사용하여 보조 서버에 있는 log_shipping_monitor_secondary의 로컬 모니터 레코드를 변경합니다.

사용 권한

sysadmin 고정 서버 역할의 멤버만 이 프로시저를 실행할 수 있습니다.

다음 예에서는 sp_change_log_shipping_secondary_database를 사용하여 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

참고 항목

참조

시스템 저장 프로시저(Transact-SQL)

관련 자료

로그 전달
로그 전달 테이블 및 저장 프로시저

도움말 및 정보

SQL Server 2005 지원 받기