SYSIBMADM.STORAGE_ACCESS_ALIAS.CATALOG procedure
The SYSIBMADM.STORAGE_ACCESS_ALIAS.CATALOG stored procedure creates a remote storage access alias for accessing remote object storage.
Functionality mirrors that of the CATALOG STORAGE ACCESS ALIAS CLP command.
Authorization
Any user with EXECUTE privilege on the module SYSIBMADM.STORAGE_ACCESS_ALIAS will have permission to call the CATALOG stored procedure. The user must also have DBADM authority on the database to successfully create the alias.
Syntax
Parameter descriptions
- alias-name
- An input argument of type VARCHAR(128) that specifies the new alias name.
- vendor
- An input argument of type VARCHAR(30) that specifies the type of the remote storage. For more information, see Supported object storage services for DATALAKE tables.
- endpoint
- An input argument of type VARCHAR(255) that specifies the authentication endpoint of the remote storage.
- user
- An input argument of type VARCHAR(1024) that specifies the S3 HMAC access key ID or username of the remote storage account.
- password
- An input argument of type VARCHAR(1024) that specifies the S3 HMAC secret key ID or password of the remote storage account.
- bucket
- An input argument of type VARCHAR(255) that specifies an S3 bucket or container. If the argument is null, or an empty string, then the alias may be used to access any bucket that is available through the endpoint. Any aliases defined without a bucket must all reference the same endpoint.
- object
- An input argument of type VARCHAR(1024) that specifies a path to a folder or file within a particular bucket. The argument may be null, or an empty string, if an explict path does not need to be specified.
- grantee-type
- An input argument of type VARCHAR(1) that specifies whether usage of the alias is granted to a user, a role or a group. Valid values are 'U', 'R', 'G', NULL or an empty string. If the value is NULL, or an empty string, then SYSADM privilege will be needed to use the alias.
- grantee
- An input argument of type VARCHAR(255) that specifies the userid, rolename or groupname for which usage of the alias is granted. If the value is NULL, or an empty string, then the grantee-type must also be NULL or an empty string and SYSADM privilege will be needed to use the alias.
Examples
- Example of usage
format:
call SYSIBMADM.STORAGE_ACCESS_ALIAS.CATALOG(alias-name, vendor, endpoint, user, password, bucket, object, grantee-type, grantee)
- Create an alias and grant usage to a user named
user1
:call SYSIBMADM.STORAGE_ACCESS_ALIAS.CATALOG('product_info', 's3', 's3.eu-de.cloud-object-storage.appdomain.cloud', '${user}', '${password}', 'product_info', NULL, 'U', 'user1');
- Create an alias and grant usage to a role named
cos_users
:call SYSIBMADM.STORAGE_ACCESS_ALIAS.CATALOG('product_info', 's3', 's3.eu-de.cloud-object-storage.appdomain.cloud', '${user}', '${password}', 'product_info', NULL, 'R', 'cos_users');
- Create an alias and grant usage to a group named
team1
:call SYSIBMADM.STORAGE_ACCESS_ALIAS.CATALOG('product_info', 's3', 's3.eu-de.cloud-object-storage.appdomain.cloud', '${user}', '${password}', 'product_info', NULL, 'G', 'team1');
- Create an alias that can only be used by
SYSADM:
call SYSIBMADM.STORAGE_ACCESS_ALIAS.CATALOG('user_info', 's3', 's3.eu-de.cloud-object-storage.appdomain.cloud', '${user}', '${password}', 'user_info', NULL, NULL, NULL);