Coskan’s Approach to Oracle

March 2, 2007

How to get session info ?

Filed under: How To — coskan @ 12:54 pm

To get the info of your session you can use the SYS_CONTEXT function with USERENV namespace.

usage of SYS_CONTEXT  is like ;

SYS_CONTEXT(‘namespace’, ‘parameter’ [, length ])

The context namespace must already have been created, and the associated parameter and its value must also have been set using the DBMS_SESSION.set_context procedure. The parameter is not case sensitive. (Refer to the manual for context creation)

There are examples from the usage of sys_context with userenv namespace

code listing 4

references: Oracle® Database SQL Quick Reference10g Release 1 (10.1)

About these ads

1 Comment »

  1. Thanks That was helpful

    There are 2 ways of getting Session info from Oracle

    SELECT SYS_CONTEXT(‘USERENV’,’SESSIONID’) from DUAL;

    select userenv(‘SESSIONID’) from dual;

    Comment by satishmc — December 30, 2010 @ 12:56 pm


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Silver is the New Black Theme. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 199 other followers

%d bloggers like this: