壹佰网|ERP100 - 企业信息化知识门户

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 5091|回复: 2

oracle二次开发中的一些小细节

[复制链接]
发表于 2006/12/12 11:43:51 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622  。

您需要 登录 才可以下载或查看,没有帐号?注册

x
oracle的一些有用的环境变量

select sys_context('USERENV','LANG') FROM DUAL
(Extracted from SQL Reference Documentation)
TERMINAL          The operating system identifier for the client of the
                  current session.  In distributed SQL statements, this
                  option returns the identifier for your local session.
                  In a distributed environment, this is supported only
                  for remote SELECTs, not for remote INSERTs, UPDATEs,
                  or DELETEs. (The return length of this parameter may
                  vary by operating system.)
LANGUAGE          The language and territory currently used by your session,
                  along with the database character set, in this form:
                    language_territory.characterset
LANG              The ISO abbreviation for the language name, a shorter form
                  than the existing 'LANGUAGE' parameter.
SESSIONID         The auditing session identifier.  You cannot use this
                  option in distributed SQL statements.
INSTANCE          The instance identification number of the current instance.  
ENTRYID           The available auditing entry identifier.  You cannot use
                  this option in distributed SQL statements.  To use this
                  keyword in USERENV, the initialization parameter AUDIT_TRAIL
                  must be set to TRUE.  
ISDBA             TRUE if you currently have the DBA role enabled and FALSE
                  if you do not.  
CLIENT_INFO       Returns up to 64 bytes of user session information that can
                  be stored by an application using the DBMS_APPLICATION_INFO
                  package.
NLS_TERRITORY     The territory of the current session.
NLS_CURRENCY      The currency of the current session.
NLS_CALENDAR      The current calendar 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.
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.
SESSION_USER      Database user name by which the current user is authenticated.
                  This value remains the same throughout the duration of the
                  session.
SESSION_USERID    Identifier of the database user name by which the current
                  user is authenticated.
CURRENT_SCHEMA    Name of the default schema being used in the current schema.  
                  This value can be changed during the session with an ALTER
                  SESSION SET CURRENT_SCHEMA statement.
CURRENT_SCHEMAID  Identifier of the default schema being used in the current
                  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.
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.
HOST              Name of the host machine from which the client has connected.
OS_USER           Operating system username of the client process that initiated
                  the database session.
EXTERNAL_NAME     External name of the database user.  For SSL authenticated
                  sessions using V.503 certificates, this field returns the
                  distinguished name (DN) stored in the user certificate.
IP_ADDRESS        IP address of the machine from which the client is connected.
NETWORK_PROTOCOL  Network protocol being used for communication, as specified
                  in the 'PROTOCOL=protocol' portion of the connect string.
BG_JOB_ID         Job ID of the current session if it was established by an
                  Oracle background process.  Null if the session was not
                  established by a background process.
FG_JOB_ID         Job ID of the current session if it was established by a
                  client foreground process.  Null if the session was not
                  established by a foreground process.
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.
AUTHENTICATION_DATA  Data being used to authenticate the login user.  For
                     X.503 certificate authenticated sessions, this field
                     returns the context of the certificate in HEX2 format.

Note:  You can change the return value of the AUTHENTICATION_DATA
       attribute using the length parameter of the syntax.  Values of
       up to 4000 are accepted.  This is the only attribute of USERENV
       for which Oracle implements such a change.

例子:
   select userenv('CLIENT_INFO')
   from dual
   
   
      
select sys_context('USERENV','LANG') FROM DUAL
发表于 2006/12/12 11:58:37 | 显示全部楼层
Thanks for your share!
发表于 2010/5/11 11:51:42 | 显示全部楼层
顶一下
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|手机版|壹佰网 ERP100 ( 京ICP备19053597号-2 )

Copyright © 2005-2012 北京海之大网络技术有限责任公司 服务器托管由互联互通
手机:13911575376
网站技术点击发送消息给对方83569622   广告&合作 点击发送消息给对方27675401   点击发送消息给对方634043306   咨询及人才点击发送消息给对方138011526

GMT+8, 2025/11/29 05:35 , Processed in 0.012154 second(s), 14 queries , File On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表