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.
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.