sp_change_log_shipping_secondary_database(Transact-SQL)
적용 대상: SQL Server
보조 데이터베이스 설정을 변경합니다.
구문
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_delay int이며 NULL일 수 없습니다. 기본값은 0입니다.
[ @restore_all = ] 'restore_all'
1로 설정하면 복원 작업이 실행되면 보조 서버가 사용 가능한 모든 트랜잭션 로그 백업을 복원합니다. 그렇지 않으면 하나의 파일이 복원된 후 중지됩니다. restore_all 비트이며 NULL일 수 없습니다.
[ @restore_mode = ] 'restore_mode'
보조 데이터베이스의 복원 모드입니다.
0 = NORECOVERY를 사용하여 로그를 복원합니다.
1 = STANDBY로 로그 복원
restore는 비트이며 NULL일 수 없습니다.
[ @disconnect_users = ] 'disconnect_users'
1로 설정하면 복원 작업이 수행될 때 보조 데이터베이스에서 사용자의 연결이 끊어집니다. 기본값 = 0. disconnect_users 비트이며 NULL일 수 없습니다.
[ @block_size = ] 'block_size'
백업 디바이스의 블록 크기로 사용되는 크기(바이트)입니다. block_size 기본값이 -1인 int입니다.
[ @buffer_count = ] 'buffer_count'
백업 또는 복원 작업에서 사용하는 총 버퍼 수입니다. buffer_count 기본값이 -1인 int입니다.
[ @max_transfer_size = ] 'max_transfer_size'
SQL Server에서 백업 디바이스에 발급한 최대 입력 또는 출력 요청의 크기(바이트)입니다. max_transfersize int이며 NULL일 수 있습니다.
[ @restore_threshold = ] 'restore_threshold'
경고가 생성되기 전에 복원 작업 간에 경과할 수 있는 시간(분)입니다. restore_threshold int이며 NULL일 수 없습니다.
[ @threshold_alert = ] 'threshold_alert'
복원 임계값을 초과할 때 발생할 경고입니다. threshold_alert int이며 기본값은 14421입니다.
[ @threshold_alert_enabled = ] 'threshold_alert_enabled'
restore_threshold초과할 때 경고가 발생할지 여부를 지정합니다. 1 = 사용; 0 = 사용 안 함 threshold_alert_enabled 비트이며 NULL일 수 없습니다.
[ @history_retention_period = ] 'history_retention_period'
기록이 보존되는 시간(분)입니다. history_retention_period int입니다. 지정하지 않으면 1440 값이 사용됩니다.
반환 코드 값
0(성공) 또는 1(실패)
결과 집합
None
설명
sp_change_log_shipping_secondary_database 보조 서버의 master 데이터베이스에서 실행해야 합니다. 이 저장 프로시저는 다음을 수행합니다.
필요에 따라 log_shipping_secondary_database 레코드의 설정을 변경합니다.
필요한 경우 제공된 인수를 사용하여 보조 서버의 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;
참고 항목
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기