在主控台中,您可以在建立資料庫叢集時啟用或關閉 Performance Insights。啟用 Performance Insights 可讓您管理資料庫叢集的 Performance Insights 設定和選項。叢集層級設定會套用至叢集中的所有資料庫執行個體。
在建立資料庫叢集時,開啟或關閉 Performance Insights
建立新的資料庫叢集之後,Amazon RDS 預設會啟用 Performance Insights。若要關閉資料庫叢集的 Performance Insights,請選擇Database Insights – 標準選項,然後取消選取啟用 Performance Insights 選項。
若要建立資料庫叢集,請遵循 建立 Amazon Aurora 資料庫叢集 中的資料庫引擎指示。
下列螢幕擷取畫面顯示 Performance Insights (績效詳情) 區段。
若您選擇 Enable Performance Insights (啟用績效詳情),會有下列選項:
在修改資料庫叢集時,開啟或關閉 Performance Insights
在主控台中,您可以修改資料庫叢集,以管理 Performance Insights。
使用主控台為資料庫叢集管理 Performance Insights
登入 AWS Management Console ,並在 https://console.aws.amazon.com/rds/:// 開啟 Amazon RDS 主控台。
-
選擇 Databases (資料庫)。
-
選擇資料庫叢集,然後選擇修改。
-
若要開啟 Performance Insights,請選取啟用 Performance Insights。若要關閉資料庫叢集的 Performance Insights,請選擇Database Insights – 標準選項,然後取消選取啟用 Performance Insights 選項。
若您選擇 Enable Performance Insights (啟用績效詳情),會有下列選項:
-
保留 (僅適用於 Database Insights 的標準模式) – 保留 Performance Insights 資料的時間長度。保留設定為預設值 (7 天)。若要更長時間保留績效資料,請指定 1 - 24 個月。如需保留期間的詳細資訊,請參閱 Performance Insights 的定價和資料保留。
-
AWS KMS key – 指定您的 KMS 金鑰。績效詳情使用您的 KMS 金鑰來加密所有可能的敏感資料。將會對傳輸中與靜態資料進行加密。如需詳細資訊,請參閱加密 Amazon Aurora 資源。
-
選擇 Continue (繼續)。
-
在 Scheduling of Modifications (修改排程) 中,選擇 Apply immediately (立即套用)。如果您選擇 Apply during the next scheduled maintenance window (在下一個排定的維護時段套用),則執行個體會忽略此設定,並立即開啟 Performance Insights。
-
選擇 Modify instance (修改執行個體)。
當您使用 create-db-instance AWS CLI 命令時,請指定 --enable-performance-insights並--database-insights-mode設定為 advanced或 以開啟績效詳情standard。若要關閉 Performance Insights,請指定 --no-enable-performance-insights 並將 database-insights-mode 設定為 standard。
您也可以使用下列 AWS CLI 命令來指定這些值:
使用 管理資料庫叢集的績效詳情 AWS CLI
-
呼叫 modify-db-cluster AWS CLI 命令並提供下列值:
-
--db-cluster-identifier – 資料庫叢集中的資料庫執行個體名稱。
-
--enable-performance-insights 用來開啟,--no-enable-performance-insights 用來關閉
-
database-insights-mode – 資料庫叢集的 Database Insights 模式。若要關閉 Performance Insights,請將此值設定為 standard。
以下範例會開啟 sample-db-cluster 的 Performance Insights。
針對 Linux、macOS 或 Unix:
aws rds modify-db-cluster \
--database-insights-mode standard \
--db-cluster-identifier sample-db-instance \
--enable-performance-insights
在 Windows 中:
aws rds modify-db-cluster ^
--database-insights-mode standard ^
--db-cluster-identifier sample-db-instance ^
--enable-performance-insights
當您開啟績效詳情時,可選擇使用 --performance-insights-retention-period 選項指定保留績效詳情資料的天數。您可指定為 7、月 * 31 (其中月是指 1 - 23) 的數字,或 731。例如,如果您想要保留效能資料 3 個月,請指定 93,也就是 3 個 * 31。預設值是 7 天。如需保留期間的詳細資訊,請參閱 Performance Insights 的定價和資料保留。
下列範例會開啟 sample-db-cluster 的 Performance Insights,並指定 Performance Insights 資料保留 93 天 (3 個月)。
針對 Linux、macOS 或 Unix:
aws rds modify-db-cluster \
--database-insights-mode standard \
--db-cluster-identifier sample-db-instance \
--enable-performance-insights \
--performance-insights-retention-period 93
在 Windows 中:
aws rds modify-db-cluster ^
--database-insights-mode standard ^
--db-cluster-identifier sample-db-instance ^
--enable-performance-insights ^
--performance-insights-retention-period 93
如果您指定保留期間 (例如 94 天),這不是有效值,RDS 就會發出錯誤。
An error occurred (InvalidParameterValue) when calling the CreateDBInstance operation:
Invalid Performance Insights retention period. Valid values are: [7, 31, 62, 93, 124, 155, 186, 217,
248, 279, 310, 341, 372, 403, 434, 465, 496, 527, 558, 589, 620, 651, 682, 713, 731]
您只能在 Performance Insights 不在叢集層級進行管理的資料庫叢集中,切換執行個體的 Performance Insights。