Migration by loading data from Amazon S3 - Amazon Relational Database Service
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Migration by loading data from Amazon S3

With this migration approach, you first save data from a single table into a data file that you place in an Amazon S3 bucket. Then, you use the LOAD command to load the data from that data file into a table in your Amazon RDS for Db2 database. For more information about using Amazon S3, see Integrating an Amazon RDS for Db2 DB instance with Amazon S3.

Limitations for using the loading data from Amazon S3 method

The following limitations apply to the data you can migrate by loading from Amazon S3:

  • The data must be stored in a delimited format file, such as a comma-separated (CSV) file.

  • A data file can contain data from only one table.

  • The data files can't contain large objects (LOBs).

  • The size of the data file can't exceed 80% of the free space in your home directory.

Saving your data to Amazon S3

To save data from a single table to Amazon S3, use a database utility to extract the data from your database management system (DBMS) into a CSV file. Then, upload the data file to Amazon S3.

For storing data files on Amazon S3, you need the following Amazon components:

Loading your data into RDS for Db2 tables

After you save your data files to Amazon S3, you can load the data from these files into individual tables on your RDS for Db2 DB instance.

To load your Db2 table data into your RDS for Db2 DB database table
  1. Connect to your RDS for Db2 DB instance. For more information, see Connecting to your Amazon RDS for Db2 DB instance.

  2. Catalog a storage access alias that points to the Amazon S3 bucket where your saved files are stored. Take note of the name of this alias for use in the next step. You only need to perform this step once if you plan to load multiple tables from data files stored in the same Amazon S3 bucket.

    The following example catalogs an alias named my_s3_alias that grants a user named jorge_souza access to a bucket named DOC-EXAMPLE-BUCKET.

    db2 "CALL RDSADMIN.catalog_storage_access(?, 'my_s3_alias', 'DOC-EXAMPLE-BUCKET', 'USER', 'jorge_souza')"

    For more information about this stored procedure, See rdsadmin.catalog_storage_access.

  3. Run the LOAD command using the storage access alias that points to your Amazon S3 bucket.

    The following example loads data from a data file named my_s3_datafile.csv into a table named my_db2_table. The example assumes that the data file is in the Amazon S3 bucket that the alias named my_s3_alias points to.

    db2 "load from db2remote://my_s3_alias//my_s3_datafile.csv of DEL insert into my_db2_table";

    Repeat this step for each data file in the Amazon S3 bucket that you want to load into a table in your RDS for Db2 DB instance.

    For more information about the LOAD command, see LOAD command.