Oracle/PLSQL: Sys_Context Function(轉自http://www.techonthenet.com)
In Oracle/PLSQL, the sys_context function can be used to retrieve information about the Oracle environment.
The syntax for the sys_context function is:
sys_context( namespace, parameter, [ length ] )
namespace is an Oracle namespace that has already been created. If the namespace of 'USERENV' is used, attributes describing the current Oracle session can be returned.
parameter is a valid attribute that has been set using the DBMS_SESSION.set_context procedure.
length is optional. It is the length of the return value in bytes. If this parameter is omitted or if an invalid entry is provided, the sys_context function will default to 256 bytes.
The valid parameters for the namespace called 'USERENV' are as follows:
[@more@]
Parameter Explanation Return Length AUDITED_CURSORID Returns the cursor ID of the SQL that triggered the audit N/A AUTHENTICATION_DATA Authentication data 256 AUTHENTICATION_TYPE Describes how the user was authenticated. Can be one of the following values: Database, OS, Network, or Proxy 30 BG_JOB_ID If the session was established by an Oracle background process, this parameter will return the Job ID. Otherwise, it will return NULL. 30 CLIENT_IDENTIFIER Returns the client identifier (global context) 64 CLIENT_INFO User session information 64 CURRENT_SCHEMA Returns the default schema used in the current schema 30 CURRENT_SCHEMAID Returns the identifier of the default schema used in the current schema 30 CURRENT_SQL Returns the SQL that triggered the audit event 64 CURRENT_USER Name of the current user 30 CURRENT_USERID Userid of the current user 30 DB_DOMAIN Domain of the database from the DB_DOMAIN initialization parameter 256 DB_NAME Name of the database from the DB_NAME initialization parameter 30 ENTRYID Available auditing entry identifier 30 EXTERNAL_NAME External of the database user 256 FG_JOB_ID If the session was established by a client foreground process, this parameter will return the Job ID. Otherwise, it will return NULL. 30 GLOBAL_CONTEXT_MEMORY The number used in the System Global Area by the globally accessed context N/A HOST Name of the host machine from which the client has connected 54 INSTANCE The identifier number of the current instance 30 IP_ADDRESS IP address of the machine from which the client has connected 30 ISDBA Returns TRUE if the user has DBA privileges. Otherwise, it will return FALSE. 30 LANG The ISO abbreviate for the language 62 LANGUAGE The language, territory, and character of the session. In the following format:
language_territory.characterset52 NETWORK_PROTOCOL Network protocol used 256 NLS_CALENDAR The calendar of the current session 62 NLS_CURRENCY The currency of the current session 62 NLS_DATE_FORMAT The date format for the current session 62 NLS_DATE_LANGUAGE The language used for dates 62 NLS_SORT BINARY or the linguistic sort basis 62 NLS_TERRITORY The territory of the current session 62 OS_USER The OS username for the user logged in 30 PROXY_USER The name of the user who opened the current session on behalf of SESSION_USER 30 PROXY_USERID The identifier of the user who opened the current session on behalf of SESSION_USER 30 SESSION_USER The database user name of the user logged in 30 SESSION_USERID The database identifier of the user logged in 30 SESSIONID The identifier of the auditing session 30 TERMINAL The OS identifier of the current session 10
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/95530/viewspace-1023318/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle/PLSQL: UserEnv Function(轉自http://www.techonthenet.com/oracle/functions/userenv.php)OracleSQLFunctionHTTPPHP
- plsql generate xml functionSQLXMLFunction
- monitor sys and system user(轉自http://www.oracle.com)HTTPOracle
- plsql中的procedure和function程式設計SQLFunction程式設計
- Oracle USERENV和sys_contextOracleContext
- oracle plsqlOracleSQL
- 轉newkid關於plsql精華帖子附自測SQL
- oracle plsql例子OracleSQL
- oracle function overviewOracleFunctionView
- Oracle Table FunctionOracleFunction
- oracle function powerOracleFunction
- oracle plsql(二)_plsql塊內之**冪OracleSQL
- oracle sys_context 使用小記_轉摘骨骨網友筆記OracleContext筆記
- oracle INTERNAL_FUNCTIONOracleFunction
- Oracle Deterministic FunctionOracleFunction
- Oracle中USERENV和SYS_CONTEXT總結OracleContext
- plsql_function_package_translate_instr_dbms_random測試小記SQLFunctionPackagerandom
- Oracle/PLSQL: Grant/Revoke PrivilegesOracleSQL
- Oracle PLSQL Sever Pages TestOracleSQL
- oracle plsql函式大全OracleSQL函式
- Oracle Pipelined FunctionOracleFunction
- oracle function函式castOracleFunction函式AST
- BIRT呼叫oracle function薦OracleFunction
- a demo function of oracle for AKingFunctionOracle
- plsql自動生成java原始碼SQLJava原始碼
- SYS_CONTEXTContext
- oracle之PLSql語言(一)OracleSQL
- oracle plsql(三)_type_cursorOracleSQL
- ORACLE PLSQL語言參考OracleSQL
- oracle plsql儲存過程OracleSQL儲存過程
- Oracle基礎之function使用OracleFunction
- oracle create function 例項2OracleFunction
- Oracle Profile and PASSWORD_VERIFY_FUNCTIONOracleFunction
- oracle 鎖(轉自網路)Oracle
- 如何設定HTTP自動跳轉到HTTPSHTTP
- rfc1945-http1.0自譯本-(4) (轉)HTTP
- RFC2617- HTTP Authentication自譯本-(2) (轉)HTTP
- rfc1945-http1.0自譯本-(1) (轉)HTTP