Chapter 11. Managing Session Information

Oracle technologies allow for a great deal of user customization and security. Language preferences can be specified at the session level using the NLS (National Language Support) options of the ALTER SESSION command. Roles can be used to distinguish groups of users from each other and to modify application behavior accordingly. This chapter describes the following two packages that allow you to perform these operations:


Contains programs that can modify and inspect session roles and settings from within PL/SQL. This package also contains programs for manipulating session memory and package states; even if they aren’t used very often, these programs are very instructive to understand.


Lets administrators set various trace events in other users’ sessions. Setting these events can be invaluable when tracking down difficult application performance or database issues.

DBMS_SESSION: Managing Session Information

The DBMS_SESSION package lets you access and alter session-level settings, including features of the ALTER SESSION and SET ROLE commands in SQL. Some of the session modifications that can be made using DBMS_SESSION include the following:

  • Enabling and disabling roles

  • Setting National Language Support (NLS) characteristics

  • Resetting package states and releasing session package memory

  • Setting Trusted Oracle label characteristics

DBMS_SESSION is used primarily to set preferences and security levels for a user’s current ...

Get Oracle Built-in Packages now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.