问题描述
在数据库管理中,怎样获取数据库的环境信息?
问题分析
sys_context是用于查询Oracle数据库环境信息的函数。从sys_context()获得更多会话级信息。
sys_context函数语法为:
sys_context(namespce,parameter,[length])
命名空间userenv的属性参数
select sys_context('USERENV','audited_cursorid') from dual;
select sys_context('USERENV','authentication_data') from dual;
select sys_context('USERENV','authentication_type') from dual;
select sys_context('USERENV','bg_job_id') from dual;
select sys_context('USERENV','client_info') from dual;
select sys_context('USERENV','current_schema') from dual;
select sys_context('USERENV','current_schemaid') from dual;
select sys_context('USERENV','current_sql') from dual;
select sys_context('USERENV','current_user') from dual;
select sys_context('USERENV','current_userid') from dual;
select sys_context('USERENV','db_domain') from dual;
select sys_context('USERENV','db_name') from dual;
select sys_context('USERENV','entryid') from dual;
select sys_context('USERENV','external_name') from dual;
select sys_context('USERENV','fg_job_id') from dual;
select sys_context('USERENV','host') from dual;
select sys_context('USERENV','instance') from dual;
select sys_context('USERENV','ip_address') from dual;
select sys_context('USERENV','isdba') from dual;
select sys_context('USERENV','lang') from dual;
select sys_context('USERENV','language') from dual;
select sys_context('USERENV','network_protocol') from dual;
select sys_context('USERENV','nls_calendar') from dual;
select sys_context('USERENV','nls_date_format') from dual;
select sys_context('USERENV','nls_date_language') from dual;
select sys_context('USERENV','nls_territory') from dual;
select sys_context('USERENV','os_user') from dual;
select sys_context('USERENV','proxy_user') from dual;
select sys_context('USERENV','proxy_userid') from dual;
select sys_context('USERENV','session_user') from dual;
select sys_context('USERENV','session_userid') from dual;
select sys_context('USERENV','sessionid') from dual;
select sys_context('USERENV','terminal') from dual;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7356664/viewspace-1015811/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/7356664/viewspace-1015811/