Oracle 中的userenv()
1.USEREVN()
返回當前使用者環境的資訊,opt可以是:
ENTRYID,SESSIONID,TERMINAL,ISDBA,LABLE,LANGUAGE,CLIENT_INFO,LANG,VSIZE
1)ISDBA 檢視當前使用者是否是DBA如果是則返回true
SQL> select userenv('isdba') from dual;
USEREN
------
FALSE
2)SESSION 返回會話標誌
SQL> select userenv('sessionid') from dual;
USERENV('SESSIONID')
--------------------
152
3)ENTRYID 返回會話人口標誌
SQL> select userenv('entryid') from dual;
USERENV('ENTRYID')
------------------
0
4)INSTANCE 返回當前INSTANCE的標誌
SQL> select userenv('instance') from dual;
USERENV('INSTANCE')
-------------------
1
5)LANGUAGE 返回當前環境變數
SQL> select userenv('language') from dual;
USERENV('LANGUAGE')
----------------------------------------------------
SIMPLIFIED CHINESE_CHINA.ZHS16GBK
6)LANG 返回當前環境的語言的縮寫
SQL> select userenv('lang') from dual;
USERENV('LANG')
----------------------------------------------------
ZHS
7)TERMINAL 返回使用者的終端或機器的標誌
SQL> select userenv('terminal') from dual;
USERENV('TERMINA
----------------
GAO
8)VSIZE(X) 返回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;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26736162/viewspace-2135554/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ORACLE USERENV函式Oracle函式
- Oracle中USERENV和SYS_CONTEXT總結OracleContext
- Oracle/PLSQL: UserEnv Function(轉自http://www.techonthenet.com/oracle/functions/userenv.php)OracleSQLFunctionHTTPPHP
- Oracle USERENV和sys_contextOracleContext
- 【Oracle-資料庫維護】-Oracle中USERENV和SYS_CONTEXT總結Oracle資料庫Context
- userenv函式函式
- SYS_CONTEXT & USERENVContext
- userenv() 和sys_context()Context
- userenv和sys_context函式Context函式
- Oracle中的publicOracle
- Oracle中的段Oracle
- Oracle中的鎖Oracle
- oracle中的簇Oracle
- Oracle中的jobOracle
- oracle中的角色Oracle
- oracle中的nullOracleNull
- Oracle中with的用法Oracle
- Oracle中的SCNOracle
- Oracle中的rownumOracle
- Oracle中Kill session的研究 for oracle -- 轉OracleSession
- Oracle 中的exception——(Raise)OracleExceptionAI
- oracle 中的事務Oracle
- ORACLE中index的rebuildOracleIndexRebuild
- 【 Oracle中rownum的用法 】Oracle
- Oracle中的並行Oracle並行
- oracle中的cluster表Oracle
- oracle中schema的概念Oracle
- oracle中的exists理解Oracle
- Oracle中的sql%rowcountOracleSQL
- oracle中的asm文化OracleASM
- oracle中的約束Oracle
- Oracle中Sequence的使用Oracle
- ORACLE中的時區Oracle
- ORACLE中的KILLED SESSIONOracleSession
- oracle中的連線Oracle
- Oracle中EM的配置Oracle
- oracle中Job的操作Oracle
- Oracle中的NULL(六)OracleNull