

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

# 使用 Amazon RDS Custom for Oracle 的自訂引擎版本
<a name="custom-cev"></a>

Amazon RDS Custom for Oracle 的*自訂引擎版本 (CEV)* 是資料庫引擎和特定 Amazon Machine Image (AMI) 的二進位磁碟區快照。根據預設，RDS Custom for Oracle 會使用 RDS Custom 管理的最新可用 AMI，但您可以指定舊的 CEV 中使用的 AMI。您可以將資料庫安裝檔案存放在 Amazon S3 中。RDS Custom 會使用安裝檔案和 AMI，為您建立 CEV。

**Topics**
+ [準備建立 CEV](custom-cev.preparing.md)
+ [建立 CEV](custom-cev.create.md)
+ [修改 CEV 狀態](custom-cev.modify.md)
+ [檢視 Amazon RDS Custom for Oracle 的 CEV 詳細資訊](custom-cev.view.md)
+ [刪除 CEV](custom-cev.delete.md)

# 準備建立 CEV
<a name="custom-cev.preparing"></a>

若要建立 CEV，請存取存放在 Amazon S3 儲存貯體中任何下列版本的安裝檔案和修補程式：
+ Oracle 資料庫 19c
+ Oracle 資料庫 18c
+ Oracle 資料庫 12c 版本 2 (12.2)
+ Oracle 資料庫 12c 版本 1 (12.1)

例如，您可以對 Oracle 資料庫使用 19c 的 2021 年 4 月版 RU/RUR，或任何有效的安裝檔案和修補程式組合。如需 RDS Custom for Oracle 所支援版本和區域的詳細資訊，請參閱[搭配 RDS for Oracle 的 RDS Custom](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RDS_Fea_Regions_DB-eng.Feature.RDSCustom.html#Concepts.RDS_Fea_Regions_DB-eng.Feature.RDSCustom.ora)。

**Topics**
+ [步驟 1 (選用)：下載清單檔案範本](#custom-cev.preparing.templates)
+ [步驟 2：從 Oracle Software Delivery Cloud 下載資料庫安裝檔案和修補程式](#custom-cev.preparing.download)
+ [步驟 3：將您的安裝檔案上傳到 Amazon S3](#custom-cev.preparing.s3)
+ [步驟 4 （選用）：跨 共用 S3 中的安裝媒體 AWS 帳戶](#custom-cev.preparing.accounts)
+ [步驟 5：準備 CEV 清單檔案](#custom-cev.preparing.manifest)
+ [步驟 6 (選用)：驗證 CEV 清單檔案](#custom-cev.preparing.validating)
+ [步驟 7：新增必要的 IAM 許可](#custom-cev.preparing.iam)

## 步驟 1 (選用)：下載清單檔案範本
<a name="custom-cev.preparing.templates"></a>

*CEV 清單檔案*是 JSON 文件，其中包含 CEV 的資料庫安裝 .zip 檔案清單。若要建立 CEV，請執行下列動作：

1. 識別您要包含在 CEV 中的 Oracle 資料庫安裝檔案。

1. 下載安裝檔案。

1. 建立列出安裝檔案的 JSON 清單檔案。

RDS Custom for Oracle 會針對每個支援的 Oracle Database 版本，提供 JSON 清單檔案範本以及我們建議的 .zip 檔案。例如，下列範本適用於 19.17.0.0.0 RU。

```
{
    "mediaImportTemplateVersion": "2020-08-14",
    "databaseInstallationFileNames": [
        "V982063-01.zip"
    ],
    "opatchFileNames": [
        "p6880880_190000_Linux-x86-64.zip"
    ],
    "psuRuPatchFileNames": [
        "p34419443_190000_Linux-x86-64.zip",
        "p34411846_190000_Linux-x86-64.zip"
    ],
    "otherPatchFileNames": [
        "p28852325_190000_Linux-x86-64.zip",
        "p29997937_190000_Linux-x86-64.zip",
        "p31335037_190000_Linux-x86-64.zip",
        "p32327201_190000_Linux-x86-64.zip",
        "p33613829_190000_Linux-x86-64.zip",
        "p34006614_190000_Linux-x86-64.zip",
        "p34533061_190000_Linux-x86-64.zip",
        "p34533150_190000_Generic.zip",
        "p28730253_190000_Linux-x86-64.zip",
        "p29213893_1917000DBRU_Generic.zip",
        "p33125873_1917000DBRU_Linux-x86-64.zip",
        "p34446152_1917000DBRU_Linux-x86-64.zip"
    ]
}
```

每個範本都有相關聯的 Readme，其中包括下載修補程式的指示、.zip 檔案的 URL，以及檔案總和檢查。您可以依原狀使用這些範本，也可以使用自己的修補程式來修改這些範本。若要檢閱範本，請將 [custom-oracle-manifest.zip](samples/custom-oracle-manifest.zip) 下載至您的本機磁碟，然後使用檔案封存應用程式開啟它。如需詳細資訊，請參閱[步驟 5：準備 CEV 清單檔案](#custom-cev.preparing.manifest)。

## 步驟 2：從 Oracle Software Delivery Cloud 下載資料庫安裝檔案和修補程式
<a name="custom-cev.preparing.download"></a>

找出 CEV 所需的安裝檔案後，請將它們下載至您的本機系統。Oracle 資料庫安裝檔案和修補程式是由 Oracle Software Delivery Cloud 託管。每個 CEV 都需要基礎版本 (例如 Oracle Database 19c 或 Oracle Database 12c Release 2 (12.2))，以及選用的修補程式清單。

**下載 Oracle Database 的資料庫安裝檔案**

1. 移至 [https://edelivery.oracle.com/](https://edelivery.oracle.com/) 並登入。

1. 在搜尋方塊中，輸入 **Oracle Database Enterprise Edition** 或 **Oracle Database Standard Edition 2**，然後選擇**搜尋**。

1. 選擇下列其中一個基礎版本：    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/AmazonRDS/latest/UserGuide/custom-cev.preparing.html)

1. 選擇**繼續**。

1. 清除 **Download Queue** (下載佇列) 核取方塊。

1. 選擇對應至基礎版本的選項：
   + **Oracle Database 19.3.0.0.0 - 長期版本**。
   + **Oracle Database 18.0.0.0.0**
   + **Oracle Database 12.2.0.1.0**。
   + **Oracle Database 12.1.0.2.0**。

1. 在 **Platform/Languages (平台/語言)** 中選擇 **Linux x86-64**。

1. 選擇**繼續**，然後簽署 Oracle 授權合約。

1. 選擇對應至資料庫版本的 .zip 檔案：    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/AmazonRDS/latest/UserGuide/custom-cev.preparing.html)

1. 從 `updates.oracle.com` 或 `support.oracle.com` 將所需的 Oracle 修補程式下載至本機系統。您可在下列位置尋找修補程式的 URL：
   + 您在 [步驟 1 (選用)：下載清單檔案範本](#custom-cev.preparing.templates) 所下載的 .zip 檔案中的讀我檔案
   + 修補程式列示在[適用於 Oracle 的 Amazon Relational Database Service (Amazon RDS) 版本備註](https://docs.aws.amazon.com/AmazonRDS/latest/OracleReleaseNotes)的每個版本更新 (RU) 中

## 步驟 3：將您的安裝檔案上傳到 Amazon S3
<a name="custom-cev.preparing.s3"></a>

使用 AWS CLI將 Oracle 安裝和修補檔案上傳至 Amazon S3。包含安裝檔案的 S3 儲存貯體必須與 CEV 位於相同的 AWS 區域。

本節中的範例使用下列預留位置：
+ `install-or-patch-file.zip` – Oracle 安裝媒體檔案。例如，p32126828\$1190000\$1Linux-x86-64.zip 是修補程式。
+ `amzn-s3-demo-destination-bucket` – 針對您的上傳安裝檔案指定的 Amazon S3 儲存貯體。
+ `123456789012/cev1` – 您的 Amazon S3 儲存貯體的選用字首。
+ `amzn-s3-demo-source-bucket` – Amazon S3 儲存貯體，您可以選擇性在其中暫存檔案。

**Topics**
+ [步驟 3a：確認您的 S3 儲存貯體位於正確的 AWS 區域](#custom-cev.preparing.s3.verify-region)
+ [步驟 3b：確定您的 S3 儲存貯體政策具有正確的許可](#custom-cev.preparing.s3.verify-policy)
+ [步驟 3c：使用 cp 或 sync 命令上傳檔案](#custom-cev.preparing.s3.upload)
+ [步驟 3d：列出 S3 儲存貯體中的檔案](#custom-cev.preparing.s3.list)

### 步驟 3a：確認您的 S3 儲存貯體位於正確的 AWS 區域
<a name="custom-cev.preparing.s3.verify-region"></a>

確認您的 S3 儲存貯體位於您計劃執行 `create-custom-db-engine-version`命令的 AWS 區域中。

```
aws s3api get-bucket-location --bucket amzn-s3-demo-destination-bucket
```

### 步驟 3b：確定您的 S3 儲存貯體政策具有正確的許可
<a name="custom-cev.preparing.s3.verify-policy"></a>

您可以從頭或從來源 CEV 建立 CEV。如果您計劃從來源 CEV 建立新 CEV，請確定您的 S3 儲存貯體政策具有正確的許可：

1. 識別 RDS Custom 保留的 S3 儲存貯體。儲存貯體名稱具有格式 `do-not-delete-rds-custom-account-region-string`。例如，儲存貯體可能名為 `do-not-delete-rds-custom-123456789012-us-east-1-abc123EXAMPLE`。

1. 確定下列許可附加至您的 S3 儲存貯體政策。用您的儲存貯體名稱取代 `do-not-delete-rds-custom-123456789012-us-east-1-abc123EXAMPLE`。

   ```
   {
       "Sid": "AWSRDSCustomForOracleCustomEngineVersionGetObject",
       "Effect": "Allow",
       "Principal": {
           "Service": "custom.rds.amazonaws.com"
       },
       "Action": [
           "s3:GetObject",
           "s3:GetObjectTagging"
       ],
       "Resource": "arn:aws:s3:::do-not-delete-rds-custom-123456789012-us-east-1-abc123EXAMPLE/CustomEngineVersions/*"
   }, ...
   ```

### 步驟 3c：使用 cp 或 sync 命令上傳檔案
<a name="custom-cev.preparing.s3.upload"></a>

請選擇下列其中一個選項：
+ 使用 `aws s3 cp` 來上傳單一 .zip 檔案。

  分別上傳每個安裝 .zip 檔案。請勿將 .zip 檔案合併成單一 .zip 檔案。
+ 使用 `aws s3 sync` 來上傳目錄。

**Example**  
下列範例會將 `install-or-patch-file.zip` 上傳到 RDS Custom Amazon S3 儲存貯體中的 `123456789012/cev1` 資料夾。針對您想要上傳的每個 .zip 分別執行 `aws s3` 命令。  
對於 Linux、macOS 或 Unix：  

```
1. aws s3 cp install-or-patch-file.zip \
2.     s3://amzn-s3-demo-destination-bucket/123456789012/cev1/
```
在 Windows 中：  

```
1. aws s3 cp install-or-patch-file.zip ^
2.     s3://amzn-s3-demo-destination-bucket/123456789012/cev1/
```

**Example**  
下列範例會將您的本機 *cev1* 資料夾上傳到 Amazon S3 儲存貯體中的 *123456789012/cev1* 資料夾。  
對於 Linux、macOS 或 Unix：  

```
aws s3 sync cev1 \
    s3://amzn-s3-demo-destination-bucket/123456789012/cev1/
```
在 Windows 中：  

```
aws s3 sync cev1 ^
    s3://amzn-s3-demo-destination-bucket/123456789012/cev1/
```

**Example**  
下列範例會將 `amzn-s3-demo-source-bucket` 中的所有檔案上傳到 Amazon S3 儲存貯體中的 **`123456789012/cev1`** 資料夾。  
對於 Linux、macOS 或 Unix：  

```
aws s3 sync s3://amzn-s3-demo-source-bucket/ \
    s3://amzn-s3-demo-destination-bucket/123456789012/cev1/
```
在 Windows 中：  

```
aws s3 sync s3://amzn-s3-demo-source-bucket/ ^
    s3://amzn-s3-demo-destination-bucket/123456789012/cev1/
```

### 步驟 3d：列出 S3 儲存貯體中的檔案
<a name="custom-cev.preparing.s3.list"></a>

下列範例會使用 `s3 ls` 命令，列出 RDS Custom Amazon S3 儲存貯體中的檔案。

```
aws s3 ls \
    s3://amzn-s3-demo-destination-bucket/123456789012/cev1/
```

## 步驟 4 （選用）：跨 共用 S3 中的安裝媒體 AWS 帳戶
<a name="custom-cev.preparing.accounts"></a>

就本區段而言，Amazon S3 儲存貯體包含您上傳的 Oracle 安裝檔案便是媒體*儲存貯體*。您的組織可能會在 AWS 帳戶 中使用多個 AWS 區域。如果是這樣，您可能想要使用一個 AWS 帳戶 來填入媒體儲存貯體，並使用另一個 AWS 帳戶 來建立 CEVs。若您不想分享您的媒體儲存貯體，請跳至下一區段。

此區段假設如下：
+ 您可以存取建立媒體儲存貯體的帳戶，以及要在其中建立 CEV 的其他帳戶。
+ 您打算只在一個 AWS 區域中建立 CEV。如果您打算使用多個區域，請在每個區域中建立媒體儲存貯體。
+ 您正在使用 CLI。如果您要使用 Amazon S3 主控台，請採納下列步驟：

**設定媒體儲存貯體以跨 共用 AWS 帳戶**

1. 登入 AWS 帳戶 包含您上傳安裝媒體之 S3 儲存貯體的 。

1. 您可以從空白的 JSON 政策範本，或現有的政策開始採納。

   下列命令會擷取現有的政策，並將其儲存為 *my-policy.json*。在此範例中，包含您安裝檔案的 S3 儲存貯體命名為 *amzn-s3-demo-bucket*。

   ```
   aws s3api get-bucket-policy \ 
       --bucket amzn-s3-demo-bucket \
       --query Policy \
       --output text > my-policy.json
   ```

1. 編輯媒體儲存貯體權限，如下所示：
   + 在範本的 `Resource` 元素，請指定要上傳 Oracle Database 安裝檔案的 S3 儲存貯體。
   + 在 `Principal`元素中，指定 AWS 帳戶 您要用來建立 CEVs 的所有 ARNs。您可以將根、使用者或角色新增至 S3 儲存貯體允許清單。如需詳細資訊，請參閱 *AWS Identity and Access Management 使用者指南*中的 [IAM 識別符](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html)。

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

****  

   ```
   {
       "Version":"2012-10-17",		 	 	 
       "Statement": [
           {
               "Sid": "GrantAccountsAccess",
               "Effect": "Allow",
               "Principal": {
                   "AWS": [
                       "arn:aws:iam::111122223333:root",
                       "arn:aws:iam::444455556666:user/user-name-with-path",
                       "arn:aws:iam::123456789012:role/role-name-with-path"
                   ]
               },
               "Action": [
                   "s3:GetObject",
                   "s3:GetObjectAcl",
                   "s3:GetObjectTagging",
                   "s3:ListBucket",
                   "s3:GetBucketLocation"
               ],
               "Resource": [
                   "arn:aws:s3:::amzn-s3-demo-bucket",
                   "arn:aws:s3:::amzn-s3-demo-bucket/*"
               ]
           }
       ]
   }
   ```

------

1. 將政策連接至您的媒體儲存貯體。

   在下列範例中，*amzn-s3-demo-bucket* 是包含您的安裝檔案的 S3 儲存貯體名稱，而 *my-policy.json* 是您的 JSON 檔案名稱。

   ```
   aws s3api put-bucket-policy \
       --bucket amzn-s3-demo-bucket \
       --policy file://my-policy.json
   ```

1. 登入您要在 AWS 帳戶 其中建立 CEVs 。

1. 確認此帳戶可以存取 AWS 帳戶 建立它的 中的媒體儲存貯體。

   ```
   aws s3 ls --query "Buckets[].Name"
   ```

   如需詳細資訊，請參閱*AWS CLI 命令參考*中的 [aws s3 ls](https://docs.aws.amazon.com/cli/latest/reference/s3/ls.html)。

1. 遵循 [建立 CEV](custom-cev.create.md) 中的步驟建立 CEV。

## 步驟 5：準備 CEV 清單檔案
<a name="custom-cev.preparing.manifest"></a>

CEV 清單檔案是包含下列項目的 JSON 文件：
+ (必要) 您上傳至 Amazon S3 的安裝 .zip 檔案清單。RDS Custom 會依資訊清單中列出的順序套用修補程式。
+ (選用) 針對 Oracle 基本目錄、Oracle 主目錄，以及 UNIX/Linux 使用者和群組的識別符和名稱設定非預設值的安裝參數。請注意，您無法修改現有 CEV 或現有資料庫執行個體的安裝參數。當安裝參數具有不同的設定時，您也無法從一個 CEV 升級到另一個 CEV。

如需範例 CEV 清單檔案，請參閱您在 [步驟 1 (選用)：下載清單檔案範本](#custom-cev.preparing.templates) 中下載的 JSON 範本。您也可以在中檢閱 [CEV 清單檔案範例](#custom-cev.preparing.manifest.examples) 中的範例。

**Topics**
+ [CEV 資訊清單中的 JSON 欄位](#custom-cev.preparing.manifest.fields)
+ [建立 CEV 資訊清單](#custom-cev.preparing.manifest.creating)
+ [CEV 清單檔案範例](#custom-cev.preparing.manifest.examples)

### CEV 資訊清單中的 JSON 欄位
<a name="custom-cev.preparing.manifest.fields"></a>

下列資料表說明資訊清單檔案中的 JSON 欄位。


| JSON 欄位 | Description | 
| --- | --- | 
|  `MediaImportTemplateVersion`  |  CEV 資訊清單的版本。日期格式為 `YYYY-MM-DD`。  | 
|  `databaseInstallationFileNames`  |  資料庫安裝檔案的排序清單。  | 
|  `opatchFileNames`  |  用於 Oracle 資料庫引擎的 OPatch 安裝程式排序清單。只有一個值有效。`opatchFileNames` 的值必須以 `p6880880_` 開頭。  | 
|  `psuRuPatchFileNames`  |  此資料庫的 PSU 和 RU 修補程式。  若包含 `psuRuPatchFileNames`，則 `opatchFileNames` 為必要項目。`opatchFileNames` 的值必須以 `p6880880_` 開頭。   | 
|  `OtherPatchFileNames`  |  不在 PSU 和 RU 修補程式清單中的修補程式。RDS Custom 會在套用 PSU 和 RU 修補程式之後套用這些修補程式。  若包含 `OtherPatchFileNames`，則 `opatchFileNames` 為必要項目。`opatchFileNames` 的值必須以 `p6880880_` 開頭。   | 
|  `installationParameters`  |  Oracle 基本目錄、Oracle 主目錄，以及 UNIX/Linux 使用者和群組的識別符和名稱的非預設值設定。您可以設定下列參數： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/AmazonRDS/latest/UserGuide/custom-cev.preparing.html)  | 

每個 Oracle 資料庫版本都有不同的支援安裝檔案清單。當您建立 CEV 資訊清單時，請務必指定僅適用於 Oracle 的 RDS 自訂所支援的檔案。否則，CEV 建立會失敗並顯示錯誤。支援[適用於 Oracle 的 Amazon Relational Database Service (Amazon RDS) 版本備註](https://docs.aws.amazon.com/AmazonRDS/latest/OracleReleaseNotes)中列出的所有修補程式。

### 建立 CEV 資訊清單
<a name="custom-cev.preparing.manifest.creating"></a>

**建立 CEV 清單檔案**

1. 按照您要套用的順序，列出您計劃套用的所有安裝檔案。

1. 將安裝檔案與 [CEV 資訊清單中的 JSON 欄位](#custom-cev.preparing.manifest.fields) 中所述的 JSON 欄位建立關聯。

1. 執行下列任何一項：
   + 將 CEV 清單檔案建立為 JSON 文字檔案。
   + 在主控台建立 CEV 時，編輯 CEV 清單檔案範本。如需詳細資訊，請參閱[建立 CEV](custom-cev.create.md)。

### CEV 清單檔案範例
<a name="custom-cev.preparing.manifest.examples"></a>

下列範例顯示不同 Oracle 資料庫版本的 CEV 清單檔案。若您在資訊清單中包含 JSON 欄位，請確保不是空的。例如，下列 CEV 清單檔案無效，因為 `otherPatchFileNames` 空白。

```
{
    "mediaImportTemplateVersion": "2020-08-14",
    "databaseInstallationFileNames": [
        "V982063-01.zip"
    ],
    "opatchFileNames": [
        "p6880880_190000_Linux-x86-64.zip"
    ],
    "psuRuPatchFileNames": [
        "p32126828_190000_Linux-x86-64.zip"
    ],
    "otherPatchFileNames": [
    ]
}
```

**主題**
+ [Sample CEV manifest for Oracle Database 12c Release 1 (12.1)](#oracle-cev-manifest-12.1)
+ [Sample CEV manifest for Oracle Database 12c Release 2 (12.2)](#oracle-cev-manifest-12.2)
+ [Sample CEV manifest for Oracle Database 18c](#oracle-cev-manifest-18c)
+ [Sample CEV manifest for Oracle Database 19c](#oracle-cev-manifest-19c)

**Example Oracle 資料庫 12c 版本 1 (12.1) 的 CEV 清單檔案範例**  
在 Oracle 資料庫 12c 版本 1 (12.1) 的 2021 年 7 月 PSU 範例中，RDS Custom 會指定的順序套用修補程式。因此，RDS Custom 會套用 p32768233，接著套用 p32876425，然後套用 p18759211，以此類推。此範例會針對 UNIX/Linux 使用者和群組，以及 Oracle 主目錄和 Oracle 基本目錄設定新值。  

```
{
    "mediaImportTemplateVersion":"2020-08-14",
    "databaseInstallationFileNames":[
        "V46095-01_1of2.zip",
        "V46095-01_2of2.zip"
    ],
    "opatchFileNames":[
        "p6880880_121010_Linux-x86-64.zip"
    ],
    "psuRuPatchFileNames":[
        "p32768233_121020_Linux-x86-64.zip"
    ],
    "otherPatchFileNames":[
        "p32876425_121020_Linux-x86-64.zip",
        "p18759211_121020_Linux-x86-64.zip",
        "p19396455_121020_Linux-x86-64.zip",
        "p20875898_121020_Linux-x86-64.zip",
        "p22037014_121020_Linux-x86-64.zip",
        "p22873635_121020_Linux-x86-64.zip",
        "p23614158_121020_Linux-x86-64.zip",
        "p24701840_121020_Linux-x86-64.zip",
        "p25881255_121020_Linux-x86-64.zip",
        "p27015449_121020_Linux-x86-64.zip",
        "p28125601_121020_Linux-x86-64.zip",
        "p28852325_121020_Linux-x86-64.zip",
        "p29997937_121020_Linux-x86-64.zip",
        "p31335037_121020_Linux-x86-64.zip",
        "p32327201_121020_Linux-x86-64.zip",
        "p32327208_121020_Generic.zip",
        "p17969866_12102210119_Linux-x86-64.zip",
        "p20394750_12102210119_Linux-x86-64.zip",
        "p24835919_121020_Linux-x86-64.zip",
        "p23262847_12102201020_Linux-x86-64.zip",
        "p21171382_12102201020_Generic.zip",
        "p21091901_12102210720_Linux-x86-64.zip",
        "p33013352_12102210720_Linux-x86-64.zip",
        "p25031502_12102210720_Linux-x86-64.zip",
        "p23711335_12102191015_Generic.zip",
        "p19504946_121020_Linux-x86-64.zip"
    ],
    "installationParameters": {
        "unixGroupName": "dba",
        "unixGroupId": 12345,
        "unixUname": "oracle",
        "unixUid": 12345,
        "oracleHome": "/home/oracle/oracle.12.1.0.2",
        "oracleBase": "/home/oracle"
    }
}
```

**Example Oracle 資料庫 12c 版本 2 (12.2) 的 CEV 清單檔案範例**  
在 Oracle 資料庫 12c 版本 2 (12.2) 的 2021 年 10 月 PSU 範例中，RDS Custom 會套用 p33261817，接著套用 p33192662，然後套用 p29213893，以此類推。此範例會針對 UNIX/Linux 使用者和群組，以及 Oracle 主目錄和 Oracle 基本目錄設定新值。  

```
{
    "mediaImportTemplateVersion":"2020-08-14",
    "databaseInstallationFileNames":[
        "V839960-01.zip"
    ],
    "opatchFileNames":[
        "p6880880_122010_Linux-x86-64.zip"
    ],
    "psuRuPatchFileNames":[
        "p33261817_122010_Linux-x86-64.zip"
    ],
    "otherPatchFileNames":[
        "p33192662_122010_Linux-x86-64.zip",
        "p29213893_122010_Generic.zip",
        "p28730253_122010_Linux-x86-64.zip",
        "p26352615_12201211019DBOCT2021RU_Linux-x86-64.zip",
        "p23614158_122010_Linux-x86-64.zip",
        "p24701840_122010_Linux-x86-64.zip",
        "p25173124_122010_Linux-x86-64.zip",
        "p25881255_122010_Linux-x86-64.zip",
        "p27015449_122010_Linux-x86-64.zip",
        "p28125601_122010_Linux-x86-64.zip",
        "p28852325_122010_Linux-x86-64.zip",
        "p29997937_122010_Linux-x86-64.zip",
        "p31335037_122010_Linux-x86-64.zip",
        "p32327201_122010_Linux-x86-64.zip",
        "p32327208_122010_Generic.zip"
    ],
    "installationParameters": {
        "unixGroupName": "dba",
        "unixGroupId": 12345,
        "unixUname": "oracle",
        "unixUid": 12345,
        "oracleHome": "/home/oracle/oracle.12.2.0.1",
        "oracleBase": "/home/oracle"
    }
}
```

**Example Oracle 資料庫 18c 的 CEV 清單檔案範例**  
在下列 Oracle 資料庫 18c 的 2021 年 10 月 PSU 範例中，RDS Custom 會套用 p32126855，接著套用 p28730253，然後套用 p27539475，依此類推。此範例會針對 UNIX/Linux 使用者和群組，以及 Oracle 主目錄和 Oracle 基本目錄設定新值。  

```
{
    "mediaImportTemplateVersion":"2020-08-14",
    "databaseInstallationFileNames":[
        "V978967-01.zip"
    ],
    "opatchFileNames":[
        "p6880880_180000_Linux-x86-64.zip"
    ],
    "psuRuPatchFileNames":[
        "p32126855_180000_Linux-x86-64.zip"
    ],
    "otherPatchFileNames":[
        "p28730253_180000_Linux-x86-64.zip",
        "p27539475_1813000DBRU_Linux-x86-64.zip",
        "p29213893_180000_Generic.zip",
        "p29374604_1813000DBRU_Linux-x86-64.zip",
        "p29782284_180000_Generic.zip",
        "p28125601_180000_Linux-x86-64.zip",
        "p28852325_180000_Linux-x86-64.zip",
        "p29997937_180000_Linux-x86-64.zip",
        "p31335037_180000_Linux-x86-64.zip",
        "p31335142_180000_Generic.zip"
    ]
    "installationParameters": {
        "unixGroupName": "dba",
        "unixGroupId": 12345,
        "unixUname": "oracle",
        "unixUid": 12345,
        "oracleHome": "/home/oracle/18.0.0.0.ru-2020-10.rur-2020-10.r1",
        "oracleBase": "/home/oracle/"
    }
}
```

**Example Oracle 資料庫 19c 的 CEV 清單檔案範例**  
在下列 Oracle 資料庫 19c 的範例中，RDS Custom 會套用 p32126828，接著套用 p29213893，然後套用 p29782284，依此類推。此範例會針對 UNIX/Linux 使用者和群組，以及 Oracle 主目錄和 Oracle 基本目錄設定新值。  

```
{
    "mediaImportTemplateVersion": "2020-08-14",
    "databaseInstallationFileNames": [
        "V982063-01.zip"
    ],
    "opatchFileNames": [
        "p6880880_190000_Linux-x86-64.zip"
    ],
    "psuRuPatchFileNames": [
        "p32126828_190000_Linux-x86-64.zip"
    ],
    "otherPatchFileNames": [
        "p29213893_1910000DBRU_Generic.zip",
        "p29782284_1910000DBRU_Generic.zip",
        "p28730253_190000_Linux-x86-64.zip",
        "p29374604_1910000DBRU_Linux-x86-64.zip",
        "p28852325_190000_Linux-x86-64.zip",
        "p29997937_190000_Linux-x86-64.zip",
        "p31335037_190000_Linux-x86-64.zip",
        "p31335142_190000_Generic.zip"
    ],
    "installationParameters": {
        "unixGroupName": "dba",
        "unixGroupId": 12345,
        "unixUname": "oracle",
        "unixUid": 12345,
        "oracleHome": "/home/oracle/oracle.19.0.0.0.ru-2020-04.rur-2020-04.r1.EE.1",
        "oracleBase": "/home/oracle"
    }
}
```

## 步驟 6 (選用)：驗證 CEV 清單檔案
<a name="custom-cev.preparing.validating"></a>

或者，藉由執行 `json.tool` Python 指令碼來確認資訊清單是有效的 JSON 檔案。例如，如果您變更為包含名為 `manifest.json` 之 CEV 資訊清單的目錄，則執行下列命令。

```
python -m json.tool < manifest.json
```

## 步驟 7：新增必要的 IAM 許可
<a name="custom-cev.preparing.iam"></a>

請確保建立 CEV 的 IAM 主體具有 [步驟 5：將所需的許可授予您的 IAM 使用者或角色](custom-setup-orcl.md#custom-setup-orcl.iam-user) 中所述的必要政策。

# 建立 CEV
<a name="custom-cev.create"></a>

您可以使用 AWS 管理主控台 或 AWS CLI 建立 CEV。指定多租戶或非多租戶架構。如需更多詳細資訊，請參閱 [多租戶架構考量](custom-creating.md#custom-creating.overview)。

一般而言，建立 CEV 大約需要兩個小時。在建立 CEV 之後，您可以使用它來建立或更新 RDS Custom 資料庫執行個體。如需詳細資訊，請參閱[建立 RDS Custom for Oracle 資料庫執行個體](custom-creating.md#custom-creating.create)及[升級 RDS Custom for Oracle 資料庫執行個體](custom-upgrading-modify.md)。

**注意**  
如果您的資料庫執行個體目前使用 Oracle Linux 7.9，請建立使用最新 AMI 的新 CEV，這會使用 Oracle Linux 8。然後修改執行個體以使用新的 CEV。

請注意建立 CEV 的下列要求和限制：
+ 包含您的安裝檔案的 Amazon S3 儲存貯體必須位於與您的 CEV 相同的 AWS 區域 中。否則，建立程序會失敗。
+ CEV 名稱的格式必須是 `major-engine-version.customized_string`，如 `19.cdb_cev1` 中所示。
+ CEV 名稱必須包含 1 到 50 個英數字元、底線、破折號或句點。
+ CEV 名稱不能包含連續的句點，如 `19..cdb_cev1` 中所示。

## 主控台
<a name="custom-cev.create.console"></a>

**若要建立 CEV**

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

1. 在導覽窗格中，選擇 **Custom engine versions** (自訂引擎版本)。

   **Custom engine versions** (自訂引擎版本) 頁面會顯示目前存在的所有 CEV。如果您尚未建立任何 CEV，則頁面為空白。

1. 選擇 **Create custom engine version** (建立自訂引擎版本)。

1. 在**引擎選項**中，執行下列動作：

   1. 針對 **Engine type** (引擎類型)，請選擇 **Oracle**。

   1. 對於**架構設定**，選擇性地選擇**多租用戶架構**以建立 Oracle 多租用戶 CEV，這會使用資料庫引擎 `custom-oracle-ee-cdb` 或 `custom-oracle-se2-cdb`。您只能使用多租戶 CEV 建立 RDS Custom for Oracle CDB。如果未選擇此選項，您的 CEV 是使用引擎 `custom-oracle-ee` 或 `custom-oracle-se2` 的非 CDB。
**注意**  
您選擇的架構是 CEV 的永久特性。您無法將 CEV 修改為稍後使用不同的架構。

   1. 請選擇下列其中一個選項：
      + **建立新 CEV** - 從頭開始建立 CEV。在此情況下，您必須指定 JSON 清單檔案，其會指定資料庫二進位檔案。
      + **從來源建立 CEV** - 在**指定要複製的 CEV** 中，選擇要用作來源 CEV 的現有 CEV。在此情況下，您可以指定新的 Amazon Machine Image (AMI)，但無法指定不同的資料庫二進位檔案。

   1. 在**引擎版本**中，選擇主要引擎版本。

1. 在**版本詳細資訊**中，執行下列動作：

   1. 在**自訂引擎版本名稱**中輸入有效名稱。例如，您輸入名稱 **19.cdb\$1cev1**。

   1. (選用) 輸入 CEV 的描述。

1. 在**安裝媒體**中，執行下列動作：

   1. (選用) 針對 **AMI ID**，將欄位保留空白以使用最新服務提供的 AMI，或輸入您先前用來建立 CEV 的 AMI。若要取得有效的 AMI ID，請使用下列任一技巧：
      + 在主控台中，選擇左側導覽窗格中的**自訂引擎版本**，然後選擇 CEV 的名稱。CEV 使用的 AMI ID 會出現在**組態**索引標籤中。
      + 在 AWS CLI 中，使用 `describe-db-engine-versions` 命令。搜尋輸出找出 `ImageID`。

   1. 針對 **S3 location of manifest files (資訊清單檔案的 S3 位置)**，輸入您在 [步驟 3：將您的安裝檔案上傳到 Amazon S3](custom-cev.preparing.md#custom-cev.preparing.s3) 中指定之 Amazon S3 儲存貯體的位置。例如，​輸入 **s3://my-custom-installation-files/123456789012/cev1/**。
**注意**  
您在其中建立 CEV 的 AWS 區域必須位於與 S3 儲存貯體相同的區域中。

   1. (僅建立新的 CEV) 對於 **CEV 清單檔案**，輸入您已在 [建立 CEV 資訊清單](custom-cev.preparing.md#custom-cev.preparing.manifest.creating) 建立的 JSON 清單檔案。

1. 在 **KMS 金鑰**區段中，選取**輸入金鑰 ARN** 以列出可用的 AWS KMS 金鑰。然後從清單選取 KMS 金鑰。

   RDS Custom 需要 AWS KMS 金鑰。如需更多詳細資訊，請參閱 [步驟 1：建立或重複使用對稱加密 AWS KMS 金鑰](custom-setup-orcl.md#custom-setup-orcl.cmk)。

1. (選用) 選擇**新增標籤**，為 CEV 建立鍵值組。

1. 選擇 **Create custom engine version** (建立自訂引擎版本)。

   如果 JSON 清單檔案的格式無效，主控台會顯示**驗證 CEV 清單檔案時發生錯誤**。修正問題，然後重試。

**Custom engine versions** (自訂引擎版本) 頁面隨即出現。您的 CEV 會顯示狀態 **Creating (正在建立)**。建立 CEV 的程序大約需要兩個小時。

## AWS CLI
<a name="custom-cev.create.CEV"></a>

若要使用 AWS CLI 建立 CEV，請執行 [create-custom-db-engine-version](https://docs.aws.amazon.com/cli/latest/reference/rds/create-custom-db-engine-version.html) 命令。

下列選項是必要的：
+ `--engine` – 指定引擎類型。對於 CDB，指定 `custom-oracle-ee-cdb` 或 `custom-oracle-se2-cdb`。對於非 CDB，指定 `custom-oracle-ee` 或 `custom-oracle-se2`。您只能從使用 `custom-oracle-ee-cdb` 或 `custom-oracle-se2-cdb` 建立的 CEV 建立 CDB。您只能從使用 `custom-oracle-ee` 或 `custom-oracle-se2` 建立的 CEV 建立非 CDB。
+ `--engine-version` - 指定引擎版本。格式是 *major-engine-version*.*customized\$1string*。CEV 名稱必須包含 1 到 50 個英數字元、底線、破折號或句點。CEV 名稱不能包含連續的句點，如 `19..cdb_cev1` 中所示。
+ `--kms-key-id` – 指定 AWS KMS key。
+ `--manifest` – 指定 `manifest_json_string` 或 `--manifest file:file_name`。`manifest_json_string` 中不允許換行字元。請務必轉義 JSON 程式碼中的雙引號 (")，方法是在引號前加上反斜杠 (\$1)。

  下列範例為 19c 顯示了來自 [步驟 5：準備 CEV 清單檔案](custom-cev.preparing.md#custom-cev.preparing.manifest) 的 `manifest_json_string`。此範例會針對 Oracle 基本目錄、Oracle 主目錄，以及 UNIX/Linux 使用者和群組的識別符和名稱設定新值。如果您複製此字串，請在將其貼到命令之前移除所有換行字元。

  `"{\"mediaImportTemplateVersion\": \"2020-08-14\",\"databaseInstallationFileNames\": [\"V982063-01.zip\"],\"opatchFileNames\": [\"p6880880_190000_Linux-x86-64.zip\"],\"psuRuPatchFileNames\": [\"p32126828_190000_Linux-x86-64.zip\"],\"otherPatchFileNames\": [\"p29213893_1910000DBRU_Generic.zip\",\"p29782284_1910000DBRU_Generic.zip\",\"p28730253_190000_Linux-x86-64.zip\",\"p29374604_1910000DBRU_Linux-x86-64.zip\",\"p28852325_190000_Linux-x86-64.zip\",\"p29997937_190000_Linux-x86-64.zip\",\"p31335037_190000_Linux-x86-64.zip\",\"p31335142_190000_Generic.zip\"]\"installationParameters\":{ \"unixGroupName\":\"dba\", \ \"unixUname\":\"oracle\", \ \"oracleHome\":\"/home/oracle/oracle.19.0.0.0.ru-2020-04.rur-2020-04.r1.EE.1\", \ \"oracleBase\":\"/home/oracle/\"}}"`
+ `--database-installation-files-s3-bucket-name` - 指定您已在 [步驟 3：將您的安裝檔案上傳到 Amazon S3](custom-cev.preparing.md#custom-cev.preparing.s3) 中指定的相同儲存貯體名稱。您在其中執行 `create-custom-db-engine-version` 的 AWS 區域必須是與您的 Amazon S3 儲存貯體相同的區域。

您還可以指定下列選項：
+ `--description` - 指定 CEV 的描述。
+ `--database-installation-files-s3-prefix` - 指定您已在 [步驟 3：將您的安裝檔案上傳到 Amazon S3](custom-cev.preparing.md#custom-cev.preparing.s3) 中指定的資料夾名稱。
+ `--image-id` - 指定要重複使用的 AMI ID。若要尋找有效的 ID，請執行 `describe-db-engine-versions` 命令，然後搜尋輸出找出 `ImageID`。根據預設，RDS Custom for Oracle 會使用最新的可用 AMI。

下列範例會建立名為 `19.cdb_cev1` 的 Oracle 多租戶 CEV。此範例會重複使用現有的 AMI，而不是使用最新的可用 AMI。請確保 CEV 的名稱以主要引擎版本號為開頭。

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

```
1. aws rds create-custom-db-engine-version \
2.     --engine custom-oracle-se2-cdb \
3.     --engine-version 19.cdb_cev1 \
4.     --database-installation-files-s3-bucket-name us-east-1-123456789012-custom-installation-files \
5.     --database-installation-files-s3-prefix 123456789012/cev1 \
6.     --kms-key-id my-kms-key \
7.     --description "test cev" \
8.     --manifest manifest_string \
9.     --image-id ami-012a345678901bcde
```
在 Windows 中：  

```
1. aws rds create-custom-db-engine-version ^
2.     --engine custom-oracle-se2-cdb ^
3.     --engine-version 19.cdb_cev1 ^
4.     --database-installation-files-s3-bucket-name us-east-1-123456789012-custom-installation-files ^
5.     --database-installation-files-s3-prefix 123456789012/cev1 ^
6.     --kms-key-id my-kms-key ^
7.     --description "test cev" ^
8.     --manifest manifest_string ^
9.     --image-id ami-012a345678901bcde
```

**Example**  
使用 `describe-db-engine-versions` 命令取得 CEV 的詳細資訊。  

```
1. aws rds describe-db-engine-versions \
2.     --engine custom-oracle-se2-cdb \
3.     --include-all
```
下列部分輸出顯示引擎、參數群組、清單檔案，以及其他資訊。  

```
 1. {
 2.     "DBEngineVersions": [
 3.         {
 4.             "Engine": "custom-oracle-se2-cdb",
 5.             "EngineVersion": "19.cdb_cev1",
 6.             "DBParameterGroupFamily": "custom-oracle-se2-cdb-19",
 7.             "DBEngineDescription": "Containerized Database for Oracle Custom SE2",
 8.             "DBEngineVersionDescription": "test cev",
 9.             "Image": {
10.                 "ImageId": "ami-012a345678901bcde",
11.                 "Status": "active"
12.             },
13.             "ValidUpgradeTarget": [],
14.             "SupportsLogExportsToCloudwatchLogs": false,
15.             "SupportsReadReplica": true,
16.             "SupportedFeatureNames": [],
17.             "Status": "available",
18.             "SupportsParallelQuery": false,
19.             "SupportsGlobalDatabases": false,
20.             "MajorEngineVersion": "19",
21.             "DatabaseInstallationFilesS3BucketName": "us-east-1-123456789012-custom-installation-files",
22.             "DatabaseInstallationFilesS3Prefix": "123456789012/cev1",
23.             "DBEngineVersionArn": "arn:aws:rds:us-east-1:123456789012:cev:custom-oracle-se2-cdb/19.cdb_cev1/abcd12e3-4f5g-67h8-i9j0-k1234l56m789",
24.             "KMSKeyId": "arn:aws:kms:us-east-1:732027699161:key/1ab2345c-6d78-9ef0-1gh2-3456i7j89k01",
25.             "CreateTime": "2023-03-07T19:47:58.131000+00:00",
26.             "TagList": [],
27.             "SupportsBabelfish": false,
28. ...
```

## 無法建立 CEV
<a name="custom-cev.create.failure"></a>

如果 CEV 建立的程序失敗，會發生 RDS Custom 問題 `RDS-EVENT-0198` 並且有訊息 `Creation failed for custom engine version major-engine-version.cev_name`，其中包含失敗的詳細資訊。例如，事件會列印遺失的檔案。

您無法修改失敗的 CEV。您只能刪除它，然後在修正失敗原因之後再試一次建立 CEV。如需有關 CEV 建立失敗原因進行疑難排解的詳細資訊，請參閱 [針對 RDS Custom for Oracle 的自訂引擎版本建立進行故障診斷](custom-troubleshooting.md#custom-troubleshooting.cev)。

# 修改 CEV 狀態
<a name="custom-cev.modify"></a>

您可以使用 AWS 管理主控台 或 AWS CLI 修改 CEV。您可以修改 CEV 描述或其可用狀態。您的 CEV 有下列其中一個狀態值：
+ `available` – 您可以使用此 CEV 建立新的 RDS Custom 資料庫執行個體或升級資料庫執行個體。這是新建立的 CEV 的預設狀態。
+ `inactive` – 您無法使用此 CEV 建立或升級 RDS Custom 執行個體。您無法還原資料庫快照以使用此 CEV 建立新的 RDS Custom 資料庫執行個體。

您可以將 CEV 從任何支援狀態變更為任何其他支援狀態。您可以變更狀態，以防止意外使用 CEV，或讓已停產的 CEV 符合再次使用的資格。例如，您可以將 CEV 的狀態從 `available` 變更為 `inactive`，以及從 `inactive` 變更回 `available`。

## 主控台
<a name="custom-cev.modify.console"></a>

**若要修改 CEV**

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

1. 在導覽窗格中，選擇 **Custom engine versions** (自訂引擎版本)。

1. 選擇您想要修改其描述或狀態的 CEV。

1. 在 **Actions** (動作) 中，選擇 **Modify** (修改)。

1. 進行下列任何變更：
   + 針對 **CEV status settings (CEV 狀態設定)**，選擇新的可用性狀態。
   + 針對 **Version description (版本描述)**，輸入新的描述。

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

   如果 CEV 正在使用中，主控台會顯示**您無法修改 CEV 狀態**。修正問題，然後重試。

**Custom engine versions** (自訂引擎版本) 頁面隨即出現。

## AWS CLI
<a name="custom-cev.modify.cli"></a>

若要使用 AWS CLI 修改 CEV，請執行 [modify-custom-db-engine-version](https://docs.aws.amazon.com/cli/latest/reference/rds/modify-custom-db-engine-version.html) 命令。您可以藉由執行 [describe-db-engine-versions](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-engine-versions.html) 命令來尋找要修改的 CEV。

下列選項是必要的：
+ `--engine engine-type`，其中 *engine-type* 為 `custom-oracle-ee`、`custom-oracle-se2`、`custom-oracle-ee-cdb` 或 `custom-oracle-se2-cdb`
+ `--engine-version cev`，其中 *`cev`* 是您要修改的自訂引擎版本的名稱。
+ `--status`` status`，其中 *`status`* 是您要指派給 CEV 的可用性狀態。

下列範例會將名為 `19.my_cev1` 的 CEV 從目前的狀態變更為 `inactive`。

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

```
1. aws rds modify-custom-db-engine-version \
2.     --engine custom-oracle-se2 \ 
3.     --engine-version 19.my_cev1 \
4.     --status inactive
```
在 Windows 中：  

```
1. aws rds modify-custom-db-engine-version ^
2.     --engine custom-oracle-se2 ^
3.     --engine-version 19.my_cev1 ^
4.     --status inactive
```

# 檢視 Amazon RDS Custom for Oracle 的 CEV 詳細資訊
<a name="custom-cev.view"></a>

您可以使用 AWS 管理主控台 或 AWS CLI，檢視 CEV 清單檔案的詳細資訊，以及用來建立 CEV 之命令的詳細資訊。

## 主控台
<a name="custom-cev.view.console"></a>

**檢視 CEV 詳細資訊**

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

1. 在導覽窗格中，選擇 **Custom engine versions** (自訂引擎版本)。

   **Custom engine versions** (自訂引擎版本) 頁面會顯示目前存在的所有 CEV。如果您尚未建立任何 CEV，則頁面為空白。

1. 選擇要檢視的 CEV 名稱。

1. 選擇 **Configuration** (組態) 以檢視清單檔案中指定的安裝參數。  
![\[檢視 CEV 的安裝參數。\]](http://docs.aws.amazon.com/zh_tw/AmazonRDS/latest/UserGuide/images/cev-configuration-tab.png)

1. 選擇 **Manifest** (清單檔案) 以檢視在 `create-custom-db-engine-version` 命令的 `--manifest` 選項中指定的安裝參數。您可以複製此文字、視需要取代這些值，然後在新命令中使用它們。  
![\[檢視用來建立 CEV 的命令。\]](http://docs.aws.amazon.com/zh_tw/AmazonRDS/latest/UserGuide/images/cev-manifest-tab.png)

## AWS CLI
<a name="custom-cev.view.CEV"></a>

若要使用 AWS CLI 檢視 CEV 的詳細資訊，請執行 [describe-db-engine-versions](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-engine-versions.html) 命令。

下列選項是必要的：
+ `--engine engine-type`，其中 *engine-type* 為 `custom-oracle-ee`、`custom-oracle-se2`、`custom-oracle-ee-cdb` 或 `custom-oracle-se2-cdb`
+ `--engine-version major-engine-version.customized_string`

下列範例會建立使用 Enterprise Edition 的非 CDB CEV。CEV 名稱 `19.my_cev1` 開頭為主要引擎版本編號，此為必要項目。

**Example**  
在 Linux、macOS 或 Unix 中：  

```
1. aws rds describe-db-engine-versions \
2.     --engine custom-oracle-ee \
3.     --engine-version 19.my_cev1
```
在 Windows 中：  

```
1. aws rds describe-db-engine-versions ^
2.     --engine custom-oracle-ee ^
3.     --engine-version 19.my_cev1
```
下列部分輸出顯示引擎、參數群組、清單檔案，以及其他資訊。  

```
 1. "DBEngineVersions": [
 2.     {
 3.         "Engine": "custom-oracle-ee",
 4.         "MajorEngineVersion": "19",
 5.         "EngineVersion": "19.my_cev1",
 6.         "DatabaseInstallationFilesS3BucketName": "us-east-1-123456789012-cev-customer-installation-files",
 7.         "DatabaseInstallationFilesS3Prefix": "123456789012/cev1",
 8.         "CustomDBEngineVersionManifest": "{\n\"mediaImportTemplateVersion\": \"2020-08-14\",\n\"databaseInstallationFileNames\": [\n\"V982063-01.zip\"\n],\n\"installationParameters\": {\n\"oracleBase\":\"/tmp\",\n\"oracleHome\":\"/tmp/Oracle\"\n},\n\"opatchFileNames\": [\n\"p6880880_190000_Linux-x86-64.zip\"\n],\n\"psuRuPatchFileNames\": [\n\"p32126828_190000_Linux-x86-64.zip\"\n],\n\"otherPatchFileNames\": [\n\"p29213893_1910000DBRU_Generic.zip\",\n\"p29782284_1910000DBRU_Generic.zip\",\n\"p28730253_190000_Linux-x86-64.zip\",\n\"p29374604_1910000DBRU_Linux-x86-64.zip\",\n\"p28852325_190000_Linux-x86-64.zip\",\n\"p29997937_190000_Linux-x86-64.zip\",\n\"p31335037_190000_Linux-x86-64.zip\",\n\"p31335142_190000_Generic.zip\"\n]\n}\n",
 9.         "DBParameterGroupFamily": "custom-oracle-ee-19",
10.         "DBEngineDescription": "Oracle Database server EE for RDS Custom",
11.         "DBEngineVersionArn": "arn:aws:rds:us-west-2:123456789012:cev:custom-oracle-ee/19.my_cev1/0a123b45-6c78-901d-23e4-5678f901fg23",
12.         "DBEngineVersionDescription": "test",
13.         "KMSKeyId": "arn:aws:kms:us-east-1:123456789012:key/ab1c2de3-f4g5-6789-h012-h3ijk4567l89",
14.         "CreateTime": "2022-11-18T09:17:07.693000+00:00",
15.         "ValidUpgradeTarget": [
16.         {
17.             "Engine": "custom-oracle-ee",
18.             "EngineVersion": "19.cev.2021-01.09",
19.             "Description": "test",
20.             "AutoUpgrade": false,
21.             "IsMajorVersionUpgrade": false
22.         }
23. ]
```

# 刪除 CEV
<a name="custom-cev.delete"></a>

您可以使用 AWS 管理主控台 或 AWS CLI 刪除 CEV。通常需要幾分鐘的時間。

若要刪除 CEV，下列任何一項都無法使用該 CEV：
+ RDS Custom 資料庫執行個體
+ RDS Custom 資料庫執行個體的快照
+ RDS Custom 資料庫執行個體的自動備份

## 主控台
<a name="custom-cev.create.console"></a>

**若要刪除 CEV**

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

1. 在導覽窗格中，選擇 **Custom engine versions** (自訂引擎版本)。

1. 選擇您想要刪除其描述或狀態的 CEV。

1. 對於 **Actions** (動作)，請選擇 **Delete** (刪除)。

   **Delete *cev\$1name*? (是否刪除 cev\$1name？)** 對話方塊隨即顯示。

1. 輸入 **delete me**，然後選擇 **Delete (刪除)**。

   在 **Custom engine versions** (自訂引擎版本) 頁面上，橫幅會顯示您的 CEV 即將刪除。

## AWS CLI
<a name="custom-cev.create.console.cli"></a>

若要使用 AWS CLI 刪除 CEV，請執行 [delete-custom-db-engine-version](https://docs.aws.amazon.com/cli/latest/reference/rds/delete-custom-db-engine-version.html) 命令。

下列選項是必要的：
+ `--engine engine-type`，其中 *engine-type* 為 `custom-oracle-ee`、`custom-oracle-se2`、`custom-oracle-ee-cdb` 或 `custom-oracle-se2-cdb`
+ `--engine-version cev`，其中 *CEV* 是要刪除之自訂引擎版本的名稱

以下範例會刪除名為 `19.my_cev1` 的 CEV。

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

```
1. aws rds delete-custom-db-engine-version \
2.     --engine custom-oracle-ee \
3.     --engine-version 19.my_cev1
```
在 Windows 中：  

```
1. aws rds delete-custom-db-engine-version ^
2.     --engine custom-oracle-ee ^
3.     --engine-version 19.my_cev1
```