

# Working with storage in RDS for Oracle
<a name="User_Oracle_AdditionalStorage"></a>

Every RDS for Oracle instance has a primary storage volume. To increase storage capacity, you can attach up to three additional storage volumes to your DB instance. Depending on your workload requirements, choose between gp3 and io2 storage for each volume. For example, you might put frequently accessed data on an io2 volume and historical data on a gp3 volume.

Use additional storage volumes to enable the following benefits:
+ **Enhanced capacity** – Scale your total storage up to 256 TiB per DB instance by attaching up to three additional storage volumes.
+ **Flexible storage configuration and performance optimization** – Mix different storage types (gp3 and io2) to optimize for both cost and performance based on your data access patterns. Separate frequently accessed data on high-performance io2 storage from archival data on cost-effective gp3 storage.
+ **Expand and reduce storage capacity as needed** – Attach a volume when you need additional storage, as during data migration, and then later delete the volume. In this way, you can expand and reduce the total DB instance storage.
+ **Online data movement** – Use the built-in capabilities of Oracle database to move data between volumes without downtime.

**Note**  
You can remove additional storage volumes, but you can't remove the primary volume.

**Topics**
+ [

## Considerations for using additional storage volumes with RDS for Oracle
](#User_Oracle_AdditionalStorage.considerations)
+ [

## Limitations of using additional storage volumes with RDS for Oracle
](#User_Oracle_AdditionalStorage.limitations)
+ [

## Database management operations with additional storage volumes in RDS for Oracle
](#User_Oracle_AdditionalStorage.DBManagement)
+ [

# Add, remove, or modify storage volumes with RDS for Oracle
](User_Oracle_AdditionalStorage.ModifyStorageVolumes.md)
+ [

# Backing up and restoring data with additional storage volumes in RDS for Oracle
](User_Oracle_AdditionalStorage.BackupRestore.md)
+ [

# Use cases for additional storage volumes in RDS for Oracle
](User_Oracle_AdditionalStorage.UseCases.md)

## Considerations for using additional storage volumes with RDS for Oracle
<a name="User_Oracle_AdditionalStorage.considerations"></a>

Consider the following when using additional storage volumes with RDS for Oracle:
+ You can add up to 3 additional storage volumes per instance.
+ Additional storage volumes must use the following volume names:
  + rdsdbdata2
  + rdsdbdata3
  + rdsdbdata4
+ You can only add General Purpose SSD (gp3) and Provisioned IOPS SSD (io2) storage types.
+ You can use Oracle’s online relocation capabilities to move data between volumes while your applications continue running.
+ When you create an additional storage volume by modifying the DB instance, RDS immediately creates the storage volume regardless of the schedule modifications setting. Adding a storage volume is an online operation and does not impact your database performance. See [Using the schedule modifications setting](USER_ModifyInstance.ApplyImmediately.md).

For optimal performance, check the following when you are using additional storage volumes:
+ Data movement planning
  + Schedule large movements during off-peak hours
  + Break large operations into smaller chunks
  + Monitor system resources during moves
+ Resource management
  + Keep sufficient free space on both volumes
  + Monitor I/O patterns using AWR or Statspack
  + Watch for storage-full scenarios
+ Best practices
  + Use online datafile relocation operations where possible
  + Maintain appropriate indexes
  + Regularly monitor space usage

When using additional storage volumes with replicas:
+ When you are creating an RDS for Oracle replica for a DB instance that has additional storage volumes, RDS automatically configures additional storage volumes on the replica. However, any subsequent modifications made in storage volumes of your primary DB instance are not automatically applied to the replica.
+ When managing datafile locations across volumes, we recommend using parameter group settings instead of session-level changes to ensure consistent behavior between primary and replica instances.

## Limitations of using additional storage volumes with RDS for Oracle
<a name="User_Oracle_AdditionalStorage.limitations"></a>

The following limitations apply to using additional storage volumes with RDS for Oracle:
+ You can’t add a storage volume to the instance types with less than 64GiB memory because they don’t have sufficient memory to support large storage volumes.
+ The minimum storage size is 200GiB for additional storage volumes. The primary storage volume of your DB instance should be equal to or larger than 200GiB to attach additional storage volumes. The maximum storage size for your DB instance is 256 TiB total across all volumes.
+ The following capabilities aren’t supported for DB instances with additional storage volumes:
  + Cross-region automated backups
  + Storage autoscaling (for additional storage volumes)
  + Public snapshots
+ You can't delete the primary storage volume (`rdsdbdata`), but you can delete other additional storage volumes as long as they're empty.
+ You can't store the online redo logs, archived redo logs, and control files in additional storage volumes. These files can only be stored in the primary storage volume (`rdsdbdata`).

## Database management operations with additional storage volumes in RDS for Oracle
<a name="User_Oracle_AdditionalStorage.DBManagement"></a>

You can perform database management operations such as creating tablespaces or moving data between storage volumes while using additional storage volumes in RDS for Oracle. For more information about database management operations with additional storage volumes, see the following sections:
+ [Specifying database file locations in RDS for Oracle](Appendix.Oracle.CommonDBATasks.TablespacesAndDatafiles.md#Appendix.Oracle.CommonDBATasks.DatabaseFileLocations)
+ [Creating and sizing tablespaces in RDS for Oracle](Appendix.Oracle.CommonDBATasks.TablespacesAndDatafiles.md#Appendix.Oracle.CommonDBATasks.CreatingTablespacesAndDatafiles)
+ [Moving data files between volumes in RDS for Oracle](Appendix.Oracle.CommonDBATasks.MovingDataBetweenVolumes.md#Appendix.Oracle.CommonDBATasks.MovingDatafiles)

# Add, remove, or modify storage volumes with RDS for Oracle
<a name="User_Oracle_AdditionalStorage.ModifyStorageVolumes"></a>

You can add, modify, and remove additional storage volumes using the AWS Management Console or AWS CLI. All operations use the `modify-db-instance` command with the `additional-storage-volumes` parameter.

**Important**  
Adding or removing additional storage volumes creates a backup pending action and a blackout window. The blackout window closes when the backup workflow completes.



## Adding storage volumes
<a name="User_Oracle_AdditionalStorage.ModifyStorageVolumes.Add"></a>

You can add up to three storage volumes beyond the primary storage volume. To add a new storage volume to your RDS for Oracle DB instance, use the `modify-db-instance` command with the `additional-storage-volumes` parameter.

The following code snippet adds a mew 5,000 GiB general purpose SSD (gp3) volume with 4000 provision IOPS name `rdsdbdata3`.

```
aws rds modify-db-instance \
  --db-instance-identifier my-oracle-instance \
  --region us-east-1 \
  --additional-storage-volumes '[
        {
            "VolumeName":"rdsdbdata3",
            "StorageType":"gp3",
            "AllocatedStorage":5000
            "IOPS":4000}
    ]' \
  --apply-immediately
```

## Modifying storage volumes
<a name="User_Oracle_AdditionalStorage.ModifyStorageVolumes.Modifying"></a>

You can modify storage type, allocated storage size, IOPS, and storage throughput settings of your additional storage volume. The following code snippet modifies the IOPS setting for the `rdsdbdata2` volume.

```
aws rds modify-db-instance \
  --db-instance-identifier my-oracle-instance \
  --region us-east-1 \
  --additional-storage-volumes '[
        {
            "VolumeName":"rdsdbdata2",
            "IOPS":8000}
    ]' \
  --apply-immediately
```

**Note**  
You can’t reduce the storage allocation for an additional storage volume once you’ve added it to the instance.

## Removing storage volumes
<a name="User_Oracle_AdditionalStorage.ModifyStorageVolumes.Remove"></a>

You can remove additional storage volumes from RDS for Oracle DB instances when they are no longer needed. Before removing a volume, make sure that you have moved all database files from the volume and no database objects are referencing it. Verify that the volume status is `Not-in-use`. You can remove additional storage volumes, but you can't remove the primary storage volume. 

**Warning**  
Before you remove an additional storage volume, make sure that no database files are stored on the volume. Removing a volume with active database files causes database corruption.

The following example removes the `rdsdbdata4` volume.

```
aws rds modify-db-instance \
  --db-instance-identifier my-oracle-instance \
  --region us-east-1 \
  --additional-storage-volumes '[
        {
            "VolumeName":"rdsdbdata2",
            "SetForDelete":true}
    ]' \
  --apply-immediately
```

# Backing up and restoring data with additional storage volumes in RDS for Oracle
<a name="User_Oracle_AdditionalStorage.BackupRestore"></a>

You can use automated backups and create a DB snapshot with your DB instance with additional storage volumes. All backup operations include both the primary volume and additional storage volumes. You can also use point-in-time recovery for your DB instance with additional storage volumes. When you restore your database, you can add storage volumes. You can also modify the storage settings of existing volumes. You cannot delete additional storage volumes when you restore your database from a snapshot. 

**Topics**
+ [

## Creating manual snapshots
](#User_Oracle_AdditionalStorage.BackupRestore.ManualSnapshots)
+ [

## Restoring manual snapshots
](#User_Oracle_AdditionalStorage.BackupRestore.RestoreSnapshots)
+ [

## Point-in-time recovery
](#User_Oracle_AdditionalStorage.BackupRestore.PitR)

## Creating manual snapshots
<a name="User_Oracle_AdditionalStorage.BackupRestore.ManualSnapshots"></a>

The following example creates a manual snapshot of your database with additional storage volumes:

```
aws rds create-db-snapshot \
--db-instance-identifier my-oracle-asv-instance \
--db-snapshot-identifier my-snapshot
```

## Restoring manual snapshots
<a name="User_Oracle_AdditionalStorage.BackupRestore.RestoreSnapshots"></a>

When restoring from a snapshot, you can add new additional storage volumes or modify the IOPS or throughput settings of existing volumes. The following example restores a DB instance from a snapshot and modifies the IOPS setting for the `rdsdbdata2` volume:

```
aws rds restore-db-instance-from-db-snapshot \
  --db-instance-identifier my-restored-instance \
  --db-snapshot-identifier my-snapshot \
  --region us-east-1 \
  --additional-storage-volumes '[
        {
            "VolumeName":"rdsdbdata2",
            "IOPS":5000
        }
    ]'
```

## Point-in-time recovery
<a name="User_Oracle_AdditionalStorage.BackupRestore.PitR"></a>

During point-in-time recovery (PITR), you can add new additional storage volumes with custom configurations. The following example performs PITR and adds a new 5,000 GiB General Purpose SSD (gp3) with 5000 IOPS and 200 MB/s storage throughput for the `rdsdbdata2` volume: 

```
aws rds restore-db-instance-to-point-in-time \
  --source-db-instance-identifier my-source-instancemy-source-instance \
  --target-db-instance my-pitr-instance\
  --use-latest-restorable-time \
  --region us-east-1 \
  --additional-storage-volumes '[
        {
            "VolumeName":"rdsdbdata2",
            "StorageType":"gp3",
            "AllocatedStorage":5000,
            "IOPS":5000,
            "StorageThroughput":200
        }
    ]'
```

# Use cases for additional storage volumes in RDS for Oracle
<a name="User_Oracle_AdditionalStorage.UseCases"></a>

Additional storage volumes support various database management scenarios. The following sections describe common use cases and implementation approaches.

**Topics**
+ [

## Extending storage capacity beyond 64 TiB
](#User_Oracle_AdditionalStorage.UseCases.Extendingstoragecapacity)
+ [

## Storage tiering of frequently and infrequently accessed data on separate volumes
](#User_Oracle_AdditionalStorage.UseCases.Storagetiering)
+ [

## Temporary storage for data loading and unloading
](#User_Oracle_AdditionalStorage.UseCases.Temporarystorage)
+ [

## Using Oracle transportable tablespaces with an additional storage volume
](#User_Oracle_AdditionalStorage.UseCases.TransportableTablespaces)

## Extending storage capacity beyond 64 TiB
<a name="User_Oracle_AdditionalStorage.UseCases.Extendingstoragecapacity"></a>

You can use additional storage volumes when your primary storage volume approaches the 64 TiB limit but need more storage space in your database. You can attach additional storage volumes to your DB instance, each up to 64TiB, using the `modify-db-instance` command. After attaching additional storage volumes, you can create tablespaces on additional storage volumes and move objects such as tables, indexes, and partitions to these tablespaces using standard Oracle SQL. For more information, see [Database management operations with additional storage volumes in RDS for Oracle](User_Oracle_AdditionalStorage.md#User_Oracle_AdditionalStorage.DBManagement).

## Storage tiering of frequently and infrequently accessed data on separate volumes
<a name="User_Oracle_AdditionalStorage.UseCases.Storagetiering"></a>

You can use additional storage volumes to optimize cost and performance by configuring different storage types between volumes. For example, you can use high-performance Provisioned IOPS SSD storage (io2) volumes for frequently accessed data while storing historical data on cost-effective General Purpose (gp3) storage volumes. You can move specific database objects (tables, indexes, and partitions) to these tablespaces using standard Oracle commands. For more information, see [Database management operations with additional storage volumes in RDS for Oracle](User_Oracle_AdditionalStorage.md#User_Oracle_AdditionalStorage.DBManagement).

## Temporary storage for data loading and unloading
<a name="User_Oracle_AdditionalStorage.UseCases.Temporarystorage"></a>

You can use additional storage volumes as temporary storage for large data loads or exports with the following steps:
+ Create a directory on an additional storage volume with the following command:

  ```
  BEGIN
  rdsadmin.rdsadmin_util.create_directory(
              p_directory_name => 'DATA_PUMP_DIR2',
              p_database_volume_name => 'rdsdbdata2');
  END;
  /
  ```
+ After the creation of the directory, follow the steps described in [Importing using Oracle Data Pump](Oracle.Procedural.Importing.DataPump.md) to export and import your data to the new directory. 
+ After the completion of the operation, remove files and optionally delete the volume to save the storage costs. You can remove the additional storage volume only when the volume is empty.

## Using Oracle transportable tablespaces with an additional storage volume
<a name="User_Oracle_AdditionalStorage.UseCases.TransportableTablespaces"></a>

You can use additional storage volumes to move datafiles to an additional storage volume using Oracle transportable tablespaces with the following steps:
+ Set `db_create_file_dest` parameter at session level before importing transportable tablespaces into the target database with an additional storage volume.

  ```
  ALTER SESSION SET db_create_file_dest = '/rdsdbdata2/db';
  
  VAR x CLOB;
  
  BEGIN
  :x := rdsadmin.rdsadmin_transport_util.import_xtts_tablespaces(
  p_tablespace_list => 'TBTEST1',
  p_directory_name => 'XTTS_DIR_DATA2',
  p_platform_id => 13);
  END;
  /
  
  PRINT :x;
  ```
+ Check the transportable tablespace import status:

  ```
  ALTER SESSION SET nls_date_format = 'DD.MM.YYYY HH24:MI:SS';
  
  COL xtts_operation_start_utc FORMAT A30
  COL xtts_operation_end_utc FORMAT A30
  COL xtts_operation_state FORMAT A30
  COL xtts_operation_type FORMAT A30
  
  SELECT xtts_operation_start_utc, xtts_operation_type, xtts_operation_state
  FROM rdsadmin.rds_xtts_operation_info;
  ```
+ When transportable tablespace import completes, import transportable tablespace metadata.

  ```
  BEGIN
  rdsadmin.rdsadmin_transport_util.import_xtts_metadata(
  p_datapump_metadata_file => 'xttdump.dmp',
  p_directory_name => 'XTTS_DIR_DATA2');
  END;
  /
  ```