

# Amazon Aurora で Database Insights のスタンダードモードを有効にする
<a name="USER_DatabaseInsights.TurningOnStandard"></a>

Amazon Aurora で Database Insights のスタンダードモードを有効にするには、次の手順を使用します。

## DB クラスターの作成時に Database Insights のスタンダードモードを有効にする
<a name="USER_DatabaseInsights.TurnOnCreateDatabaseStandard"></a>

Amazon Aurora のデータベースを作成するときに、Database Insights のスタンダードモードを有効にします。

------
#### [ Console ]

コンソールで、DB クラスターを作成するときに Database Insights のスタンダードモードを有効にできます。Database Insights の設定は、DB クラスター内のすべての DB インスタンスに適用されます。

**コンソールを使用して DB クラスターを作成するときに Database Insights のスタンダードモードを有効にするには**

1. AWS マネジメントコンソール にサインインし、Amazon RDS コンソール ([https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/)) を開きます。

1. [**データベース**] をクリックします。

1. **[データベースの作成]** を選択します。

1. **[Database Insights]** セクションで **[スタンダードモード]** を選択し、次のオプションから選択して Performance Insights のオンとオフを切り替えます。
   + Performance Insights を無効にするには、**[Performance Insights を有効にする]** の選択を解除します。
   + Performance Insights を有効にするには、**[Performance Insights を有効にする]** を選択します。Performance Insights を設定するには、次のオプションを指定します。
     + **保持期間** - Performance Insights データを保持する期間。保持期間は 7 日以上にする必要があります。
     + **AWS KMS key** - KMS キーを指定します。Performance Insights は、潜在的に機密性の高いすべてのデータを KMS キーを使用して暗号化します。データは、転送中と不使用時のいずれも暗号化されます。詳細については、「[Amazon Aurora リソースの暗号化](Overview.Encryption.md)」を参照してください。

1. **[データベースの作成]** を選択します。

------
#### [ AWS CLI ]

DB クラスターの作成時に Database Insights のスタンダードモードを有効にするには、[create-db-cluster](https://docs.aws.amazon.com/cli/latest/reference/rds/create-db-cluster.html) AWS CLI コマンドを呼び出し、次の値を指定します。
+ `--database-insights-mode standard` – Database Insights のスタンダードモードを有効にします。
+ `--engine` – DB クラスター のデータベースエンジン。
+ `--db-cluster-identifier` - DB クラスターの識別子。
+ `--enable-performance-insights` または `--no-enable-performance-insights` – Performance Insights を有効または無効にします。`--enable-performance-insights` を指定する場合は、`--performance-insights-retention-period` (DB クラスターのデータの保持期間) も指定する必要があります。保持期間は 7 日以上にする必要があります。

次の例では、DB クラスターに Database Insights のスタンダードモードと Performance Insights を有効にします。

Linux、macOS、Unix の場合:

```
aws rds create-db-cluster \
    --database-insights-mode standard \ 
    --engine aurora-postgresql \
    --db-cluster-identifier sample-db-identifier \
    --enable-performance-insights \
    --performance-insights-retention-period 7
```

Windows の場合:

```
aws rds create-db-cluster ^
    --database-insights-mode standard ^ 
    --engine aurora-postgresql ^
    --db-cluster-identifier sample-db-identifier ^
    --enable-performance-insights ^
    --performance-insights-retention-period 7
```

次の例では、DB クラスターに Database Insights のスタンダードモードと Performance Insights を有効および無効にします。

Linux、macOS、Unix の場合:

```
aws rds create-db-cluster \
    --database-insights-mode standard \ 
    --engine aurora-postgresql \
    --db-cluster-identifier sample-db-identifier \
    --no-enable-performance-insights
```

Windows の場合:

```
aws rds create-db-cluster ^
    --database-insights-mode standard ^ 
    --engine aurora-postgresql ^
    --db-cluster-identifier sample-db-identifier ^
    --no-enable-performance-insights
```

------
#### [ RDS API ]

DB クラスターの作成時に Database Insights のスタンダードモードを有効にするには、[CreateDBCluster](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBCluster.html) Amazon RDS API オペレーションに次のパラメータを指定します。
+ `DatabaseInsightsMode`～`standard`
+ `EnablePerformanceInsights` ～ `True` または `False`。`EnablePerformanceInsights` を `True` に設定する場合は、`PerformanceInsightsRetentionPeriod` を 7 日以上に設定する必要があります。

------

## DB クラスターの変更時に Database Insights のスタンダードモードを有効にする
<a name="USER_DatabaseInsights.TurnOnModifyDatabaseStandard"></a>

Amazon Aurora のデータベースを変更するときに Database Insights のスタンダードモードを有効にします。DB クラスターを変更して Database Insights の標準モードを有効にしても、ダウンタイムは発生しません。

**注記**  
Database Insights を有効にするには、DB クラスター内の各 DB インスタンスに、同じ Performance Insights と拡張モニタリング設定が必要です。

------
#### [ Console ]

コンソールで、DB クラスターを変更するときに Database Insights のスタンダードモードを有効にできます。Database Insights の設定は、DB クラスター内のすべての DB インスタンスに適用されます。

**コンソールを使用して DB クラスターを変更するときに Database Insights のスタンダードモードを有効にするには**

1. AWS マネジメントコンソール にサインインし、Amazon RDS コンソール ([https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/)) を開きます。

1. [**データベース**] をクリックします。

1. DB インスタンスを選択した上で、**[Modify]** (変更) を選択します。

1. **[Database Insights]** セクションで **[スタンダードモード]** を選択し、次のオプションから選択します。
   + Performance Insights を無効にするには、**[Performance Insights を有効にする]** の選択を解除します。
   + Performance Insights を有効にするには、**[Performance Insights を有効にする]** を選択します。Performance Insights を設定するには、次のオプションを指定します。
     + **保持期間** - Performance Insights データを保持する期間。保持期間は 7 日以上にする必要があります。
     + **AWS KMS key** - KMS キーを指定します。Performance Insights は、潜在的に機密性の高いすべてのデータを KMS キーを使用して暗号化します。データは、転送中と不使用時のいずれも暗号化されます。詳細については、「[Amazon Aurora リソースの暗号化](Overview.Encryption.md)」を参照してください。

1. [**続行**] を選択します。

1. [**Scheduling of Modifications**] で、[**Apply immediately**] を選択します。**[スケジュールされた次回のメンテナンス時間帯に適用]** を選択すると、データベースではこの設定が無視され、Database Insights のスタンダードモードが直ちに有効になります。

1. **[クラスターの変更]** を選択します。

------
#### [ AWS CLI ]

DB クラスターの変更時に Database Insights のスタンダードモードを有効にするには、[modify-db-cluster](https://docs.aws.amazon.com/cli/latest/reference/rds/modify-db-cluster.html) AWS CLI コマンドを呼び出し、次の値を指定します。
+ `--database-insights-mode standard` – Database Insights のスタンダードモードを有効にします。
+ `--db-cluster-identifier` - DB クラスターの識別子。
+ `--enable-performance-insights` または `--no-enable-performance-insights` – Performance Insights を有効または無効にします。`--enable-performance-insights` を指定する場合は、`--performance-insights-retention-period` ( DB クラスターのデータの保持期間) も指定する必要があります。保持期間は 7 日以上にする必要があります。

次の例では、DB クラスターの変更時に Database Insights のスタンダードモードを有効にし、Performance Insights を有効にします。

Linux、macOS、Unix の場合:

```
aws rds modify-db-cluster \
    --database-insights-mode standard \
    --db-cluster-identifier sample-db-identifier \
    --enable-performance-insights \
    --performance-insights-retention-period 7
```

Windows の場合:

```
aws rds modify-db-cluster ^
    --database-insights-mode standard ^
    --db-cluster-identifier sample-db-identifier ^
    --enable-performance-insights ^
    --performance-insights-retention-period 7
```

次の例では、DB クラスターの変更時に Database Insights のスタンダードモードを有効にし、Performance Insights を無効にします。

Linux、macOS、Unix の場合:

```
aws rds modify-db-cluster \
    --database-insights-mode standard \
    --db-cluster-identifier sample-db-identifier \
    --no-enable-performance-insights
```

Windows の場合:

```
aws rds modify-db-cluster ^
    --database-insights-mode standard ^
    --db-cluster-identifier sample-db-identifier ^
    --no-enable-performance-insights
```

------
#### [ RDS API ]

DB クラスターの変更時に Database Insights のスタンダードモードを有効にするには、[ModifyDBCluster](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBCluster.html) Amazon RDS API オペレーションに次のパラメータを指定します。
+ `DatabaseInsightsMode`～`standard`
+ `EnablePerformanceInsights` ～ `True` または `False`。`EnablePerformanceInsights` を `True` に設定する場合は、`PerformanceInsightsRetentionPeriod` を 7 日以上に設定する必要があります。

------