Table of Contents

About

Userenv is a pre-build context that describes the current session.

How to

Query it

You can query the context Userenv with two functions.

SELECT SYS_CONTEXT('USERENV','SESSIONID') FROM DUAL;
  • or the USERENV function Deprectaed
SELECT USERENV('SESSIONID') FROM DUAL;

Get the Parameters

You can see all the SYS_CONTEXT parameters in the SQL documentation. Predefined Parameters of Namespace USERENV

CURRENT_SCHEMA

See Oracle Database - CURRENT_SCHEMA

current_user

See Oracle Database - CURRENT_USER, SESSION_USER

LANGUAGE

USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.WE8ISO8859P1

It gives the session's <language>_<territory> but the DATABASE character set, so the value returned is not the client's NLS_LANG setting!