备份首选项 |
备份模式 |
备份节点:主副本 |
备份节点:辅助副本 |
||
normal |
copy_only |
normal |
copy_only |
||
首选辅助副本 |
FULL |
√ |
√ |
× |
√ |
DIFF |
√ |
√ |
× |
√ |
|
LOG |
√ |
√ |
√ |
× |
|
仅辅助副本 |
FULL |
√ |
√ |
× |
√ |
DIFF |
√ |
√ |
× |
√ |
|
LOG |
√ |
√ |
√ |
× |
|
主副本 |
FULL |
√ |
√ |
× |
√ |
DIFF |
√ |
√ |
× |
√ |
|
LOG |
√ |
√ |
√ |
× |
|
任意副本 |
FULL |
√ |
√ |
× |
√ |
DIFF |
√ |
√ |
× |
√ |
|
LOG |
√ |
√ |
√ |
× |
备份首选项 |
备份模式 |
备份节点:主副本 |
备份节点:辅助副本 |
||
normal |
copy_only |
normal |
copy_only |
||
首选辅助副本 |
FULL |
√ |
√ |
× |
√ |
DIFF |
√ |
√ |
× |
√ |
|
LOG |
√ |
√ |
√ |
× |
|
仅辅助副本 |
FULL |
√ |
√ |
× |
√ |
DIFF |
√ |
√ |
× |
√ |
|
LOG |
√ |
√ |
√ |
× |
|
主副本 |
FULL |
√ |
√ |
× |
√ |
DIFF |
√ |
√ |
× |
√ |
|
LOG |
√ |
√ |
√ |
× |
|
任意副本 |
FULL |
√ |
√ |
× |
√ |
DIFF |
√ |
√ |
× |
√ |
|
LOG |
√ |
√ |
× |
√ |
以上表格汇总:
备份首选项 |
备份模式 |
备份节点:主副本 |
备份节点:辅助副本 |
||
normal |
copy_only |
normal |
copy_only |
||
首选辅助副本 |
FULL |
√ |
√ |
× |
√ |
DIFF |
√ |
√ |
× |
√无用多余 |
|
LOG |
√ |
√ |
√ |
× |
注:如果将 DIFFERENTIAL 与 COPY_ONLY 一起使用,则忽略 COPY_ONLY,将创建差异备份
数据库还原:
1. 正常完整备份+正常日志备份
2. 正常完整备份+COPY_ONLY日志备份
3. COPY_ONLY完整备份+正常日志备份
4. COPY_ONLY完整备份+COPY_ONLY日志备份
5. 正常完整备份+正常差异备份+正常日志备份
6. 正常完整备份+正常差异备份+COPY_ONLY日志备份
另:首选备份副本位置(函数 sys.fn_hadr_backup_is_preferred_replica 执行结果)
备份优先级 |
主:50 |
辅:50 |
主:80 |
辅:20 |
主:20 |
辅:80 |
首选辅助副本 |
0 |
1 |
0 |
1 |
0 |
1 |
仅辅助副本 |
0 |
1 |
0 |
1 |
0 |
1 |
主副本 |
1 |
0 |
1 |
0 |
1 |
0 |
任意副本 |
1 |
0 |
1 |
0 |
0 |
1 |