

# RDS Custom 환경 사용자 지정
<a name="custom-managing.customizing-env"></a>

RDS Custom for Oracle에는 자동화를 일시 중지하지 않고도 DB 인스턴스 환경을 사용자 지정할 수 있는 내장 기능이 포함되어 있습니다. 예를 들어 RDS API를 사용하면 다음과 같이 환경을 사용자 지정할 수 있습니다.
+ DB 스냅샷을 생성하고 복원하여 클론 환경을 생성합니다.
+ 읽기 전용 복제본을 생성합니다.
+ 스토리지 설정을 수정합니다.
+ CEV를 변경하여 릴리스 업데이트 적용

문자 집합을 변경하는 등의 일부 사용자 지정 작업에는 RDS API를 사용할 수 없습니다. 이러한 경우 루트 사용자로 Amazon EC2 인스턴스에 액세스하거나 Oracle 데이터베이스에 `SYSDBA`로 로그인하여 환경을 수동으로 변경해야 합니다.

인스턴스를 수동으로 사용자 지정하려면 RDS Custom 자동화를 일시 중지했다가 재개해야 합니다. 이렇게 일시 중지하면 사용자 지정한 인스턴스가 RDS Custom 자동화를 방해하지 않도록 할 수 있습니다. 이 방법을 사용하면 지원 경계가 무너지는 것을 방지할 수 있습니다. 그러면 기본 문제가 해결될 때까지 인스턴스가 `unsupported-configuration` 상태로 유지됩니다. RDS Custom for Oracle DB 인스턴스를 수정할 때 지원되는 자동화 태스크는 자동화 일시 중지 및 재개뿐입니다.

## RDS 사용자 지정 환경을 사용자 지정하는 일반적인 단계
<a name="custom-managing.pausing.general-steps"></a>

RDS Custom DB 인스턴스를 사용자 지정하려면 다음 단계를 완료합니다.

1. 콘솔 또는 CLI를 사용하여 지정된 기간 동안 RDS Custom 자동화를 일시 중지합니다.

1. 기본 Amazon EC2 인스턴스를 확인합니다.

1. SSH 키 또는 AWS Systems Manager를 사용하여 기본 Amazon EC2 인스턴스에 연결합니다.

1. 데이터베이스 또는 운영 체제 계층에서 현재 구성 설정을 확인합니다.

   초기 구성을 변경된 구성과 비교하여 변경 내용을 검증할 수 있습니다. 사용자 지정 유형에 따라 OS 도구 또는 데이터베이스 쿼리를 사용하세요.

1. 필요에 따라 RDS Custom for Oracle DB 인스턴스를 사용자 지정합니다.

1. 필요한 경우 인스턴스 또는 데이터베이스를 재부팅합니다.
**참고**  
온프레미스 Oracle CDB에서는 내장 명령을 사용하거나 시작 트리거 이후에 PDB에 대해 지정된 열기 모드를 유지할 수 있습니다. 이 메커니즘은 CDB가 다시 시작될 때 PDB를 지정된 상태로 전환합니다. CDB를 열 때 RDS Custom 자동화는 사용자가 지정한 보존 상태를 삭제하고 모든 PDB를 열려고 시도합니다. RDS Custom이 일부 PDB를 열 수 없는 경우 `The following PDBs failed to open: list-of-PDBs` 이벤트가 발생합니다.

1. 새 구성 설정을 이전 설정과 비교하여 확인합니다.

1. 다음 방법 중 하나를 사용하여 RDS Custom 자동화를 재개합니다.
   + 수동으로 자동화를 다시 시작합니다.
   + 일시 중지 기간이 끝날 때까지 기다립니다. 이 경우 RDS Custom은 모니터링 및 인스턴스 복구를 자동으로 재개합니다.

1. RDS Custom 자동화 프레임워크 확인

   이전 단계를 올바르게 수행한 경우 RDS Custom은 자동 백업을 시작합니다. 콘솔의 인스턴스 상태는 **사용 가능**으로 표시됩니다.

모범 사례 및 단계별 지침은 AWS 블로그 게시물인 [Make configuration changes to an Amazon RDS Custom for Oracle instance: Part 1](https://aws.amazon.com/blogs/database/part-1-make-configuration-changes-to-an-amazon-rds-custom-for-oracle-instance/)(Amazon RDS Custom for Oracle 인스턴스의 구성 변경: 1부) 및 [Recreate an Amazon RDS Custom for Oracle database: Part 2](https://aws.amazon.com/blogs/database/part-2-recreate-an-amazon-rds-custom-for-oracle-database/)(Amazon RDS Custom for Oracle 데이터베이스 다시 생성: 2부)를 참조하세요.

## RDS Custom DB 인스턴스 일시 중지 및 재개
<a name="custom-managing.pausing"></a>

콘솔 또는 CLI를 사용하여 DB 인스턴스의 자동화를 일시 중지하고 재개할 수 있습니다.

### 콘솔
<a name="custom-managing.pausing.console"></a>

**RDS Custom 자동화를 일시 중지하거나 다시 시작하는 방법**

1. AWS Management Console에 로그인한 후 [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/)에서 Amazon RDS 콘솔을 엽니다.

1. 탐색 창에서 **데이터베이스(Databases)**를 선택한 다음 변경하려는 RDS Custom DB 인스턴스를 선택합니다.

1. **Modify**(수정)를 선택합니다. **Modify DB instance**(DB 인스턴스 수정) 페이지가 나타납니다.

1. **RDS Custom 자동화 모드(RDS Custom automation mode)**로 다음 옵션 중 하나를 선택합니다.
   + **일시 중지됨(Paused)**을 선택하면 RDS Custom DB 인스턴스에 대한 모니터링 및 인스턴스 복구가 일시 중지됩니다. **자동화 모드 지속 시간(Automation mode duration)**으로 원하는 일시 중지 기간(분)을 입력합니다. 최소값은 60분(기본값)입니다. 최대값은 1,440분입니다.
   + **완전 자동화(Full automation)**를 선택하면 자동화가 재개됩니다.

1. **계속(Continue)**을 선택하여 수정 사항을 요약한 내용을 확인합니다.

   RDS Custom에서 변경 사항을 즉시 적용한다는 메시지가 표시됩니다.

1. 변경 내용이 정확할 경우 **DB 인스턴스 수정(Modify DB instance)**을 선택합니다. 또는 **뒤로**를 선택하여 변경 내용을 편집하거나 **취소**를 선택하여 변경 내용을 취소합니다.

   RDS 콘솔에 수정 사항에 대한 세부 정보가 표시됩니다. 자동화를 일시 중지한 경우 RDS Custom DB 인스턴스의 **상태(Status)**가 **자동화 일시 중지됨(Automation paused)**으로 표시됩니다.

1. (선택 사항) 탐색 창에서 **데이터베이스(Databases)**를 선택한 후 RDS Custom DB 인스턴스를 선택합니다.

   **요약(Summary)** 창에서 **RDS Custom 자동화 모드(RDS Custom automation mode)**는 자동화 상태를 나타냅니다. 자동화가 일시 중지되면 값이 **일시 중지됨(Paused)이 됩니다. *num*분 후에 자동화가 재개됩니다**.

### AWS CLI
<a name="custom-managing.pausing.CLI"></a>

RDS Custom 자동화를 일시 중지하거나 재개하려면 `modify-db-instance` AWS CLI 명령을 사용합니다. 필수 파라미터 `--db-instance-identifier`를 사용하여 DB 인스턴스를 식별합니다. 다음 파라미터를 사용하여 자동화 모드를 제어합니다.
+ `--automation-mode`는 DB 인스턴스의 일시 정지 상태를 지정합니다. 유효한 값은 자동화를 일시 중지하는 `all-paused`와 다시 재개하는 `full`입니다.
+ `--resume-full-automation-mode-minutes`는 일시 중지 기간을 지정합니다. 기본값은 60분입니다.

**참고**  
`--no-apply-immediately` 또는 `--apply-immediately`에 관계없이 RDS Custom은 가능한 한 빨리 비동기식으로 수정 사항을 적용합니다.

명령 응답에서 `ResumeFullAutomationModeTime`은 재개 시간을 UTC 타임스탬프로 나타냅니다. 자동화 모드가 `all-paused`인 경우 `modify-db-instance`를 사용하여 자동화 모드를 재개하거나 일시 중지 기간을 연장할 수 있습니다. 다른 `modify-db-instance` 옵션은 지원되지 않습니다.

다음 예제에서는 `my-custom-instance`에 대한 자동화를 90분 동안 일시 중지합니다.

**Example**  
대상 LinuxmacOS, 또는Unix:  

```
aws rds modify-db-instance \
    --db-instance-identifier my-custom-instance \
    --automation-mode all-paused \
    --resume-full-automation-mode-minutes 90
```
Windows의 경우:  

```
aws rds modify-db-instance ^
    --db-instance-identifier my-custom-instance ^
    --automation-mode all-paused ^
    --resume-full-automation-mode-minutes 90
```

다음 예제에서는 일시 중지 기간을 30분 더 연장합니다. 30분이 `ResumeFullAutomationModeTime`에 표시된 원래 시간에 추가됩니다.

**Example**  
대상 LinuxmacOS, 또는Unix:  

```
aws rds modify-db-instance \
    --db-instance-identifier my-custom-instance \
    --automation-mode all-paused \
    --resume-full-automation-mode-minutes 30
```
Windows의 경우:  

```
aws rds modify-db-instance ^
    --db-instance-identifier my-custom-instance ^
    --automation-mode all-paused ^
    --resume-full-automation-mode-minutes 30
```

다음 예제에서는 `my-custom-instance`에 대한 전체 자동화를 재개합니다.

**Example**  
대상 LinuxmacOS, 또는Unix:  

```
aws rds modify-db-instance \
    --db-instance-identifier my-custom-instance \
    --automation-mode full \
```
Windows의 경우:  

```
aws rds modify-db-instance ^
    --db-instance-identifier my-custom-instance ^
    --automation-mode full
```
다음 부분 샘플 출력에서 보류 중인 `AutomationMode` 값은 `full`입니다.  

```
{
    "DBInstance": {
        "PubliclyAccessible": true,
        "MasterUsername": "admin",
        "MonitoringInterval": 0,
        "LicenseModel": "bring-your-own-license",
        "VpcSecurityGroups": [
            {
                "Status": "active",
                "VpcSecurityGroupId": "0123456789abcdefg"
            }
        ],
        "InstanceCreateTime": "2020-11-07T19:50:06.193Z",
        "CopyTagsToSnapshot": false,
        "OptionGroupMemberships": [
            {
                "Status": "in-sync",
                "OptionGroupName": "default:custom-oracle-ee-19"
            }
        ],
        "PendingModifiedValues": {
            "AutomationMode": "full"
        },
        "Engine": "custom-oracle-ee",
        "MultiAZ": false,
        "DBSecurityGroups": [],
        "DBParameterGroups": [
            {
                "DBParameterGroupName": "default.custom-oracle-ee-19",
                "ParameterApplyStatus": "in-sync"
            }
        ],
        ...
        "ReadReplicaDBInstanceIdentifiers": [],
        "AllocatedStorage": 250,
        "DBInstanceArn": "arn:aws:rds:us-west-2:012345678912:db:my-custom-instance",
        "BackupRetentionPeriod": 3,
        "DBName": "ORCL",
        "PreferredMaintenanceWindow": "fri:10:56-fri:11:26",
        "Endpoint": {
            "HostedZoneId": "ABCDEFGHIJKLMNO",
            "Port": 8200,
            "Address": "my-custom-instance.abcdefghijk.us-west-2.rds.amazonaws.com"
        },
        "DBInstanceStatus": "automation-paused",
        "IAMDatabaseAuthenticationEnabled": false,
        "AutomationMode": "all-paused",
        "EngineVersion": "19.my_cev1",
        "DeletionProtection": false,
        "AvailabilityZone": "us-west-2a",
        "DomainMemberships": [],
        "StorageType": "gp2",
        "DbiResourceId": "db-ABCDEFGHIJKLMNOPQRSTUVW",
        "ResumeFullAutomationModeTime": "2020-11-07T20:56:50.565Z",
        "KmsKeyId": "arn:aws:kms:us-west-2:012345678912:key/aa111a11-111a-11a1-1a11-1111a11a1a1a",
        "StorageEncrypted": false,
        "AssociatedRoles": [],
        "DBInstanceClass": "db.m5.xlarge",
        "DbInstancePort": 0,
        "DBInstanceIdentifier": "my-custom-instance",
        "TagList": []
    }
```