Trusted Sessions for X Views | Data Dictionary | Teradata Vantage - Trusted Sessions Support in X Views - Advanced SQL Engine - Teradata Database

Data Dictionary

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Published
January 2021
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
prb1610499325399.ditamap
dita:ditavalPath
hoy1596145193032.ditaval
dita:id
B035-1092
lifecycle
previous
Product Category
Teradata Vantageā„¢

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.