

# Deploying RDS Custom for Oracle with Amazon CloudFormation
Deploy with Amazon CloudFormation

**Note**  
End of support notice: On March 31, 2027, Amazon will end support for Amazon RDS Custom for Oracle. After March 31, 2027, you will no longer be able to access the RDS Custom for Oracle console or RDS Custom for Oracle resources. For more information, see [RDS Custom for Oracle end of support](RDS-Custom-for-Oracle-end-of-support.md).

Automate your RDS Custom for Oracle deployment using the provided Amazon CloudFormation template. Complete the following prerequisites before deploying the resources.

## Prerequisites
Prerequisites<a name="custom-oracle-required-files"></a>

**Download required Oracle files**

You need specific Oracle installation files before you can create the Amazon CloudFormationtemplate. Download these files before you deploy.

1. Navigate to [Oracle Database 19c (19.3)](https://www.oracle.com/database/technologies/oracle19c-linux-downloads.html)

1. Locate and download the file `LINUX.X64_193000_db_home.zip`

1. Rename the file to`V982063-01.zip`

1. Download the remaining patches, selecting **Platform or Language** as `Linux x86-64`

### Latest OPatch utility
OPatch

[Patch 6880880](https://updates.oracle.com/Orion/PatchDetails/process_form?patch_num=6880880)

### January 2023 PSU Patches
January 2023 Patches

**Database PSU & RU Patches**
+ [Patch 34765931](https://updates.oracle.com/Orion/PatchDetails/process_form?patch_num=34765931)
+ [Patch 34786990](https://updates.oracle.com/Orion/PatchDetails/process_form?patch_num=34786990)

**Additional Required Patches**
+ [Patch 35099667](https://updates.oracle.com/Orion/PatchDetails/process_form?patch_num=35099667)
+ [Patch 35099674](https://updates.oracle.com/Orion/PatchDetails/process_form?patch_num=35099674)
+ [Patch 28730253](https://updates.oracle.com/Orion/PatchDetails/process_form?patch_num=28730253)
+ [Patch 29213893](https://updates.oracle.com/Orion/PatchDetails/process_form?patch_num=29213893)
+ [Patch 35012866](https://updates.oracle.com/Orion/PatchDetails/process_form?patch_num=35012866)

### April 2023 PSU Patches
April 2023 Patches

**Database PSU & RU Patches**
+ [Patch 35042068](https://updates.oracle.com/Orion/PatchDetails/process_form?patch_num=35042068)
+ [Patch 35050341](https://updates.oracle.com/Orion/PatchDetails/process_form?patch_num=35050341)

**Additional Required Patches**
+ [Patch 28730253](https://updates.oracle.com/Orion/PatchDetails/process_form?patch_num=28730253)
+ [Patch 29213893](https://updates.oracle.com/Orion/PatchDetails/process_form?patch_num=29213893)
+ [Patch 33125873](https://updates.oracle.com/Orion/PatchDetails/process_form?patch_num=33125873)
+ [Patch 35220732](https://updates.oracle.com/Orion/PatchDetails/process_form?patch_num=35220732)
+ [Patch 35239280](https://updates.oracle.com/Orion/PatchDetails/process_form?patch_num=35239280)

### Amazon S3 bucket setup
Amazon S3 setup

1. Create an Amazon S3 bucket in your Amazon Web Services account, or choose an existing bucket.

1. Create a folder structure in the bucket similar to example below.

   ```
   <bucket-name>/
   └── oracle_cev/
       ├── V982063-01.zip
       ├── p6880880_190000_Linux-x86-64.zip
       ├── p34765931_190000_Linux-x86-64.zip
       ├── p34786990_190000_Linux-x86-64.zip
       ├── p35099667_190000_Linux-x86-64.zip
       ├── p35099674_190000_Generic.zip
       ├── p28730253_190000_Linux-x86-64.zip
       ├── p29213893_1918000DBRU_Generic.zip
       ├── p35012866_1918000DBRU_Linux-x86-64.zip
       ├── p35042068_190000_Linux-x86-64.zip
       ├── p35050341_190000_Linux-x86-64.zip
       ├── p29213893_1919000DBRU_Generic.zip
       ├── p33125873_1919000DBRU_Linux-x86-64.zip
       ├── p35220732_190000_Linux-x86-64.zip
       └── p35239280_190000_Generic.zip
   ```

1. Upload all of Oracle files that you previously downloaded to the appropriate folders.

## Deploy RDS Custom for Oracle using Amazon CloudFormation
Deployment steps

### Step 1: Prepare the Amazon CloudFormation template


Before you can deploy RDS Custom for Oracle, you need to download and configure the Amazon CloudFormation template that creates the necessary prerequisites. 

**Copy and save the template**

1. Go to [Deploying RDS Custom for Oracle with single and multiple Availability Zones](https://docs.amazonaws.cn/AWSCloudFormation/latest/TemplateReference/aws-resource-rds-dbinstance.html#aws-resource-rds-dbinstance--examples--Deploying_RDS_Custom_for_Oracle_with_single_and_multiple_Availability_Zones)

1. Copy the template in your preferred format (YAML or JSON)

1. Save the file in YAML or JSON format. For example, `rds-custom-oracle-prereqs.yaml`

**Launch the stack in the Amazon console**

1. Open the Amazon Console and navigate to Amazon CloudFormation

1. Choose **Create stack** > **With new resources (standard)**

1. Select **Choose an existing template** 

1. Select **Upload a template file** > **Choose file**

1. Select the template file you previously downloaded

1. Keep the default parameter values

1. Select **Next** to create the stack

**Alternative: Using Amazon CLI**

Instead of using the console, you can create the stack using the Amazon CLI:

```
aws cloudformation create-stack \
  --stack-name rds-custom-oracle \
  --template-body file://rds-custom-oracle-prereqs.yaml \
  --capabilities CAPABILITY_NAMED_IAM
```

### Step 2: Create the Custom Engine Versions (CEVs) and Amazon RDS instances
Step 2: Create CEVs and Amazon RDS instances

**Copy and save the template**

1. Go to [Deploying RDS Custom for Oracle with single and multiple Availability Zones](https://docs.amazonaws.cn/AWSCloudFormation/latest/TemplateReference/aws-resource-rds-dbinstance.html#aws-resource-rds-dbinstance--examples--Deploying_RDS_Custom_for_Oracle_with_single_and_multiple_Availability_Zones)

1. Copy the template in your preferred format (YAML or JSON)

1. Update the following parameters in the template if needed:
   + `BucketName`
   + `CEVS3Prefix`
   + Database master password (replace \$1\$1\$1\$1\$1\$1\$1\$1\$1\$1\$1\$1\$1)

1. Save the file in YAML or JSON format

### Step 3: Deploy using the Amazon console
Step 3: Console deployment

1. Open the Amazon Console and navigate to Amazon CloudFormation

1. Choose **Create stack** > **With new resources (standard)**

1. Select **Choose an existing template** 

1. Select **Upload a template file** > **Choose file**

1. Select the template file you previously downloaded

1. Leave the parameters as default values

1. Fill in the parameters as follows:

   ```
   BucketName: rds-custom-id
   CEVS3Prefix: oracle_cev
   CEVCreation: Yes
   ```

1. Review the configuration and select **Next** to create the stack

**Optional: Deploy Using Amazon CLI**

```
aws cloudformation create-stack \
  --stack-name rds-custom-oracle \
  --template-body file://rds-custom-oracle.yaml \
  --parameters \
    ParameterKey=BucketName,ParameterValue=rds-custom-id \
    ParameterKey=CEVS3Prefix,ParameterValue=oracle_cev \
    ParameterKey=CEVCreation,ParameterValue=Yes \
  --capabilities CAPABILITY_NAMED_IAM
```

## Deployment resources created
Resources Created

The template creates the following resources:
+ Amazon VPC with public and private subnets
+ Security groups
+ Amazon VPC endpoints
+ IAM roles and policies
+ Amazon KMS key for encryption
+ Custom Engine Versions (CEVs)
+ RDS Custom for Oracle instances for both single-AZ and multi-AZ configurations

## Monitor your deployment progress


After you create the Amazon CloudFormation stack, monitor its progress to ensure successful deployment. The deployment process includes creating Custom Engine Versions (CEVs) and RDS instances.

To monitor deployment progress:

1. Open the Amazon CloudFormation console.

1. Choose your stack name.

1. Choose the **Events** tab to view progress and identify any errors.

**Note**  
CEV creation typically requires 2-3 hours. After CEV creation completes successfully, Amazon RDS automatically begins creating the Amazon RDS instance.

## Post-Deployment
Post-Deployment

After the stack creation process completes, perform the following post-deployment verification and configuration steps:

1. From the Amazon RDS console page, navigate to **Custom engine versions** to verify CEV creation.

1. Confirm Amazon RDS instances are created and available

1. Test connectivity to the Amazon RDS instances

1. Set up monitoring and backup strategies as needed

## Cleanup
Cleanup

To remove all resources, run the following Amazon CLI command:

```
aws cloudformation delete-stack --stack-name rds-custom-oracle
```

## Troubleshooting
Troubleshooting

If you encounter issues during deployment, use the following solutions to resolve common problems.

CEV creation fails  
+ Verify all required patches are uploaded to Amazon S3
+ Check IAM permissions
+ Verify the patch versions are correct; see the [Prerequisites](#custom-oracle-prerequisites) for the list of required patches.

Amazon RDS instance creation fails  
+ Check VPC/subnet configurations
+ Verify security group rules
+ Confirm CEV is available