如何在 Amazon RDS 中恢复 SQL 服务器 .bak
How to restore SQL Server .bak in Amazon RDS
正在尝试从 S3 恢复 .bak 文件。
我试过 SQL server express 和 web。版本 2012 到 2017。
我试过 t2.micro 和 t2.small。
这是我的 task_info
所说的:
[2018-03-21 10:20:22.107] Task execution has started.
[2018-03-21 10:20:22.280] myDb.bak: Completed processing 17.27% of S3 chunks.
[2018-03-21 10:20:22.327] myDb.bak: Completed processing 34.48% of S3 chunks.
[2018-03-21 10:20:22.357] 9 percent processed.
[2018-03-21 10:20:22.373] myDb.bak: Completed processing 51.68% of S3 chunks.
[2018-03-21 10:20:22.450] myDb.bak: Completed processing 68.88% of S3 chunks.
[2018-03-21 10:20:22.500] 13 percent processed.
[2018-03-21 10:20:22.513] myDb.bak: Completed processing 86.09% of S3 chunks.
[2018-03-21 10:20:22.547] 18 percent processed.
[2018-03-21 10:20:22.560] myDb.bak: Completed processing 100% of S3 chunks.
[2018-03-21 10:20:22.640] 23 percent processed.
[2018-03-21 10:20:22.653] Read on "F470E52D-DEA8-4EB1-B0AC-6F03D091E223" failed: 30(The system cannot read from the specified device.)
[2018-03-21 10:20:22.653] RESTORE DATABASE is terminating abnormally.
[2018-03-21 10:22:22.027] myDb.bak: S3 processing completed successfully
[2018-03-21 10:22:22.027] Aborted the task because of a task failure or a concurrent RESTORE_DB request.
[2018-03-21 10:22:22.090] myDb.bak: S3 processing has been aborted
[2018-03-21 10:22:22.107] Unable to retrieve family guid for database name: myDbName
我在整个网络上都进行了搜索,但一无所获。
此处概述了该过程:
https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/SQLServer.Procedural.Importing.html
任何帮助都会很棒!
更新
它说:
You might see this error when the database you have restored contains
a large log file and SQL Server is performing crash recovery. Shrink
the log file on premises before creating a backup, uploading it to S3,
and issuing the restore task.
现在试试这个...
好的,我找到了解决方法,但我不会说我真的找到了问题。
我正在使用控制面板在托管环境中创建备份。结果是 运行 sql 服务器 2012。我不确定这是否重要。
虽然我可以让它在本地恢复,但它在 RDS 中不起作用。
所以我所做的是在我的桌面上安装最新版本的 SQL Server 2017,恢复到那台机器,然后缩小数据库和文件。
之后,我在桌面上做了一个新的备份,然后上传到 s3 和 运行 恢复命令。
这次成功了。不知道为什么。
远程备份过程肯定有什么奇怪的地方。
希望这对其他人有帮助。
正在尝试从 S3 恢复 .bak 文件。
我试过 SQL server express 和 web。版本 2012 到 2017。
我试过 t2.micro 和 t2.small。
这是我的 task_info
所说的:
[2018-03-21 10:20:22.107] Task execution has started.
[2018-03-21 10:20:22.280] myDb.bak: Completed processing 17.27% of S3 chunks.
[2018-03-21 10:20:22.327] myDb.bak: Completed processing 34.48% of S3 chunks.
[2018-03-21 10:20:22.357] 9 percent processed.
[2018-03-21 10:20:22.373] myDb.bak: Completed processing 51.68% of S3 chunks.
[2018-03-21 10:20:22.450] myDb.bak: Completed processing 68.88% of S3 chunks.
[2018-03-21 10:20:22.500] 13 percent processed.
[2018-03-21 10:20:22.513] myDb.bak: Completed processing 86.09% of S3 chunks.
[2018-03-21 10:20:22.547] 18 percent processed.
[2018-03-21 10:20:22.560] myDb.bak: Completed processing 100% of S3 chunks.
[2018-03-21 10:20:22.640] 23 percent processed.
[2018-03-21 10:20:22.653] Read on "F470E52D-DEA8-4EB1-B0AC-6F03D091E223" failed: 30(The system cannot read from the specified device.)
[2018-03-21 10:20:22.653] RESTORE DATABASE is terminating abnormally.
[2018-03-21 10:22:22.027] myDb.bak: S3 processing completed successfully
[2018-03-21 10:22:22.027] Aborted the task because of a task failure or a concurrent RESTORE_DB request.
[2018-03-21 10:22:22.090] myDb.bak: S3 processing has been aborted
[2018-03-21 10:22:22.107] Unable to retrieve family guid for database name: myDbName
我在整个网络上都进行了搜索,但一无所获。
此处概述了该过程: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/SQLServer.Procedural.Importing.html
任何帮助都会很棒!
更新
它说:
You might see this error when the database you have restored contains a large log file and SQL Server is performing crash recovery. Shrink the log file on premises before creating a backup, uploading it to S3, and issuing the restore task.
现在试试这个...
好的,我找到了解决方法,但我不会说我真的找到了问题。
我正在使用控制面板在托管环境中创建备份。结果是 运行 sql 服务器 2012。我不确定这是否重要。
虽然我可以让它在本地恢复,但它在 RDS 中不起作用。
所以我所做的是在我的桌面上安装最新版本的 SQL Server 2017,恢复到那台机器,然后缩小数据库和文件。
之后,我在桌面上做了一个新的备份,然后上传到 s3 和 运行 恢复命令。
这次成功了。不知道为什么。
远程备份过程肯定有什么奇怪的地方。
希望这对其他人有帮助。