网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > 数据库 > Oracle教程
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
数据库:数据库教程,数据库技巧,Oracle教程,MySQL教程,Sybase教程,Access教程,DB2教程,数据库安全,数据库文摘
本月文章推荐
.Oracle9i Data Guard的灾难防护 .
.新手上路:Oracle基础工具简介.
.开机自动启动oracle和weblogic.
.Oracle迁移SQL Server的陷阱.
.教你快速掌握一些经常用到的"SQL.
.ORACLE的分布式管理.
.Oracle 9i基于Web的管理.
.ORACLE数据库常见问题诊断方法.
.IDC:Oracle数据库依然是首选.
.数据文件internal的内部结构分析.
.Oracle数据库开发的一些经验积累.
.NT下如何彻底删除Oracle?.
.全面理解虚拟邮件域.
.虚拟文件系统 (VFS) 简介.
.解决Oracle 9i和Tomcat端口冲突.
.rman备份,未用catalog,控制文件丢.
.讲解用于描述数据库中需要存储的.
.Oracle处理多媒体信息的原理及展.
.ORACLE DATE和TIMESTAMP数据类型.
.Install Oracle10g On RedhatEL .

Oracle 9i SYS_CONTEXT函数的使用方法

发表日期:2008-7-4


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

用法:

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.

INSTANCE

The instance identification number of the current instance.

IP_ADDRESS

IP address of the machine from which the client is connected.

ISDBA

TRUE if you are logged on as SYS.

LANG

The ISO abbreviation for the language name, a shorter form than the existing 'LANGUAGE' parameter.

LANGUAGE

The language and territory currently used by your session, along with the database character set, in the form:language_territory.characterset.

NETWORK_PROTOCOL

Network protocol being used for communication, as specified in the 'PROTOCOL=protocol' portion of the connect string.

NLS_CALENDAR

The current calendar of the current session.

NLS_CURRENCY

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

NLS_TERRITORY

The territory of the current session.

OS_USER

Operating system username of the client process that initiated the database 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.

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.

SESSIONID

The auditing session identifier. You cannot use this option in distributed SQL statements.

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 SELECT statements, not for remote INSERT, UPDATE, or DELETE operations.

(The return length of this parameter may vary by operating system.)

上一篇:深入了解Oracle数据恢复/挖掘工具FySafe 人气:811
下一篇:用Quick Slice获取Oracle进程的线程状态 人气:792
浏览全部Oracle的内容 Dreamweaver插件下载 网页广告代码 祝你圣诞节快乐 2009年新年快乐