16.20 - Trusted Sessions Support in X Views - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantageā„¢ Data Dictionary

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
March 2019
Language
English (United States)
Last Update
2019-05-03
dita:mapPath
zzu1512081120577.ditamap
dita:ditavalPath
TD_DBS_16_20_Update1.ditaval

The X Views return results based on the current authorized user, if the current authorized user is set to a Trusted Sessions proxy user. If the user is not a proxy user, the results returned are based on the current user and the current user's access rights.

Compatibility X Views do not support Trusted Sessions.

For example, when logged in as a middle tier user TRM, a query using the AMPUsageVX view returns the usage for the user TRM as follows:

sel username (FORMAT 'X(20)'), sum(cputime), sum(diskio)
from dbc.ampusagevx group by 1;

Results:

UserName                    Sum(CpuTime)      Sum(DiskIO)
--------------------  ------------------  ---------------
TRM                                 0.42           10,595

If the session is then set to a permanent proxy user (defined WITHOUT ROLE), the query returns the usage for the user PERMUSER1 as follows:

SET QUERY_BAND='PROXYUSER=PERMUSER1;' FOR SESSION;

sel username (FORMAT 'X(20)'), sum(cputime), sum(diskio)
from dbc.ampusagevx group by 1;

Result:

UserName                    Sum(CpuTime)      Sum(DiskIO)
--------------------  ------------------  ---------------
PERMUSER1                           0.19           2,185

If the session is set to an application proxy user or permanent proxy user with specified roles, then authorization is based solely on the roles of the proxy user. For X views that return data based on the current user name only, the query returns no rows:

SET QUERY_BAND='PROXYUSER=APPLUSER;' FOR SESSION;

sel username (FORMAT 'X(20)'), cputime, diskio 
from dbc.ampusagevx order by 1;

Result: No rows are returned.

*** Query completed. No rows found.
*** Total elapsed time was 1 second.