Home » SQL & PL/SQL » SQL & PL/SQL » Trigger (Oracle 10.2 on Window Server 2003)
icon14.gif  Trigger [message #341011] Fri, 15 August 2008 09:07 Go to next message
youngb912
Messages: 49
Registered: October 2007
Location: New York
Karma: 0
Member
Good morning,

Can you tell me how to check what the OSUSER name is when a trigger is fired?

Thanks
Re: Trigger [message #341015 is a reply to message #341011] Fri, 15 August 2008 09:19 Go to previous messageGo to next message
ThomasG
Messages: 3202
Registered: April 2005
Location: Heilbronn, Germany
Karma: 0
Senior Member
That should be in the sys_context

sys_context('USERENV', 'OS_USER')
Re: Trigger [message #341018 is a reply to message #341015] Fri, 15 August 2008 09:27 Go to previous messageGo to next message
youngb912
Messages: 49
Registered: October 2007
Location: New York
Karma: 0
Member
Thanks for the response. I perform the below query and got this response - I was login to the OS as oracle8

SQL> SELECT SYS_CONTEXT('USERENV','OS_USER') os_user from DUAL;

OS_USER
---------
oracle8

The same query and this time I was login as oracle10 -

SQL> SELECT SYS_CONTEXT('USERENV','OS_USER') os_user from DUAL;

OS_USER
-----------
oracle10

It seems the query is showing me the current OS user.

I was ask by the manager -
"Can you tell me what the OSUSER name is when a trigger is fired? In UNIX it was DAEMON, what it is for Windows?"

We have just migrated from Window to Unix. How do I respond to this question? This is a stream environment.

Thanks

[Updated on: Fri, 15 August 2008 09:28]

Report message to a moderator

Re: Trigger [message #341027 is a reply to message #341018] Fri, 15 August 2008 10:09 Go to previous message
ThomasG
Messages: 3202
Registered: April 2005
Location: Heilbronn, Germany
Karma: 0
Senior Member
Huh?

That question makes no sense.

The OS user is whoever is logged into the OS that runs the SQL*Plus session that is responsible for firing the trigger.

So it's either the user with a real flesh and blood user behind him that works with the application, or perhaps some user that is created to run batch jobs under from Cron (Unix) or from Scheduled Tasks (Windows)

I'm not aware of any UNIX application that runs with a username of "DAEMON".

However the things that are called "DAEMONS" in UNIX are called "Services" in Windows, if that's what your manager is after.



Previous Topic: How to find High impact sql query in terms of CPU utilization
Next Topic: can some explain me in detailed how the below query works
Goto Forum:
  


Current Time: Tue Aug 22 10:06:03 CDT 2017

Total time taken to generate the page: 0.05329 seconds