Get Window User Name and MAC address after insert in RFQ table in oracle application Transaction (merged) [message #674789] |
Sun, 17 February 2019 23:40 |
ashokb21
Messages: 92 Registered: May 2010
|
Member |
|
|
Hi Team,
Need help.
Query:-
I want to capture the Window's USer name and MAC adress of the machine used to any transaction.
when i am running below script on TOAD is shows proper data but when i using this script in trigger on INSERT of table from Oracle application, is show Application server User name and IP address details.
select to_char(sysdate, 'mm-dd-yyyy HH:MI:SSam') asondate,
sys_context('userenv','OS_USER') OS_USER,
userenv('TERMINAL') UNique_machine_name ,
SYS_CONTEXT('USERENV','IP_ADDRESS') IP
from dual;
Please help.
|
|
|
|
|
|
Re: Get Window User Name and MAC address after insert in RFQ table in oracle application Transaction [message #674815 is a reply to message #674789] |
Mon, 18 February 2019 08:41 |
|
BlackSwan
Messages: 26766 Registered: January 2009 Location: SoCal
|
Senior Member |
|
|
ashokb21 wrote on Sun, 17 February 2019 21:40Hi Team,
Need help.
Query:-
I want to capture the Window's USer name and MAC adress of the machine used to any transaction.
when i am running below script on TOAD is shows proper data but when i using this script in trigger on INSERT of table from Oracle application, is show Application server User name and IP address details.
select to_char(sysdate, 'mm-dd-yyyy HH:MI:SSam') asondate,
sys_context('userenv','OS_USER') OS_USER,
userenv('TERMINAL') UNique_machine_name ,
SYS_CONTEXT('USERENV','IP_ADDRESS') IP
from dual;
Please help.
In a 3-tier application, code running on the DB Server is far removed from end user.
EndUser<=>browser<=>webserver<=>ApplicationServer<=>DatabaseServer
The Webserver must be programmed to provide Browser details to Application Server.
Then Application server needs to be programmed to pass the End User details on to the DB Server.
Nothing happens automagically, with explicit coding.
|
|
|
|
|
|
|
|
|
Re: Get Window User Name and MAC address after insert in RFQ table in oracle application Transaction [message #674891 is a reply to message #674890] |
Thu, 21 February 2019 03:20 |
cookiemonster
Messages: 13938 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Yes - that's expected behaviour.
You're getting the machine that's running the program that is logged onto the DB.
TOAD is logged onto the DB.
The oracle application running on the application server is logged onto the DB.
To get the details of the machines connected to the application server the application server code would need to get this data and pass it to the DB.
It isn't.
You can try asking in a forum for the application in question if there is any way to get the data you need, but if it's an Oracle Application (ie not one you wrote yourself) then I suspect you are out of luck.
|
|
|
Re: Get Window User Name and MAC address after insert in RFQ table in oracle application Transaction [message #674892 is a reply to message #674891] |
Thu, 21 February 2019 03:57 |
ashokb21
Messages: 92 Registered: May 2010
|
Member |
|
|
cookiemonster wrote on Thu, 21 February 2019 03:20Yes - that's expected behaviour.
You're getting the machine that's running the program that is logged onto the DB.
TOAD is logged onto the DB.
The oracle application running on the application server is logged onto the DB.
To get the details of the machines connected to the application server the application server code would need to get this data and pass it to the DB.
It isn't.
You can try asking in a forum for the application in question if there is any way to get the data you need, but if it's an Oracle Application (ie not one you wrote yourself) then I suspect you are out of luck.
Ok I will close this and raise another SR on Application.
|
|
|
I want to capture the Window's USer name and MAC adress of the machine used to any transaction. [message #674893 is a reply to message #674789] |
Thu, 21 February 2019 04:00 |
ashokb21
Messages: 92 Registered: May 2010
|
Member |
|
|
Hi Team,
Need help.
Query:-
I want to capture the Window's USer name and MAC adress of the machine used to any transaction.
when i am running below script on TOAD is shows proper data but when i using this script in trigger on INSERT of table from Oracle application, is show Application server User name and IP address details.
Quote:
select to_char(sysdate, 'mm-dd-yyyy HH:MI:SSam') asondate,
sys_context('userenv','OS_USER') OS_USER,
userenv('TERMINAL') UNique_machine_name ,
SYS_CONTEXT('USERENV','IP_ADDRESS') IP
from dual;
|
|
|
|
|
Re: Get Window User Name and MAC address after insert in RFQ table in oracle application Transaction (merged) [message #674915 is a reply to message #674789] |
Thu, 21 February 2019 13:01 |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
ashokb21 wrote on Mon, 18 February 2019 00:40
when i am running below script on TOAD is shows proper data but when i using this script in trigger on INSERT of table from Oracle application, is show Application server User name and IP address details.
select to_char(sysdate, 'mm-dd-yyyy HH:MI:SSam') asondate,
sys_context('userenv','OS_USER') OS_USER,
userenv('TERMINAL') UNique_machine_name ,
SYS_CONTEXT('USERENV','IP_ADDRESS') IP
from dual;
I don't believe you on this one. If it is a trigger on the table, then it will show info from the database, not the application server. Triggers run deep inside the database.
Additionally, surely userenv('terminal') is not going to give you back a unique machine name.
|
|
|
|
Re: Get Window User Name and MAC address after insert in RFQ table in oracle application Transaction (merged) [message #674922 is a reply to message #674915] |
Fri, 22 February 2019 03:07 |
cookiemonster
Messages: 13938 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
joy_division wrote on Thu, 21 February 2019 19:01ashokb21 wrote on Mon, 18 February 2019 00:40
when i am running below script on TOAD is shows proper data but when i using this script in trigger on INSERT of table from Oracle application, is show Application server User name and IP address details.
select to_char(sysdate, 'mm-dd-yyyy HH:MI:SSam') asondate,
sys_context('userenv','OS_USER') OS_USER,
userenv('TERMINAL') UNique_machine_name ,
SYS_CONTEXT('USERENV','IP_ADDRESS') IP
from dual;
I don't believe you on this one. If it is a trigger on the table, then it will show info from the database, not the application server. Triggers run deep inside the database.
Additionally, surely userenv('terminal') is not going to give you back a unique machine name.
Don't know why you don't believe him - those contexts give the details of the program that connected to the DB for the current session. That's what they are supposed to do. You can see the same data in v$session and terminal and os_user isn't the same for all rows there (and if it was then you would have ask why the columns were included in that view in the first place).
If you're connected with SQLPlus or a GUI then it'll give the details of the machine running that program. If you're connected via a web-app running on an app server it'll give details of the app server.
|
|
|
|