Guenadi N Jilevski's Oracle BLOG

Oracle RAC, DG, EBS, DR and HA DBA BLOG

Listing active contexts in Oracle

Listing active contexts in Oracle

— Listing active contexts
CREATE OR REPLACE PROCEDURE listContext AS
list DBMS_SESSION.APPCTXTABTYP;
cnt NUMBER;
BEGIN
DBMS_OUTPUT.PUT_LINE(‘USERENV nls_territory = ‘||SYS_CONTEXT(‘userenv’,’nls_territory’));
DBMS_OUTPUT.PUT_LINE(‘USERENV nls_currency = ‘||SYS_CONTEXT(‘userenv’,’nls_currency’));
DBMS_OUTPUT.PUT_LINE(‘USERENV nls_calendar = ‘||SYS_CONTEXT(‘userenv’,’nls_calendar’));
DBMS_OUTPUT.PUT_LINE(‘USERENV nls_date_format = ‘||SYS_CONTEXT(‘userenv’,’nls_date_format’));
DBMS_OUTPUT.PUT_LINE(‘USERENV nls_date_language = ‘||SYS_CONTEXT(‘userenv’,’nls_date_language’));
DBMS_OUTPUT.PUT_LINE(‘USERENV nls_sort = ‘||SYS_CONTEXT(‘userenv’,’nls_sort’));
DBMS_OUTPUT.PUT_LINE(‘USERENV session_user = ‘||SYS_CONTEXT(‘userenv’,’session_user’));
DBMS_OUTPUT.PUT_LINE(‘USERENV current_user = ‘||SYS_CONTEXT(‘userenv’,’current_user’));
DBMS_OUTPUT.PUT_LINE(‘USERENV current_schema = ‘||SYS_CONTEXT(‘userenv’,’current_schema’));
DBMS_OUTPUT.PUT_LINE(‘USERENV current_schemaid = ‘||SYS_CONTEXT(‘userenv’,’current_schemaid’));
DBMS_OUTPUT.PUT_LINE(‘USERENV session_userid = ‘||SYS_CONTEXT(‘userenv’,’session_userid’));
DBMS_OUTPUT.PUT_LINE(‘USERENV currend_userid = ‘||SYS_CONTEXT(‘userenv’,’current_userid’));
— Listing user defined namespaces
DBMS_SESSION.LIST_CONTEXT(list, cnt);
FOR i IN 1..cnt LOOP
DBMS_OUTPUT.PUT_LINE(list(i).namespace||’  ‘||list(i).attribute||’ = ‘||list(i).value);
END LOOP;
END;
/

January 13, 2010 - Posted by | oracle

2 Comments »

  1. Reblogged this on Dawn Pearson Posts.

    Comment by k32inpebelvie1986 | October 8, 2012 | Reply

  2. I must tell you that it’s hard to find your articles in google,
    i found this one on 19 spot, you should build some
    quality backlinks in order to rank your page, i know how to help you,
    just search in google – k2 seo tips

    Comment by Cathey Tllo | June 27, 2014 | Reply


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

%d bloggers like this: