【发布时间】:2021-12-23 01:09:13
【问题描述】:
我在 linux 中恢复数据库 sql 服务器,但路径有问题。我的Sql Server版本是2019,版本是develop。
我用:
sqlcmd -S localhost -U SA -Q "RESTORE DATABASE [prueba] FROM DISK = N'/var/opt/mssql/data/cliente.bak' WITH FILE = 1, NOUNLOAD, REPLACE, NORECOVERY, STATS = 5"
输出是:
Msg 5133, Level 16, State 1, Server myserver, Line 1
Directory lookup for the file "F:\DATA\balmaceda\cliente.mdf" failed with the operating system error 2(The system cannot find the file specified.).
Msg 3156, Level 16, State 3, Server myserver, Line 1
File 'cliente' cannot be restored to 'F:\DATA\balmaceda\cliente.mdf'. Use WITH MOVE to identify a valid location for the file.
Msg 5133, Level 16, State 1, Server myserver, Line 1
Directory lookup for the file "F:\LOG\cliente\cliente_log.ldf" failed with the operating system error 2(The system cannot find the file specified.).
Msg 3156, Level 16, State 3, Server myserver, Line 1
File 'cliente_log' cannot be restored to 'F:\LOG\cliente\cliente_log.ldf'. Use WITH MOVE to identify a valid location for the file.
Msg 3119, Level 16, State 1, Server myserver, Line 1
Problems were identified while planning for the RESTORE statement. Previous messages provide details.
Msg 3013, Level 16, State 1, Server myserver, Line 1
RESTORE DATABASE is terminating abnormally.
【问题讨论】:
-
您是否阅读了错误信息?
Use WITH MOVE to identify a valid location for the file. -
"无法恢复到 'F:\DATA\balmaceda\cliente.mdf'。" 不...这不是有效的 Unix (like) 路径。
标签: sql sql-server linux ssms