简体   繁体   English

如何在CLI中将AWS-RDS aurora数据库还原到指定时间?

[英]How can I restore AWS-RDS aurora database to a specified time in CLI?

I want to restore my Aurora database to a specified time. 我想将我的Aurora数据库还原到指定的时间。 I've enabled the automated backups. 我启用了自动备份。 I've tried the following script from the official user guide ( https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PIT.html ): 我已经从官方用户指南( https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PIT.html )中尝试了以下脚本:

aws rds restore-db-instance-to-point-in-time \
    --source-db-instance-identifier mysourcedbinstance \
    --target-db-instance-identifier mytargetdbinstance \
    --restore-time 2018-01-12T23:45:00.000Z

I've got the following error: 我遇到以下错误:

An error occurred (PointInTimeRestoreNotEnabled) when calling the RestoreDBInstanceToPointInTime operation: Point-in-time restore is not enabled for this database instance. To enable point-in-time restore, use ModifyDBInstance to set the backup retention period to a non-zero value.

The "BackupRetentionPeriod" property of the source instance is 30. 源实例的“ BackupRetentionPeriod”属性为30。

According to the AWS console, this restore time is between "Earliest restorable time" and "Latest restore time": 根据AWS控制台,此还原时间介于“最早的还原时间”和“最新的还原时间”之间:

在此处输入图片说明

Wha am I doing wrong? 我做错了什么?

If you look at the example from here, I think your CLI command is incorrect and the error message is just crappy. 如果您从此处看示例,我认为您的CLI命令不正确,并且错误消息简直是cr脚。 In particular, your time looks bad. 特别是,您的时间看起来很糟糕。

https://docs.aws.amazon.com/cli/latest/reference/rds/restore-db-instance-to-point-in-time.html https://docs.aws.amazon.com/cli/latest/reference/rds/restore-db-instance-to-point-in-time.html

Try: 尝试:

aws rds restore-db-instance-to-point-in-time \\ --source-db-instance-identifier mysourcedbinstance \\ --target-db-instance-identifier mytargetdbinstance \\ --restore-time 2018-01-12T23:45:00Z

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM