数据库还原时大部分错都都是因为数据库的物理地址变更和逻辑名不相符而引起的,使用with move 可以解决此类问题.例如:
restore database Northwind from disk = 'c:\Northwind.bak'
with move 'Northwind' to 'd:\microsoft sql server\mssql.1\mssql\data\Northwind.mdf'
,move 'Northwind_log' to 'd:\microsoft sql server\mssql.1\mssql\data\Northwind.ldf'
Powered by: 博客园 Copyright © 2024 龚振 Powered by .NET 9.0 on Kubernetes