這兩個函數用來記錄連接的session信息
SQL> select sid from v$session where audsid=userenv(
SID
至於sid和audsid的區別
the audsid column is populated via a sequence and for normal
sessions is the same as
(it comes back as
So
下面記錄了兩個函數的具體用法
返回當前的會話信息
OPTION=
OPTION=
OPTION=
OPTION=
OPTION=
OPTION=
OPTION=
SELECT USERENV(
select
SYS_CONTEXT(
SYS_CONTEXT(
SYS_CONTEXT(
SYS_CONTEXT(
SYS_CONTEXT(
SYS_CONTEXT(
SYS_CONTEXT(
SYS_CONTEXT(
SYS_CONTEXT(
SYS_CONTEXT(
SYS_CONTEXT(
SYS_CONTEXT(
SYS_CONTEXT(
SYS_CONTEXT(
SYS_CONTEXT(
SYS_CONTEXT(
SYS_CONTEXT(
SYS_CONTEXT(
SYS_CONTEXT(
SYS_CONTEXT(
SYS_CONTEXT(
SYS_CONTEXT(
SYS_CONTEXT(
SYS_CONTEXT(
SYS_CONTEXT(
SYS_CONTEXT(
SYS_CONTEXT(
SYS_CONTEXT(
SYS_CONTEXT(
from dual ;
其中
AUTHENTICATION_DATA
Data being used to authenticate the login user
Note: You can change the return value of the AUTHENTICATION_DATA attribute using the length parameter of the syntax
AUTHENTICATION_TYPE
How the user was authenticated:
DATABASE: username/password authentication
OS: operating system external user authentication
NETWORK: network protocol or ANO authentication
PROXY: OCI proxy connection authentication
BG_JOB_ID
Job ID of the current session if it was established by an Oracle background process
CLIENT_INFO
Returns up to
CURRENT_SCHEMA
Name of the default schema being used in the current schema
CURRENT_SCHEMAID
Identifier of the default schema being used in the current session
CURRENT_USER
The name of the user whose privilege the current session is under
CURRENT_USERID
User ID of the user whose privilege the current session is under
DB_DOMAIN
Domain of the database as specified in the DB_DOMAIN initialization parameter
DB_NAME
Name of the database as specified in the DB_NAME initialization parameter
ENTRYID
The available auditing entry identifier
EXTERNAL_NAME
External name of the database user
FG_JOB_ID
Job ID of the current session if it was established by a client foreground process
HOST
Name of the host machine from which the client has connected
INSTANCE
The instance identification number of the current instance
IP_ADDRESS
IP address of the machine from which the client is connected
ISDBA
TRUE if you are logged on as SYS
LANG
The ISO abbreviation for the language name
LANGUAGE
The language and territory currently used by your session
NETWORK_PROTOCOL
Network protocol being used for communication
NLS_CALENDAR
The current calendar of the current session
NLS_CURRENCY
The currency of the current session
NLS_DATE_FORMAT
The date format for the session
NLS_DATE_LANGUAGE
The language used for expressing dates
NLS_SORT BINARY
or the linguistic sort basis
NLS_TERRITORY
The territory of the current session
OS_USER
Operating system username of the client process that initiated the database session
PROXY_USER
Name of the database user who opened the current session on behalf of SESSION_USER
PROXY_USERID
Identifier of the database user who opened the current session on behalf of SESSION_USER
SESSION_USER
Database user name by which the current user is authenticated
SESSION_USERID
Identifier of the database user name by which the current user is authenticated
SESSIONID
The auditing session identifier
TERMINAL
The operating system identifier for the client of the current session
(The return length of this parameter may vary by operating system
From:http://tw.wingwit.com/Article/program/Oracle/201311/16831.html