Pages

Showing posts with label Teradata Roles Profiles. Show all posts
Showing posts with label Teradata Roles Profiles. Show all posts

Teradata - Using Roles

27 comments


Hi Friends,

Today we will learn using roles in teradata with examples:

Create roles.
 
  CREATE ROLE Inquiry_HR;

  CREATE ROLE Update_HR;

  CREATE ROLE Inquiry_Payroll;

  CREATE ROLE Update_Payroll;

  CREATE ROLE Batch_HR_Pay;
 
Assign access rights to the roles (partial listing).
 
  GRANT SELECT, EXECUTE   ON HR_VM TO Inquiry_HR;

  GRANT INSERT, UPDATE, DELETE   ON HR_VM TO Update_HR;
 
Grant users permission to use the roles.
 
  GRANT Inquiry_HR   TO Update_HR;   /*nested role*/
  GRANT Inquiry_HR   TO Emp01, Emp02;

  GRANT Update_HR   TO Emp03, Emp04;

  GRANT Update_HR   TO Sup05 WITH ADMIN OPTION;

  GRANT Batch_HR_Pay   TO Sup05 WITH ADMIN OPTION;
 
Modify the user to set the default role.

  MODIFY USER Emp01 AS DEFAULT ROLE = Inquiry_HR;

  MODIFY USER Emp02 AS DEFAULT ROLE = Inquiry_HR;

  MODIFY USER Emp03 AS DEFAULT ROLE = Update_HR;

  MODIFY USER Emp04 AS DEFAULT ROLE = Update_HR;

  MODIFY USER Sup05  AS DEFAULT ROLE = Update_HR;


Emp01 –   is granted to Inquiry_HR role;

Inquiry_HR is current role.
 

  SELECT   * FROM Employee_v  ORDER BY   1;  (success)
 

  UPDATE   Employee_v
  SET   Dept_Number=1001
  WHERE   Employee_Number=100001;  (fails)

  Why does this statement fail for Emp01?



Emp03 –   is granted to Update_HR role;


Update_HR is current role.


  SELECT   * FROM Employee_v ORDER BY   1;  (success)

 

  UPDATE   Employee_v


  SET   Dept_Number=1001


  WHERE   Employee_Number=100001;  (success)



  Why do both of these statements succeed for Emp03?


 
Sup05  –   is granted to Update_HR role WITH ADMIN OPTION.

  GRANT Update_HR TO Emp02;  (success)
 


Emp02 –   is granted to Update_HR role; Inquiry_HR is current role.

  SELECT   * FROM Employee_v ORDER BY 1;  (success)

  UPDATE   Employee_v


  SET   Dept_Number=1001


  WHERE   Employee_Number=100001;  (fails)

  Why does this statement fail for Emp02?



Emp02 – executes the following SET ROLE command



  SET ROLE   Update_HR;

  UPDATE   Employee_v

   
  SET   Dept_Number=1001

  
  WHERE   Employee_Number=100001;

  Will this UPDATE statement succeed this time?

  Will this UPDATE statement succeed the next time Emp02 logs on? 
                                                        ----> to be Continued

Advantages of Roles in Teradata

0 comments

What are the advantages of “roles”?
Simplify access rights management by allowing grants and revokes of multiple rights with one request.
–>useful when an employee changes job function (role) within the company.
> If a job function needs a new access right, grant it to the role and it is effective immediately.
The number of access rights in the DBC.AccessRights table is reduced.
–> Disk space usage is reduced when rights are managed on role level rather than individual level.
Improves performance and reduces dictionary contention for DDL, especially CREATE USER.
Removal of hierarchical inherited rights improves DDL performance and reduces dictionary contention.

Teradata -- Roles and Profiles

0 comments

With Teradata V2R5, two new administration/security features are
introduced - roles and profiles.
Roles and profiles simplify the management of users and access rights.
What is a “role”?
A role is simply a collection of access rights. 
Rights are first granted to a role and the right to use the role is then granted to users.
A DBA can create different roles for different job functions and responsibilities.
Roles can help reduce the number of rows in the DBC.AccessRights table.
What is a “profile”?
A profile is a set of common user parameters that can be applied to a group of users.
A profile setting (e.g., SPOOL) can be changed with one command
and this new value is immediately applied to every assigned user.
 Access Rights Issues (prior to Roles):
 
The problems:
---> Assume a customer has a large user base.
---> Assume that different users require different access rights on different objects - probably located in different databases. 
       –> Example: 300 different access rights for 10,000 users; this results in over 3 million access rights in the AccessRights table.
---> If users are not granted privileges to all of the objects within a database, then access rights have to be maintained for each object in the database. 
---> If a user changes job functions, changing access rights can become tedious.
Prior to Teradata V2R5, possible solutions were ...
  •         Place users into different parent databases based on their access right requirements.
–> Use the ALL option of the GRANT statement to grant rights on the shared object(s) to a parent database.