0

我们有一台相当大的 Windows Server 2012 R2 机器,上面运行着 Oracle 12c。我们使用 AWS MGN(应用程序迁移服务)将该本地机器迁移到 AWS。迁移已经过测试并且是成功的 - 所以我们现在有一个大型 Windows 2012 R2 EC2 实例在 AWS 上运行 Oracle 12c 服务器。

我正在尝试使用 AWS Backups 拍摄 Oracle 实例的快照,以尝试对其进行还原,作为迈向完整 DR 计划的第一步。快照恢复得很好,我们能够登录到 Windows 实例,但似乎 Oracle 表处于不一致状态,我没有从 AWS 备份中获得干净的快照。Microsoft VSS 似乎已在恢复的实例上启用。

问题是:是否有人成功使用 AWS Backups 在 Windows Server 上备份和还原 Oracle 数据库?如果是这样,我们需要做出哪些改变?我包括了一些 terraform 以供参考:

resource "aws_backup_plan" "weekly" {
  name = "Legacy${var.environment_tag}Weekly"

  rule {
    enable_continuous_backup = false
    rule_name                = "Legacy${var.environment_tag}Weekly"
    target_vault_name        = aws_backup_vault.legacy.name
    schedule                 = var.backup_plan_weekly_schedule
    start_window             = 60  # minutes
    completion_window        = 180 # minutes

    lifecycle {
      cold_storage_after = 30  # days
      delete_after       = 120 # days
    }

    copy_action {
      destination_vault_arn = aws_backup_vault.legacy.arn

      lifecycle {
        cold_storage_after = 30  # days
        delete_after       = 120 # days
      }
    }

    copy_action {
      destination_vault_arn = aws_backup_vault.secondary.arn

      lifecycle {
        cold_storage_after = 30  # days
        delete_after       = 120 # days
      }
    }
  }

  advanced_backup_setting {
    backup_options = {
      WindowsVSS = "enabled"
    }
    resource_type = "EC2"
  }

  tags = merge(
    local.tags, {
      "Name" = "Legacy${var.environment_tag}Weekly"
    }
  )
}

resource "aws_backup_selection" "weekly" {
  iam_role_arn = aws_iam_role.legacy_backup.arn
  name         = "Legacy${var.environment_tag}Weekly"
  plan_id      = aws_backup_plan.weekly.id

  selection_tag {
    type  = "STRINGEQUALS"
    key   = "AWSBackup"
    value = "weekly"
  }
}

resource "aws_backup_vault" "legacy" {
  name        = "Legacy${var.environment_tag}"
  kms_key_arn = aws_kms_key.mgn.arn

  tags = merge(
    local.tags, {
      "Name" = "Legacy${var.environment_tag}"
    }
  )
}
4

1 回答 1

0

事实证明,即使在快照完成后,AWS Backup 也会将数据库保持在“备份”状态,因此恢复的实例仍然认为它不是处于一致状态。解决此问题的方法是进入恢复的实例,启动 Oracle SQL 提示符并运行以下命令:

alter database end backup;
于 2021-12-02T16:28:51.293 回答