

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 將 Amazon RDS for Oracle 資料庫遷移至另一個資料庫 AWS 帳戶 ， AWS 區域 並使用 AWS DMS 進行持續複寫
<a name="migrate-an-amazon-rds-for-oracle-database-to-another-aws-account-and-aws-region-using-aws-dms-for-ongoing-replication"></a>

*Durga Prasad Cheepuri 和 Eduardo Valentim，Amazon Web Services*

## 總結
<a name="migrate-an-amazon-rds-for-oracle-database-to-another-aws-account-and-aws-region-using-aws-dms-for-ongoing-replication-summary"></a>


| 
| 
| 警告：IAM 使用者具有長期登入資料，這會造成安全風險。為了協助降低此風險，建議您只為這些使用者提供執行任務所需的許可，並在不再需要這些使用者時將其移除。 | 
| --- |

此模式會逐步引導您將適用於 Oracle 的 Amazon Relational Database Service (Amazon RDS) 來源資料庫遷移至不同 AWS 帳戶 和 的步驟 AWS 區域。模式使用資料庫快照進行一次性完整資料載入，並啟用 AWS Database Migration Service (AWS DMS) 進行持續複寫。

## 先決條件和限制
<a name="migrate-an-amazon-rds-for-oracle-database-to-another-aws-account-and-aws-region-using-aws-dms-for-ongoing-replication-prereqs"></a>

**先決條件**
+ 作用中 AWS 帳戶 ，其中包含來源 Amazon RDS for Oracle 資料庫，該資料庫已使用非default AWS Key Management Service (AWS KMS) 金鑰加密
+  AWS 帳戶 與來源資料庫 AWS 區域 不同的作用中 ，用於目標 Amazon RDS for Oracle 資料庫
+ 來源和目標 VPCs 之間的虛擬私有雲端 (VPC) 對等互連
+ 熟悉[使用 Oracle 資料庫做為 的來源 AWS DMS](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.Oracle.html)
+ 熟悉[使用 Oracle 資料庫做為 的目標 AWS DMS](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.Oracle.html) 

**產品版本**
+ Oracle 版本 11g （版本 11.2.0.3.v1 和更新版本） 和最高 12.2 和 18c。如需支援版本的最新清單，請參閱文件中[使用 Oracle 資料庫做為 的來源 AWS DMS](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.Oracle.html)，以及[使用 Oracle 資料庫做為 文件的目標 AWS DMS](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.Oracle.html)。 AWS 如需 Amazon RDS 支援的 Oracle 版本，請參閱 [Amazon RDS 上的 Oracle](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Oracle.html)。

## Architecture
<a name="migrate-an-amazon-rds-for-oracle-database-to-another-aws-account-and-aws-region-using-aws-dms-for-ongoing-replication-architecture"></a>

**來源和目標技術堆疊**
+ Amazon RDS for Oracle 資料庫執行個體

![\[連線至目標 AWS 帳戶的來源 AWS 帳戶，其中包含來源和目標區域\]](http://docs.aws.amazon.com/zh_tw/prescriptive-guidance/latest/patterns/images/pattern-img/5ecd5359-884e-455c-b5d0-ef08eda2ea1f/images/e17fa7fe-d924-4f35-9707-b93572fa1227.png)


**持續複寫架構**

![\[EC2 執行個體上的資料庫透過 VPC 對等連線至複寫執行個體和 Amazon RDS。\]](http://docs.aws.amazon.com/zh_tw/prescriptive-guidance/latest/patterns/images/pattern-img/5ecd5359-884e-455c-b5d0-ef08eda2ea1f/images/b60b3500-5d29-487a-bbab-0ae9f3f386aa.png)


## 工具
<a name="migrate-an-amazon-rds-for-oracle-database-to-another-aws-account-and-aws-region-using-aws-dms-for-ongoing-replication-tools"></a>

**用於一次性完整資料載入的工具**
+ [Amazon Relational Database Service (Amazon RDS)](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Welcome.html) 會建立資料庫執行個體的儲存磁碟區快照，備份整個資料庫執行個體，而不只是個別資料庫。建立資料庫快照時，您必須找出要進行備份的資料庫執行個體，並為該資料庫快照命名，使得您稍後可透過它進行還原。建立快照所需的時間量因資料庫的大小而異。由於快照包括整個儲存體磁碟區，檔案大小，例如暫存檔案，也會影響建立快照所需的時間量。如需使用資料庫快照的詳細資訊，請參閱 [Amazon RDS 文件中的建立資料庫快照](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CreateSnapshot.html)。
+ [AWS Key Management Service (AWS KMS)](https://docs.aws.amazon.com/kms/latest/developerguide/overview.html) 會建立 ** **Amazon RDS** **加密的** **金鑰。當您建立加密的資料庫執行個體時，您也可以提供加密[AWS KMS](https://docs.aws.amazon.com/kms/latest/developerguide/overview.html)金鑰的金鑰識別符。如果您未指定[AWS KMS](https://docs.aws.amazon.com/kms/latest/developerguide/overview.html)金鑰識別符，Amazon RDS 會將您的預設加密金鑰用於新的資料庫執行個體。 會為您的 [AWS KMS](https://docs.aws.amazon.com/kms/latest/developerguide/overview.html)建立預設加密金鑰 AWS 帳戶。每個 AWS 帳戶 都有不同的預設加密金鑰 AWS 區域。對於此模式，應使用非預設[AWS KMS](https://docs.aws.amazon.com/kms/latest/developerguide/overview.html)金鑰加密 Amazon RDS 資料庫執行個體。如需使用 Amazon RDS 加密[AWS KMS](https://docs.aws.amazon.com/kms/latest/developerguide/overview.html)金鑰的詳細資訊，請參閱 [Amazon RDS 文件中的加密 Amazon RDS 資源](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.Encryption.html)。

**用於持續複寫的工具**
+ [AWS Database Migration Service (AWS DMS)](https://docs.aws.amazon.com/dms/latest/userguide/Welcome.html) 用於複寫正在進行的變更，並保持來源和目標資料庫的同步。如需使用 AWS DMS 進行持續複寫的詳細資訊，請參閱 AWS DMS 文件中的[使用 AWS DMS 複寫執行個體](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_ReplicationInstance.html)。

## 史詩
<a name="migrate-an-amazon-rds-for-oracle-database-to-another-aws-account-and-aws-region-using-aws-dms-for-ongoing-replication-epics"></a>

### 設定您的來源 AWS 帳戶
<a name="configure-your-source-aws-account"></a>


| 任務 | Description | 所需的技能 | 
| --- | --- | --- | 
| 準備來源 Oracle 資料庫執行個體。 | 讓 Amazon RDS for Oracle 資料庫執行個體以 ARCHIVELOG 模式執行，並設定保留期間。如需詳細資訊，請參閱[使用 AWS 受管 Oracle 資料庫做為 的來源 AWS DMS](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.Oracle.html#CHAP_Source.Oracle.Amazon-Managed)。 | DBA | 
| 設定來源 Oracle 資料庫執行個體的補充記錄。 | 設定 Amazon RDS for Oracle 資料庫執行個體的資料庫層級和資料表層級補充記錄。如需詳細資訊，請參閱[使用 AWS 受管 Oracle 資料庫做為 的來源 AWS DMS](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.Oracle.html#CHAP_Source.Oracle.Amazon-Managed)。 | DBA | 
| 更新來源帳戶中的 AWS KMS 金鑰政策。 | 更新來源中的 AWS KMS 金鑰政策 AWS 帳戶 ， AWS 帳戶 以允許目標使用加密的 Amazon RDS AWS KMS 金鑰。如需詳細資訊，請參閱 [AWS KMS 文件](https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-modifying.html#key-policy-modifying-external-accounts)。 | SysAdmin | 
| 建立來源資料庫執行個體的手動 Amazon RDS 資料庫快照。 |  | AWS IAM 使用者 | 
| 與目標共用手動加密的 Amazon RDS 快照 AWS 帳戶。 | 如需詳細資訊，請參閱[共用資料庫快照](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ShareSnapshot.html)。 | AWS IAM 使用者 | 

### 設定您的目標 AWS 帳戶
<a name="configure-your-target-aws-account"></a>


| 任務 | Description | 所需的技能 | 
| --- | --- | --- | 
| 連接政策。 | 在目標中 AWS 帳戶，將 AWS Identity and Access Management (IAM) 政策連接至根 IAM 使用者，以允許 IAM 使用者使用共用 AWS KMS 金鑰複製加密的資料庫快照。 | SysAdmin | 
| 切換到來源 AWS 區域。 |  | AWS IAM 使用者 | 
| 複製共用快照。 | 在 Amazon RDS 主控台的**快照**窗格中，選擇**與我共用**，然後選取共用快照。使用來源資料庫所用 AWS KMS 金鑰的 Amazon Resource Name (ARN)，將快照複製到與來源資料庫 AWS 區域 相同的 。如需詳細資訊，請參閱[複製資料庫快照](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CopySnapshot.html)。 | AWS IAM 使用者 | 
| 切換到目標 AWS 區域，並建立新的 AWS KMS 金鑰。 |  | AWS IAM 使用者 | 
| 複製快照。 | 切換到來源 AWS 區域。在 Amazon RDS 主控台的**快照**窗格中，選擇**由我擁有**，然後選取複製的快照。 AWS 區域 使用新目標的 AWS KMS 金鑰，將快照複製到目標 AWS 區域。 | AWS IAM 使用者 | 
| 還原快照。 | 切換到目標 AWS 區域。在 Amazon RDS 主控台的**快照**窗格中，選擇**由我擁有**。選取複製的快照，並將其還原至 Amazon RDS for Oracle 資料庫執行個體。如需詳細資訊，請參閱[從資料庫快照還原](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_RestoreFromSnapshot.html)。 | AWS IAM 使用者 | 

### 準備您的來源資料庫以進行持續複寫
<a name="prepare-your-source-database-for-ongoing-replication"></a>


| 任務 | Description | 所需的技能 | 
| --- | --- | --- | 
| 建立具有適當許可的 Oracle 使用者。 | 建立具有 Oracle 所需權限的 Oracle 使用者做為來源 AWS DMS。如需詳細資訊，請參閱 [AWS DMS 文件](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.Oracle.html)。 | DBA | 
| 設定 Oracle LogMiner 或 Oracle Binary Reader 的來源資料庫。 |  | DBA | 

### 準備您的目標資料庫以進行持續複寫
<a name="prepare-your-target-database-for-ongoing-replication"></a>


| 任務 | Description | 所需的技能 | 
| --- | --- | --- | 
| 建立具有適當許可的 Oracle 使用者。 | 建立具有 Oracle 所需權限的 Oracle 使用者做為目標 AWS DMS。如需詳細資訊，請參閱 [AWS DMS 文件](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.Oracle.html#CHAP_Target.Oracle.Privileges)。 | DBA | 

### 建立 AWS DMS 元件
<a name="create-dms-components"></a>


| 任務 | Description | 所需的技能 | 
| --- | --- | --- | 
| 在目標中建立複寫執行個體 AWS 區域。 | 在目標的 VPC 中建立複寫執行個體 AWS 區域。如需詳細資訊，請參閱 [AWS DMS 文件](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_GettingStarted.html#CHAP_GettingStarted.ReplicationInstance)。 | AWS IAM 使用者 | 
| 使用必要的加密和測試連線來建立來源和目標端點。 | 如需詳細資訊，請參閱 [AWS DMS 文件](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_GettingStarted.html#CHAP_GettingStarted.Endpoints)。 | DBA | 
| 建立複寫任務。 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/prescriptive-guidance/latest/patterns/migrate-an-amazon-rds-for-oracle-database-to-another-aws-account-and-aws-region-using-aws-dms-for-ongoing-replication.html)如需詳細資訊，請參閱 [AWS DMS 文件](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_GettingStarted.html#CHAP_GettingStarted.Tasks)。 | IAM 使用者 | 
| 啟動任務並監控它們。 | 如需詳細資訊，請參閱 [AWS DMS 文件](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Monitoring.html)。 | AWS IAM 使用者 | 
| 視需要對任務啟用驗證。 | 請注意，啟用驗證確實會對複寫產生效能影響。如需詳細資訊，請參閱 [AWS DMS 文件](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Validating.html)。 | AWS IAM 使用者 | 

## 相關資源
<a name="migrate-an-amazon-rds-for-oracle-database-to-another-aws-account-and-aws-region-using-aws-dms-for-ongoing-replication-resources"></a>
+ [變更金鑰政策](https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-modifying.html#key-policy-modifying-external-accounts)
+ [建立手動 Amazon RDS 資料庫快照](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CreateSnapshot.html)
+ [共用手動 Amazon RDS 資料庫快照](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ShareSnapshot.html)
+ [複製快照](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CopySnapshot.html) 
+ [從 Amazon RDS 資料庫快照還原](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_RestoreFromSnapshot.html) 
+ [入門 AWS DMS](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_GettingStarted.html) 
+ [使用 Oracle 資料庫做為 的來源 AWS DMS](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.Oracle.html) 
+ [使用 Oracle 資料庫做為 的目標 AWS DMS](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.Oracle.html) 
+ [AWS DMS 使用 VPC 對等互連進行設定](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_ReplicationInstance.VPC.html#CHAP_ReplicationInstance.VPC.Configurations.ScenarioVPCPeer) 
+ [如何與另一個 共用手動 Amazon RDS 資料庫快照或資料庫叢集快照 AWS 帳戶？](https://aws.amazon.com/premiumsupport/knowledge-center/rds-snapshots-share-account/) (AWS 知識中心文章） 