Userenv () in Oracle

Source: Internet
Author: User

1.USEREVN ()


To return information about the current user environment, opt can be:
Entryid,sessionid,terminal,isdba,lable,language,client_info,lang,vsize

1.ISDBA See if the current user is a DBA if yes returns true
Sql> Select Userenv (' Isdba ') from dual;

Useren
------
FALSE


2.SESSION Return to Session flag


Sql> Select Userenv (' SessionID ') from dual;

USERENV (' SESSIONID ')
--------------------
152


4.ENTRYID Return session population flag


Sql> Select Userenv (' EntryID ') from dual;

USERENV (' ENTRYID ')
------------------
0


5.INSTANCE returns the current INSTANCE flag
Sql> Select Userenv (' instance ') from dual;

USERENV (' INSTANCE ')
-------------------
1


6.LANGUAGE returns the current environment variable
Sql> Select Userenv (' language ') from dual;

USERENV (' LANGUAGE ')
----------------------------------------------------
Simplified Chinese_china. Zhs16gbk

7.LANG returns the abbreviation for the language of the current environment
Sql> Select Userenv (' Lang ') from dual;

USERENV (' LANG ')
----------------------------------------------------
ZHS


8.TERMINAL return the logo of the user's Terminal or machine
Sql> Select Userenv (' Terminal ') from dual;

USERENV (' Termina
----------------
GAO


9.VSIZE (x) returns the size (in bytes) of X
Sql> Select Vsize (user), user from dual;

Vsize (user) User
----------- ------------------------------
6 SYSTEM

2.sys_context


Select
Sys_context (' USERENV ', ' TERMINAL ') TERMINAL,
Sys_context (' USERENV ', ' LANGUAGE ') LANGUAGE,
Sys_context (' USERENV ', ' SESSIONID ') SESSIONID,
Sys_context (' USERENV ', ' INSTANCE ') INSTANCE,
Sys_context (' USERENV ', ' ENTRYID ') ENTRYID,
Sys_context (' USERENV ', ' isdba ') ISDBA,
Sys_context (' USERENV ', ' nls_territory ') nls_territory,
Sys_context (' USERENV ', ' nls_currency ') nls_currency,
Sys_context (' USERENV ', ' Nls_calendar ') Nls_calendar,
Sys_context (' USERENV ', ' Nls_date_format ') Nls_date_format,
Sys_context (' USERENV ', ' nls_date_language ') nls_date_language,
Sys_context (' USERENV ', ' nls_sort ') Nls_sort,
Sys_context (' USERENV ', ' current_user ') Current_User,
Sys_context (' USERENV ', ' Current_userid ') Current_userid,
Sys_context (' USERENV ', ' session_user ') Session_user,
Sys_context (' USERENV ', ' Session_userid ') Session_userid,
Sys_context (' USERENV ', ' Proxy_user ') Proxy_user,
Sys_context (' USERENV ', ' Proxy_userid ') Proxy_userid,
Sys_context (' USERENV ', ' db_domain ') Db_domain,
Sys_context (' USERENV ', ' db_name ') db_name,
Sys_context (' USERENV ', ' host ') HOST,
Sys_context (' USERENV ', ' Os_user ') Os_user,
Sys_context (' USERENV ', ' external_name ') External_name,
Sys_context (' USERENV ', ' ip_address ') ip_address,
Sys_context (' USERENV ', ' Network_protocol ') Network_protocol,
Sys_context (' USERENV ', ' bg_job_id ') bg_job_id,
Sys_context (' USERENV ', ' fg_job_id ') fg_job_id,
Sys_context (' USERENV ', ' Authentication_type ') Authentication_type,
Sys_context (' USERENV ', ' authentication_data ') authentication_data
from dual;

Userenv () in Oracle

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.