Home » Infrastructure » Linux » Finding the Node (10.2.0.2 linux x86_64 bit)
Finding the Node [message #279598] Fri, 09 November 2007 05:09 Go to next message
colesg
Messages: 11
Registered: October 2007
Location: London
Junior Member

Hi

I have a SP which runs UNIX commands and UNIX scripts. Our OS has 2 nodes on it. What I want to do for logging is find out what node oracle is using at the time of executing the SP.

I have tried to use sys_context but cannot find anything in there that gives the node. I have tried HOST and SERVER_HOST but neither of these give the node.

Can anyone point me in the right direction please.

Cheers
Gary
Re: Finding the Node [message #279603 is a reply to message #279598] Fri, 09 November 2007 06:07 Go to previous messageGo to next message
Michel Cadot
Messages: 58934
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
What do these give you if not your server?

Regards
Michel
Re: Finding the Node [message #279607 is a reply to message #279598] Fri, 09 November 2007 06:23 Go to previous messageGo to next message
colesg
Messages: 11
Registered: October 2007
Location: London
Junior Member

Hi

HOST gives me my laptop reference.

SERVER_HOST gives me the server name DEVORA.

What I want is either DEVORA1 or DEVORA2 depending on the node the process is running on.

Not sure if this is possible when running code from my machine.

I will test the process though dbms_scheduler to see if tthat gives me the node, as this is how it will run in production.


select sys_context('userenv', 'HOST') as host
, sys_context('userenv', 'NETWORK_PROTOCOL') as network
, sys_context('userenv', 'SERVER_HOST') as server
, sys_context('userenv', 'SERVICE_NAME') as service
from dual;

HOST
-------------
NETWORK
-------------
SERVER
-------------
SERVICE
-------------
IB\LAPTOP86
tcp
devora
DBIDB


Cheers
Gary
Re: Finding the Node [message #279612 is a reply to message #279607] Fri, 09 November 2007 06:38 Go to previous messageGo to next message
Michel Cadot
Messages: 58934
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
What does "hostname" give?
What does "select distinct machine from gv$session where type='BACKGROUND'" give?

Regards
Michel
Re: Finding the Node [message #279616 is a reply to message #279598] Fri, 09 November 2007 07:00 Go to previous messageGo to next message
colesg
Messages: 11
Registered: October 2007
Location: London
Junior Member

Michel

Thanks for that but neither give me what I want, especially as I need the node the current user has connected to.

I have tried the SP running through dbms_scheduler and the HOST command gives me the node that it has connected to correctly, so I have acheived my goal.

Thanks for looking anyway.

Cheers
Gary
Re: Finding the Node [message #279646 is a reply to message #279616] Fri, 09 November 2007 08:55 Go to previous message
Michel Cadot
Messages: 58934
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:

Thanks for that but neither give me what I want

This shows that you can't get it just because the OS does not give it.
Do you know a command (anyone not Oracle one) that returns what you want?

Regards
Michel
Previous Topic: Oracle instalaltion error on SUSE 9
Next Topic: man problem
Goto Forum:
  


Current Time: Fri Aug 29 07:09:04 CDT 2014

Total time taken to generate the page: 0.21206 seconds