oracle的跨会话变量,oracle 回话环境变量 userenv ,oracle connetion context 会话环境 连接的会话环境...
评论
# re: oracle 回话环境变量 userenv
2008-08-03 11:13
小高
关于sys_context()函数功能一览
包括取本地ip,服务器端domian/db_name……,还有当前session的信息
后面有使用举例:
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.
256
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
30
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.
30
CLIENT_INFO
Returns up to 64 bytes of user session information that can be stored by an application using the DBMS_APPLICATION_INFO package.
64
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.
30
CURRENT_SCHEMAID
Identifier of the default schema being used in the current session.
30
CURRENT_USER
The name of the user whose privilege the current session is under.
30
CURRENT_USERID
User ID of the user whose privilege the current session is under
30
DB_DOMAIN
Domain of the database as specified in the DB_DOMAIN initialization parameter.
256
DB_NAME
Name of the database as specified in the DB_NAME initialization parameter
30
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.
30
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.
256
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.
30
HOST
Name of the host machine from which the client has connected.
54
INSTANCE
The instance identification number of the current instance.
30
IP_ADDRESS
IP address of the machine from which the client is connected.
30
ISDBA
TRUE if you currently have the DBA role enabled and FALSE if you do not.
30
LANG
The ISO abbreviation for the language name, a shorter form than the existing 'LANGUAGE' parameter.
62
LANGUAGE
The language and territory currently used by your session, along with the database character set, in this form:
language_territory.characterset
52
NETWORK_PROTOCOL
Network protocol being used for communication, as specified in the 'PROTOCOL=protocol' portion of the connect string.
256
NLS_CALENDAR
The current calendar of the current session.
62
NLS_CURRENCY
The currency of the current session.
62
NLS_DATE_FORMAT
The date format for the session.
62
NLS_DATE_LANGUAGE
The language used for expressing dates.
62
NLS_SORT
BINARY or the linguistic sort basis.
62
NLS_TERRITORY
The territory of the current session.
62
OS_USER
Operating system username of the client process that initiated the database session
30
PROXY_USER
Name of the database user who opened the current session on behalf of SESSION_USER.
30
PROXY_USERID
Identifier of the database user who opened the current session on behalf of SESSION_USER.
30
SESSION_USER
Database user name by which the current user is authenticated. This value remains the same throughout the duration of the session.
30
SESSION_USERID
Identifier of the database user name by which the current user is authenticated.
30
SESSIONID
The auditing session identifier. You cannot use this option in distributed SQL statements.
30
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.)
SQL> SELECT sys_context('USERENV','IP_ADDRESS') FROM DUAL;
SYS_CONTEXT('USERENV','IP_ADDR
--------------------------------------------------------------------------------
10.0.0.177
SQL> SELECT SYS_CONTEXT ('hr_apps', 'group_no') "User Group"
2 FROM DUAL;
User Group
--------------------------------------------------------------------------------
SQL> SELECT sys_context('USERENV','CLIENT_INFO') FROM DUAL;
SYS_CONTEXT('USERENV','CLIENT_
--------------------------------------------------------------------------------
SQL> SELECT sys_context('USERENV','CURRENT_SCHEMA') FROM DUAL;
SYS_CONTEXT('USERENV','CURRENT
--------------------------------------------------------------------------------
IDCBJ
SQL> SELECT sys_context('USERENV','HOST') FROM DUAL;
SYS_CONTEXT('USERENV','HOST')
--------------------------------------------------------------------------------
WORKGROUP\RAINY
SQL> SELECT sys_context('USERENV','AUTHENTICATION_DATA') FROM DUAL;
SYS_CONTEXT('USERENV','AUTHENT
--------------------------------------------------------------------------------
SQL> SELECT sys_context('USERENV','AUTHENTICATION_TYPE') FROM DUAL;
SYS_CONTEXT('USERENV','AUTHENT
--------------------------------------------------------------------------------
DATABASE
SQL> SELECT sys_context('USERENV','DB_DOMAIN') FROM DUAL;
SYS_CONTEXT('USERENV','DB_DOMA
--------------------------------------------------------------------------------
chenyq
SQL> SELECT sys_context('USERENV','DB_NAME') FROM DUAL;
SYS_CONTEXT('USERENV','DB_NAME
--------------------------------------------------------------------------------
ora817
SQL> SELECT SYS_CONTEXT('hr_context', 'org_id') FROM DUAL;
SYS_CONTEXT('HR_CONTEXT','ORG_
--------------------------------------------------------------------------------
SQL> 回复 更多评论
oracle的跨会话变量,oracle 回话环境变量 userenv ,oracle connetion context 会话环境 连接的会话环境...相关推荐
- oracle 设置输出显示中文乱码,修改oracle当前会话的语言环境,解决oracle显示中文乱码的问题 | 信春哥,系统稳,闭眼上线不回滚!...
对于数据库ORACLE有时操作时,提示的是一串串???,不能起到提示的作用,这是由于语言环境的设置问题,下面是实际操作中要用到的. 查看当前会话的语言环境: SQL> select useren ...
- Windows下 安装Oracle Java 11 并设置环境变量
Oracle Java 11 官网:Java SE Development Kit 11- - Downloads 2019-5-30:最新的版本是11.0.3 选择Windows版本: 注意:现在下 ...
- oracle sid环境变量,ORACLE_SID环境变量设置的问题
明明在注册表里存在环境变量ORACLE_SID的设置,可执行emctl时却提示: C:>emctl Environment variable ORACLE_SID not defined. Pl ...
- oracle 新建路径,Linux环境安装Oracle11g(三)——用户、路径创建及配置环境变量
建立组用户,配置密码 /usr/sbin/groupadd -g 1001 oinstall /usr/sbin/groupadd -g 1002 dba /usr/sbin/groupadd -g ...
- 因xhost命令和DISPLAY环境变量操作不当导致无法启动Oracle图形化安装界面
在redhat操作系统上安装Oracle 11.1时,遇到在执行runInstaller后无法启动安装图像化界面,甚是郁闷. 问题现象: 使用Xmanager2.0软件登陆AIX桌面,root用户可以 ...
- oracle数据库path,利用Path环境变量解决oracle数据库和owb工具不兼容问题!
利用Path环境变量解决oracle数据库和owb工具不兼容问题! 2009年5月4日 现象: 安装了oracle9i和owb10后往往会出现各自工具不能启动的现象,比如安装完oracle9i后再安装 ...
- 删除Oracle数据库时常见问题(注册表方面,文件目录方面,环境变量方面)
运行regedit命令,打开注册表.删除注册表中与Oracle相关内容,具体下: 删除HKEY_LOCAL_MACHINE/SOFTWARE/ORACLE目录. 删除HKEY_LOCAL_MACHIN ...
- 查看oracle中path,查看oracle进程启动时的环境变量
当我们使用sqlplus本地登录oracle数据库时,设置的环境变量ORACLE_HOME和oracle启动时的环境变量ORACLE_HOME不一致时,会出现连接报错. 那么有什么办法可以看到orac ...
- 【C/C++10】天气APP:MySQL/PostgreSQL,环境变量/动静态库,Linux/Oracle字符集
文章目录 1.MySQL:decimal,find . .-print 2.PostgreSQL:$ 3.环境变量:tnsnames.ora,curl 3.1 对单一用户生效: .bash_profi ...
最新文章
- 0、elasticsearch前言
- css实现超出文本溢出用省略号代替
- Clojure入门教程: Clojure – Functional Programming for the JVM中文版
- Chrome的console
- [转]locate命令的使用
- es6 实例:使用Proxy实现观察者模式
- Entity Framework教程(第二版)
- spring mvc 学习 转载
- formData上传音乐文件
- Proteus ISIS仿真软件中英文元件名称对照
- 瑞星发布中国用户最常用十大密码:abc123
- 脚手架的这个好搭档 今天要重点来介绍下!
- 视频教程-最新完整react教程从入门到精通包教包会-ReactJS
- datax数据迁移之从oracle往Mysql迁移
- python分析每月销售数据_Python分析某医院销售数据
- [转]Berkeley DB实现分析
- Redis集群使用指南
- 高通平台android开发总结 MSM平台上的AMSS
- ubuntu16安装python3.6
- 小程序实现地图找房功能