

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

# 修改 RDS for Oracle 複本模式
<a name="oracle-read-replicas.changing-replica-mode"></a>

若要變更現有複本的複本模式，請使用主控台、AWS CLI 或 RDS API。當您變更為掛載模式時，複本會中斷所有作用中的連線。當您變更為唯讀模式時，Amazon RDS 會初始化 Active Data Guard。

變更作業可能需要幾分鐘的時間。在作業期間，資料庫執行個體狀態會變更為 **modifying (正在修改)**。如需狀態變更的詳細資訊，請參閱[在 Amazon RDS 資料庫執行個體狀態](accessing-monitoring.md#Overview.DBInstance.Status)。

## 主控台
<a name="oracle-read-replicas.changing-replica-mode.console"></a>

**將 Oracle 複本的複本模式從掛載變更為唯讀**

1. 登入 AWS 管理主控台，開啟位於 [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/) 的 Amazon RDS 主控台。

1. 在導覽窗格中，選擇 **Databases** (資料庫)。

1. 選擇掛載的複本資料庫。

1. 選擇 **Modify (修改)**。

1. 對於 **Replica mode (複本模式)**，選擇 **Read-only (唯讀)**。

1. 選擇您想要變更的其他設定。

1. 選擇 **Continue (繼續)**。

1. 在 **Scheduling of modifications** (修改排程) 中，選擇 **Apply immediately** (立即套用)。

1. 選擇 **Modify DB instance (修改資料庫執行個體)**。

## AWS CLI
<a name="oracle-read-replicas.changing-replica-mode.cli"></a>

若要將僅供讀取複本變更為掛載模式，請在 `--replica-mode` 命令 [modify-db-instance](https://docs.aws.amazon.com/cli/latest/reference/rds/modify-db-instance.html) 中將 `mounted` 設定為 AWS CLI。若要將掛載複本變更為唯讀模式，請將 `--replica-mode` 設定為 `open-read-only`。

**Example**  
針對 Linux、macOS 或 Unix：  

```
aws rds modify-db-instance \
    --db-instance-identifier myreadreplica \
    --replica-mode mode
```
針對 Windows：  

```
aws rds modify-db-instance ^
    --db-instance-identifier myreadreplica ^
    --replica-mode mode
```

## RDS API
<a name="oracle-read-replicas.changing-replica-mode.api"></a>

若要將唯讀複本變更為掛載模式，請在 [ModifyDBInstance](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstanceReadReplica.html) 中設定 `ReplicaMode=mounted`。若要將掛載複本變更為唯讀模式，請設定 `ReplicaMode=read-only`。