首页 | 互联网 | IT动态 | IT培训 | Cisco | Windows | Linux | Java | .Net | Oracle | 软件测试 | C/C++ | 嵌入式开发 | 存储世界 | 服务器
网络设备 | IDC | 安全 | 求职招聘 | 数字网校 | 网页设计 | 平面设计 | 技术专题 | 电子书下载 | 教学视频 | 源码下载 | 搜索 | 博客 | 论坛
中国IT实验室Oracle频道
中国IT教育
Google
首页 入门基础 安装配置 体系架构 PLSQL 备份恢复 性能调优 开发技术 资讯动态 考试认证 下载 专题 讨论
您现在的位置: 中国IT实验室 >> Oracle >> 开发技术 >> 正文

Oracle 9i SYS_CONTEXT函数的使用方法

        此函数在写一些触发器和函数的时候非常有用处。

        用法:

         SELECT sys_context('USERENV', '') FROM dual;

        第二个参数的可选值:

        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.

        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. Null if the session was not established by a background process.
        CLIENT_INFO
        Returns up to 64 bytes of user session information that can be stored by an application using the DBMS_APPLICATION_INFO package.

        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.

        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. 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.

        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.

        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.

        HOST
        Name of the host machine from which the client has connected.

[1] [2] 下一页

【责编:michael】

中国IT教育

相关产品和培训
文章评论
 友情推荐链接
 认证培训
 专题推荐

 ·关于Java框架技术专题
 ·XML全攻略技术专题
 ·JAVA开源技术介绍专题
 ·Java嵌入式开发之J2ME技术专题
 ·超前体验 Oracle 11g的5个新特性…
 ·揭密使用VB.NET的五个实用技巧
 ·Oracle和SQL Server常用函数对比专题…
 ·展现C#世界 C#程序设计专题…
 ·Java入门 Tomcat的配置技巧精华专题…
 ·Oracle RMAN物理备份技术详解…
 今日更新
 社区讨论
 博客论点
 频道精选
 Oracle频道相关导航