Oracle Sys_context () function __ static functions

Source: Internet
Author: User
Tags session id

The first parameter is ' USERENV ', is fixed, the second parameter is fixed, but is a multiple-selection fix, and the optional values are as follows:

Select Sys_context (' USERENV ', ' authentication_type ') authentication type from dual;--user
Select Sys_context (' USERENV ', ' Authentication_data ') from dual;--unknown
Select Sys_context (' USERENV ', ' bg_job_id ') from dual;--whether the session of the currently specified ID is established for the Oracle daemon, or NULL is not returned
Select Sys_context (' USERENV ', ' Client_info ') from dual;--can store up to 64 bytes of user session information through the Dbms_application_info package
Select Sys_context (' USERENV ', ' Current_schema ') from dual;--Default schema will be treated as the current schema. When the ALTER session SET CURRENT_SCHEMA statement is used in the current conversation, its query return value is changed
Select Sys_context (' USERENV ', ' Current_schemaid ') from dual;--ID of the current schema
Select Sys_context (' USERENV ', ' Current_User ') from dual;--current login user
Select REPLACE (SUBSTR (Sys_context (' USERENV ', ' HOST '), 1,30), ' \ ', ': ') from dual;--current session host operating system name
Select Sys_context (' USERENV ', ' Current_userid ') from dual;--ID of the user currently logged in
Select Sys_context (' USERENV ', ' Db_domain ') from dual;--specify initialization parameters for the domain of the database
Select Sys_context (' USERENV ', ' db_name ') from dual;--database instance name
Select Sys_context (' USERENV ', ' ENTRYID ') from dual;--the available audit identifiers. This option can no longer be used in distributed SQL statements. The initialization parameters for the Audit_trail must be true using the Userenv keyword.
Select Sys_context (' USERENV ', ' external_name ') from dual;--the extension of the database user
Select Sys_context (' USERENV ', ' fg_job_id ') from dual;--returns the job ID when this session is created by the client process. Otherwise, returns null
Select Sys_context (' USERENV ', ' INSTANCE ') from dual;--The identifier ID of the current database instance

Select Sys_context (' USERENV ', ' isdba ') from dual;--whether the current user is logged on as DBA
Select Sys_context (' USERENV ', ' LANG ') from Dual;--iso for the abbreviation of ' LANGUAGE ', the query parameter is shorter than "LANGUAGE"
Select Sys_context (' USERENV ', ' LANGUAGE ') from dual;-- Results The storage language used for the current database is the same as the previous query
Select Sys_context (' USERENV ', ' Network_protocol ') from dual;--Network protocol for communication
Select Sys_ The context (' USERENV ', ' Nls_calendar ') is used by the current session of the dual;--, GMT
Select Sys_context (' USERENV ', ' nls_currency ') from dual;--localized currency characters, such as RMB ¥, dollar character $
Select Sys_context (' USERENV ', ' Nls_date_format ') from dual;--the date format currently in use, Generally China is the language of the DD-MON-RR
Select Sys_context (' USERENV ', ' nls_date_language ') from dual;--representing dates, such as the Chinese Simplified Simplified Chinese

Select Sys_context (' USERENV ', ' nls_territory ') from dual;--the region where the database server is located, such as China
Select Sys_context (' USERENV ', ' Os_user ') from the user name of the dual;--operating system
Select Sys_context (' USERENV ', ' Proxy_user ') from dual;--whether to use a proxy user. No returns NULL
Select Sys_context (' USERENV ', ' Proxy_userid ') from dual;--Proxy User ID
Select sys_context (' USERENV ', ' Session_user ') from dual;--the currently authenticated database username
Select Sys_context (' USERENV ', ' Session_userid ') from dual;--the currently authenticated database user name ID
Select Sys_context (' USERENV ', ' SESSIONID ') from dual;--current session ID
Select Sys_context (' USERENV ', ' TERMINAL ') from dual;--operating System user group
Select sys_context (' USERENV ', ' ip_address ') from dual;--current session Host IP
Select Sys_context (' USERENV ', ' Host ' from dual;--the current session host operating system name

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.