My Oracle Support Banner

Behaviour Of Sys_context Over Dblink (Doc ID 414287.1)

Last updated on AUGUST 04, 2018

Applies to:

Oracle Database - Enterprise Edition - Version 9.2.0.1 to 10.2.0.1 [Release 9.2 to 10.2]
Microsoft Windows (32-bit)

Symptoms

The execution of the following function return a different value when executed using a databaselink:

DATA BASE A:

create or replace function USR.GetOSUser 
return varchar2 
is 
begin 
    return sys_context( 'UserEnv', 'OS_User' ) ;
end GetOSUser ; 
/

 


Local execution Database A:

SQL> conn scott/tiger@r11w
Connected.


SQL> select getosuser from dual;

GETOSUSER
-----------------------------------
LSLNX4\user1

Database B:

SQL> create database link r11w connect to scott identified by tiger using 'r11w';

Database link created.

SQL> select getosuser@r11w from dual;

GETOSUSER
-----------------------------------------
NT AUTHORITY\SYSTEM

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.