Managing storage access - 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).

Managing storage access

The following stored procedures manage storage access for RDS for Db2 databases that use Amazon S3 for migrating data. For more information, see Migration by loading data from Amazon S3.

rdsadmin.catalog_storage_access

Catalogs a storage alias for accessing an Amazon S3 bucket with Db2 data files.

Syntax

db2 "call rdsadmin.catalog_storage_access( ?, 'alias', 's3_bucket_name', 'grantee_type', 'grantee' )"

Parameters

The following output parameter is required:

?

A parameter marker that outputs an error message. The datatype is varchar.

The following input parameters are required:

alias

The alias name for accessing remote storage in an Amazon S3 bucket. The datatype is varchar.

s3_bucket_name

The name of the Amazon S3 bucket where your data resides. The data type is varchar.

grantee_type

The type of grantee to receive authorization. The data type is varchar. Valid values: USER, GROUP.

grantee

The user or group to receive authorization. The data type is varchar.

Usage notes

Amazon RDS includes the cataloged alias in the IAM role that you added to your RDS for Db2 DB instance. If you remove the IAM role from your DB instance, then Amazon RDS deletes the alias. For more information, see Migration by loading data from Amazon S3.

For information about checking the status of cataloging your alias, see rdsadmin.get_task_status.

Examples

The following example registers an alias called SAMPLE. The user jorge_souza is granted access to the Amazon S3 bucket called DOC-EXAMPLE-BUCKET.

db2 "call rdsadmin.catalog_storage_access( ?, 'SAMPLE', 'DOC-EXAMPLE-BUCKET', 'USER', 'jorge_souza')"

rdsadmin.uncatalog_storage_access

Removes a storage access alias.

Syntax

db2 "call rdsadmin.uncatalog_storage_access( ?, 'alias')"

Parameters

The following output parameter is required:

?

A parameter marker that outputs an error message. The datatype is varchar.

The following input parameter is required:

alias

The name of the storage alias to remove. The datatype is varchar.

Usage notes

For information about checking the status of removing your alias, see rdsadmin.get_task_status.

Examples

The following example removes an alias called SAMPLE. This alias no longer provides access to the Amazon S3 bucket it was associated with.

db2 "call rdsadmin.uncatalog_storage_access( ?, 'SAMPLE')"