Defining the Default Role for a User
To ensure that role privileges are available to users at log on, you must define a default role for each user that is a member of one or more roles. If you do not specify a default role, the user must employ the SET ROLE statement to select the operant role. For example:
SET ROLE role_name;
or
SET ROLE ALL;
You can also use the SET ROLE statement to change from one role to another role within a session.
To ensure that the user is operating with the appropriate role, specify the default role for a user as follows:
1 Start Teradata Administrator and log on as user DBADMIN.
2 On the main screen, click the Preview Mode button to allow future display of generated SQL.
3 Click the + next to DBADMIN to display the list of users.
4 Select the user you want to modify.
5 Click Tools>Modify User.
6 In the Modify User dialog, click the Default Role drop-down menu and select a default role. You can optionally select All Roles, which will allow access to all roles of which the user is a member.
7 Click the Modify button. The Query Window displays the generated MODIFY USER statement, for example:
MODIFY USER "GenUser1" AS
STARTUP = ''
DEFAULT DATABASE = "Personnel_Views"
NO FALLBACK
NO BEFORE JOURNAL
NO AFTER JOURNAL
COLLATION = HOST
DEFAULT CHARACTER SET LATIN
DATEFORM=INTEGERDATE
TIME ZONE=NULL
DEFAULT ROLE="Role_GenUser_2"
8 In the Query Window, click the Run Query button . A Query Complete message appears in the bottom left corner of the main window when the query executes.
9 Close the Query Window and the Modify User dialog box.
10 Repeat this procedure to specify the default role for each user who is a member of a role.
11 Log off Teradata Administrator or go on to “Granting Privileges Directly to Users.”
Reference Information
For Step... |
Information on... |
Is available in... |
1 |
syntax and options for the SET ROLE statement |
SQL Data Definition Language Syntax and Examples |
7 |
syntax and options for the MODIFY USER statement, including the default role |
SQL Data Definition Language Syntax and Examples |
using roles to manage user access |
Security Administration |