Session context

When a user logs in through an application and uses the system, all work is done in the context of a session. A session is owned by its session user, who is constant after the session is created. You can control when sessions can be created and how many concurrent (simultaneous) sessions can occur.

The session user is not affected by running EXECUTE AS statements or running stored procedures. The EXECUTE AS statement affects the current user and does not enforce access time or concurrent sessions restrictions.

You can access session operations through any SQL interface. The following table shows examples of SQL statements used for sessions, where each session has an ID.
Table 1. Session SQL commands
SQL statement Meaning
SHOW SESSION [ID | ALL] [VERBOSE] Display the active session in verbose mode
ALTER SESSION [ID] PRIORITY Change the session priority
ALTER SESSION [ID] ROLLBACK TRANSACTION Roll back any transactions in the session
DROP SESSION [ID] Remove the session

The security system controls what users and sessions you can access. Although session lists are accessible to all users, you can read only the names of objects for which you have List privileges.