oraclle 開發技術集錦

scu2005發表於2009-12-10
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
4.ENTRYID 返回會話人口標誌
SQL> select userenv('entryid') from dual;
USERENV('ENTRYID')
------------------
                  0
5.INSTANCE 返回當前INSTANCE的標誌
SQL> select userenv('instance') from dual;
USERENV('INSTANCE')
-------------------
                   1
6.LANGUAGE 返回當前環境變數
SQL> select userenv('language') from dual;
USERENV('LANGUAGE')
----------------------------------------------------
SIMPLIFIED CHINESE_CHINA.ZHS16GBK
7.LANG 返回當前環境的語言的縮寫
SQL> select userenv('lang') from dual;
USERENV('LANG')
----------------------------------------------------
ZHS
8.TERMINAL 返回使用者的終端或機器的標誌
SQL> select userenv('terminal') from dual;
USERENV('TERMINA
----------------
GAO
9.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('U ......

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/11536986/viewspace-622165/,如需轉載,請註明出處,否則將追究法律責任。

相關文章