在同一 Amazon RDS 上创建重复的 SQL 服务器数据库

Creating a duplicate SQL Server database on the same Amazon RDS

背景: 我正在将一些客户端移动到 AWS RDS SQL 服务器实例。每个人都有两个数据库:一个用于他们的实时数据,一个用于训练数据,这是他们实时数据的副本。训练数据库通过使用实时数据库定期恢复来保持最新。理想情况下,这些数据库将托管在同一个 RDS 实例上,因为它们不是那么大,而且托管成本会减半。

问题:亚马逊有这些限制in their documentation

You can't restore a backup file to the same DB instance that was used to create the backup file. Instead, restore the backup file to a new DB instance. Renaming the database is not a workaround for this limitation.

You can't restore the same backup file to a DB instance multiple times. That is, you can't restore a backup file to a DB instance that already contains the database that you are restoring. Renaming the database is not a workaround for this limitation.

因此,像往常一样备份实时数据库并将其恢复到训练数据库已经过时了。除了为每个客户端托管两个单独的实例之外,我最好的选择是什么?

虽然可以为数据库生成脚本,将其导入别处,备份并恢复到原始实例,但对我来说这不是一个很好的解决方法。我不得不放弃使用 RDS 实例,转而采用更传统的方式,即在 Windows EC2 实例上托管多个训练数据库。

好消息:

之前在 the RDS Documentation 中列出的限制已被删除:

You can't restore a backup file to the same DB instance that was used to create the backup file. Instead, restore the backup file to a new DB instance. Renaming the database is not a workaround for this limitation.

You can't restore the same backup file to a DB instance multiple times. That is, you can't restore a backup file to a DB instance that already contains the database that you are restoring. Renaming the database is not a workaround for this limitation.

我刚刚对此进行了测试,并且能够使用定义的 msdb.dbo.rds_restore_database 存储过程将同一备份多次还原到同一 RDS SQL 服务器上的不同数据库名称而没有问题在链接文档中。