簡體   English   中英

恢復數據庫 SQL Server linux

[英]Restore database SQL Server linux

我正在 linux 中恢復數據庫 sql server,我的路徑有問題。 我的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.

最后我在以下位置找到了響應: DBeaver restore SQL Server .bak file

sqlcmd -S localhost -U SA -Q "RESTORE DATABASE [prueba2] FROM DISK = N'/var/opt/mssql/data/cliente.bak' WITH MOVE 'cliente' TO '/var/opt/mssql/data/cliente.mdf', MOVE 'cliente' TO '/var/opt/mssql/data/cliente.ldf'"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM