17.05 - Setting Up to Run the Examples - Teradata Database

Teradata Vantageā„¢ - Native Object Store Getting Started Guide

prodname
Advanced SQL Engine
Teradata Database
vrm_release
17.05
created_date
January 2021
category
Programming Reference
featnum
B035-1214-175K

Setting Up a Test User and Privileges

As an administrative user, set up a test user and grant the necessary privileges to the user to run the following examples.

CREATE USER nos_usr FROM dbc AS PERMANENT=30e8 PASSWORD=nos;

GRANT CREATE TABLE on nos_usr to nos_usr;
GRANT EXECUTE FUNCTION on TD_SYSFNLIB.READ_NOS to nos_usr;
GRANT CREATE AUTHORIZATION on nos_usr to nos_usr;
GRANT CREATE DATASET SCHEMA ON SYSUDTLIB TO nos_usr;
GRANT CREATE FUNCTION ON nos_usr to nos_usr;

See Setting Up a Test User and Setting Access Privileges.

Setting Up an Authorization Object and a Function Mapping

  1. Log on as a user with the required privileges. For example log in as the user just created, nos_usr.
  2. Create an authorization object with the credentials to external object store:
    CREATE AUTHORIZATION DefAuth
    AS DEFINER TRUSTED
    USER ''
    PASSWORD '';
    To access the Teradata-supplied public buckets, enclose an empty string in single straight quotes for USER and PASSWORD.
  3. Create a function mapping:
    CREATE FUNCTION MAPPING READ_NOS_FM
    FOR READ_NOS EXTERNAL SECURITY DEFINER TRUSTED DefAuth
    USING
    BUFFERSIZE,
    SAMPLE_PERC,
    ROWFORMAT,
    RETURNTYPE,
    HEADER,
    MANIFEST,
    LOCATION,
    STOREDAS,
    FULLSCAN,
    ANY IN TABLE;

For more details, see Controlling Foreign Table Access with an AUTHORIZATION Object and Controlling READ_NOS and WRITE_NOS Access with a Function Mapping.