Hi jianmin459,
可以使用“Remove Secondary database from the Availability group”方法来实现,一旦数据库文件移至新位置,我们将手动将数据库添加回AG。
主要有以下步骤:
- 确保在所有主/辅助副本上禁用了日志备份。
此关键步骤可确保日志文件不会被截断。
由于我们使用从AG中删除数据库/将数据库连接到AG的方法,因此在将数据库重新连接到AG时,需要完整保存日志文件。
- 在辅助数据库上将要移动位置的数据库suspend(suspend data Movement),在数据库suspend之后,移除数据库(remove secondary database)。
- 停止sql server service,将数据库移到新的位置。
- 启动sql server service。
- 使用“Join to Availability group”将数据库重新加入可用性组。
- 数据库同步后,将AG故障转移到辅助副本(该副本的数据库具有修改的文件位置)。
- AG故障转移后,请在新的辅助副本上执行相同的一组步骤。
仅在对所有副本执行文件移动活动之后,才对所有副本启用事务日志备份作业。
具体内容请参考Database File movement in SQL AlwaysOn Availability group:
A walk-through。
Best Regards,
Amelia Gu
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to
MSDN Support, feel free to contact MSDNFSF@microsoft.com.