

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

# 開始使用 CloudWatch Database Insights
<a name="Database-Insights-Get-Started"></a>

Amazon RDS 和 Aurora 資料庫預設啟用 Database Insights 的標準模式。若要開始使用 Database Insights 的進階模式，可以建立新的資料庫或修改資料庫。

如需為 Amazon RDS 資料庫啟用 Database Insights 的進階模式或標準模式的詳細資訊，請參閱下列主題。
+ 《Amazon RDS 使用者指南》中的 [Turning on the Advanced mode of Database Insights for Amazon RDS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_DatabaseInsights.TurningOnAdvanced.html) **
+ 《Amazon RDS 使用者指南》中的 [Turning on the Standard mode of Database Insights for Amazon RDS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_DatabaseInsights.TurningOnStandard.html) **
+ 《Amazon RDS 使用者指南》中的 [Turning CloudWatch Database Insights on or off when creating a DB instance or Multi-AZ DB cluster for Amazon RDS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_DatabaseInsights.TurnOnCreateDatabase.html) **

如需為 Amazon Aurora 資料庫啟用 Database Insights 的進階模式或標準模式的相關資訊，請參閱下列主題。
+ 《Amazon Aurora 使用者指南》中的 [Turning on the Advanced mode of Database Insights for Amazon Aurora](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_DatabaseInsights.TurningOnAdvanced.html) **
+ 《Amazon Aurora 使用者指南》中的 [Turning on the Standard mode of Database Insights for Amazon Aurora](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_DatabaseInsights.TurningOnStandard.html) **

如需為 Aurora PostgreSQL Limitless Database 啟用 Database Insights 進階模式或標準模式的相關資訊，請參閱下列主題。
+ 《Amazon Aurora 使用者指南》中的[為 Aurora PostgreSQL Limitless Database 開啟 Database Insights 進階模式](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/limitless-monitoring.cwdbi.advanced.html) **
+ 《Amazon Aurora 使用者指南》中的[為 Aurora PostgreSQL Limitless Database 開啟 Database Insights 標準模式](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/limitless-monitoring.cwdbi.standard.html) **

## Database Insights 的必要許可
<a name="w2aac26c13c31c17"></a>

使用 Database Insights 需要特定 IAM 許可。Database Insights 需要 CloudWatch、CloudWatch Logs、Amazon RDS 和 Amazon RDS Performance Insights 的許可。若您擁有更廣泛的權限，可能無需為使用者或角色提供這些許可。

需要下列 CloudWatch 許可才能使用 Database Insights。
+ `cloudwatch:BatchGetServiceLevelIndicatorReport`
+ `cloudwatch:DescribeAlarms`
+ `cloudwatch:GetDashboard`
+ `cloudwatch:GetMetricData`
+ `cloudwatch:ListMetrics`
+ `cloudwatch:PutDashboard`

需要下列 CloudWatch Logs 許可才能使用 Database Insights。
+ `logs:DescribeLogGroups`
+ `logs:GetQueryResults`
+ `logs:StartQuery`
+ `logs:StopQuery`

需要下列 Amazon RDS 許可才能使用 Database Insights。
+ `rds:DescribeDBClusters`
+ `rds:DescribeDBInstances`
+ `rds:DescribeEvents`
+ `rds:DescribeDBShardGroups` (如果您要監控 Aurora PostgreSQL Limitless Database)

需要下列 Performance Insights 許可才能使用 Database Insights。
+ `pi:ListAvailableResourceMetrics`
+ `pi:ListAvailableResourceDimensions`
+ `pi:DescribeDimensionKeys`
+ `pi:GetDimensionKeyDetails`
+ `pi:GetResourceMetrics`
+ `pi:ListPerformanceAnalysisReports`
+ `pi:GetResourceMetadata`
+ `pi:GetPerformanceAnalysisReport`
+ `pi:CreatePerformanceAnalysisReport`
+ `pi:DeletePerformanceAnalysisReport`
+ `pi:ListTagsForResource`
+ `pi:TagResource`
+ `pi:UntagResource`

下列政策範例中包含完整存取 Database Insights 所需的許可。

### 完整存取的政策範例
<a name="Database-Insights-permissions-sample"></a>

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [{
    "Effect" : "Allow",
      "Action" : [
        "cloudwatch:BatchGetServiceLevelIndicatorReport",
        "cloudwatch:DescribeAlarms",
        "cloudwatch:GetMetricStatistics",
        "cloudwatch:GetMetricData",
        "cloudwatch:ListMetrics",
        "cloudwatch:PutDashboard"
      ],
      "Resource" : "*"
    },
    {
    "Effect" : "Allow",
      "Action" : [
        "logs:DescribeLogGroups",
        "logs:GetQueryResults",
        "logs:StartQuery",
        "logs:StopQuery"
      ],
      "Resource" : "*"
    },
    {
    "Effect" : "Allow",
      "Action" : [
        "pi:DescribeDimensionKeys",
        "pi:GetDimensionKeyDetails",
        "pi:GetResourceMetadata",
        "pi:GetResourceMetrics",
        "pi:ListAvailableResourceDimensions",
        "pi:ListAvailableResourceMetrics",
        "pi:CreatePerformanceAnalysisReport",
        "pi:GetPerformanceAnalysisReport",
        "pi:ListPerformanceAnalysisReports",
        "pi:DeletePerformanceAnalysisReport",
        "pi:TagResource",
        "pi:UntagResource",
        "pi:ListTagsForResource"
      ],
      "Resource" : "arn:aws:pi:*:*:*/rds/*"
    },
    {
    "Effect" : "Allow",
      "Action" : [
        "rds:DescribeDBInstances",
        "rds:DescribeDBClusters",
        "rds:DescribeEvents"
      ],
      "Resource" : "*"
    }
  ]
}
```

------