无法在github codespace中还原SQL Server数据库
我有以下脚本,其中包含其相应的备份文件
USE [master]
RESTORE DATABASE [Imports]
FROM DISK = '/workspaces/Imports/.devcontainer/mssql/Imports.bak'
WITH MOVE 'Imports' TO '/var/opt/mssql/data/Imports.mdf',
MOVE 'Imports_log' TO '/var/opt/mssql/data/Imports_log.ldf',
FILE = 1, NOUNLOAD, STATS = 5
GO
在命令行中我执行此行,
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P MSSqlPasswd -d master -i /workspaces/Imports.devcontainer/mssql/restoreDataBases.sql
但我会得到此错误
将数据库上下文更改为“主”。
msg 3201,16级,状态2,服务器8738a617a215,第2行
无法打开备份设备'/workspaces/imports/.devcontainer/mssql/importaciones.bak'。操作系统错误2
(系统找不到指定的文件。)。msg 3013,级别16,状态1,服务器8738a617a215,第2行
还原数据库异常终止。
I have the following script with its corresponding backup file
USE [master]
RESTORE DATABASE [Imports]
FROM DISK = '/workspaces/Imports/.devcontainer/mssql/Imports.bak'
WITH MOVE 'Imports' TO '/var/opt/mssql/data/Imports.mdf',
MOVE 'Imports_log' TO '/var/opt/mssql/data/Imports_log.ldf',
FILE = 1, NOUNLOAD, STATS = 5
GO
In command line I execute this line
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P MSSqlPasswd -d master -i /workspaces/Imports.devcontainer/mssql/restoreDataBases.sql
but I get this error
Changed database context to 'master'.
Msg 3201, Level 16, State 2, Server 8738a617a215, Line 2
Cannot open backup device '/workspaces/Imports/.devcontainer/mssql/Importaciones.bak'. Operating system error 2
(The system cannot find the file specified.).Msg 3013, Level 16, State 1, Server 8738a617a215, Line 2
RESTORE DATABASE is terminating abnormally.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论