套用資料庫執行個體的更新 - Amazon Relational Database Service

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

套用資料庫執行個體的更新

使用 AmazonRDS,您可以選擇套用維護作業的時機。您可以使用RDS主控台、 AWS Command Line Interface (AWS CLI) 或決定 Amazon 何時RDS套用更新RDSAPI。

注意

對RDS於 SQL Server,您可以停止並啟動資料庫執行個體,或將資料庫執行個體類別擴展然後再縮減,以套用對基礎作業系統的更新。

管理資料庫執行個體的更新內容​
  1. 登錄 AWS Management Console 並在打開 Amazon RDS 控制台https://console.aws.amazon.com/rds/

  2. 在導覽窗格中,選擇 Databases (資料庫)。

  3. 選擇具有必要更新的資料庫執行個體

  4. 針對 Actions (動作),選擇下列其中一項:

    • 立即升級

    • 在下一個時段升級

      注意

      如果您選擇 Upgrade at next window (在下一個時段升級),但稍後想要延遲更新,則可以選擇 Defer upgrade (延遲升級)。如果維護動作已經啟動,則無法延遲維護動作。

      若要取消維護動作,請修改資料庫執行個體並停用 Auto minor version upgrade (自動次要版本升級)

若要將擱置中的更新套用至資料庫執行個體,請使用apply-pending-maintenance-action AWS CLI 指令。

範例

對於LinuxmacOS、或Unix:

aws rds apply-pending-maintenance-action \ --resource-identifier arn:aws:rds:us-west-2:001234567890:db:mysql-db \ --apply-action system-update \ --opt-in-type immediate

在 Windows 中:

aws rds apply-pending-maintenance-action ^ --resource-identifier arn:aws:rds:us-west-2:001234567890:db:mysql-db ^ --apply-action system-update ^ --opt-in-type immediate
注意

若要延期維護動作,請指定 undo-opt-in--opt-in-type。如果維護動作已經啟動,則無法指定 undo-opt-in--opt-in-type

若要取消維護動作,請執行modify-db-instance AWS CLI 命令並指定--no-auto-minor-version-upgrade

若要傳回至少有一個擱置中更新的資源清單,請使用describe-pending-maintenance-actions AWS CLI 指令。

範例

對於LinuxmacOS、或Unix:

aws rds describe-pending-maintenance-actions \ --resource-identifier arn:aws:rds:us-west-2:001234567890:db:mysql-db

在 Windows 中:

aws rds describe-pending-maintenance-actions ^ --resource-identifier arn:aws:rds:us-west-2:001234567890:db:mysql-db

您也可以指定describe-pending-maintenance-actions AWS CLI 命令的--filters參數,傳回資料庫執行個體的資源清單。--filters 命令的格式為:Name=filter-name,Value=resource-id,...

以下為篩選條件中,Name 參數可接受的值:

  • db-instance-id— 接受資料庫執行個體識別碼或 Amazon 資源名稱 (ARNs) 的清單。傳回的清單僅包含這些識別碼或識別之資料庫執行個體的擱置中維護動作ARNs。

  • db-cluster-id— 接受資料庫叢集識別碼清單或 ARNs Amazon Aurora。傳回的清單僅包含這些識別碼或識別之資料庫叢集的擱置維護動作ARNs。

例如,下方範例將傳回 sample-instance1sample-instance2 資料庫執行個體的待處理維護動作。

範例

對於LinuxmacOS、或Unix:

aws rds describe-pending-maintenance-actions \ --filters Name=db-instance-id,Values=sample-instance1,sample-instance2

在 Windows 中:

aws rds describe-pending-maintenance-actions ^ --filters Name=db-instance-id,Values=sample-instance1,sample-instance2

若要將更新套用至資料庫執行個體,請呼叫 Amazon RDS API ApplyPendingMaintenanceAction操作。

若要傳回至少有一個擱置中更新的資源清單,請呼叫 Amazon RDS API DescribePendingMaintenanceActions作業。