15.10 - FOR - Teradata Database

Teradata Database SQL Data Definition Language Syntax and Examples

prodname
Teradata Database
vrm_release
15.10
created_date
December 2015
category
Programming Reference
featnum
B035-1144-151K
SESSION
Specifies that the account is changed for the remainder of the session.
Note that you cannot undo this request within the current session. To revoke a session-level account change, a user must log off the session, then log back on, at which point the system assigns the user default priority.
REQUEST
Specifies that the account is changed for the next request only (next being defined as the first request this user performs after the current SET SESSION ACCOUNT request).
After that, the previous account resumes.
The specified performance group is kept in volatile memory, not in DBC.SessionTbl, so a subsequent transparent system crash and recovery effectively voids this request. To be sure the request performs correctly, set SET CRASH to NOWAIT_TELL or verify the result.

Example: Setting the Account to Change Resource Charges for a Session

User A, employed in the Marketing Group, has the default account ‘$M0+MKTG&S&D&H’. The user wants to change to the FIN1 account to charge the system resources used to generate the monthly finance report to the Finance Group.

SET SESSION ACCOUNT=‘$M0+FIN1&S&D&H’ FOR SESSION

Example: Setting the Account to Change the Priority for a Request

User B is submitting a series of large data mining queries using the user default account ‘$L0+DMIN&S&D&H’. The user wants to change to an account with a higher priority performance group to run an emergency report for his manager.

SET SESSION ACCOUNT=‘$H0+EMRG&S&D&H’ FOR REQUEST

After running the emergency report, the account reverts to the default for User B, who continues with low priority data mining.

On SLES 10 systems, changing the account string changes the priority (performance group) for the session or request, if the new account specifies a different performance group.

On SLES 11 systems, changing the account string changes the access level for the session or request only if different workload management rules apply to the new account.