tags:

views:

21

answers:

1

It's possible to use Microsoft's OracleClient assembly to connect to an Oracle database, and using Oracle's connection string format, set it up to use load balancing, provided your Oracle environment supports it.

The question I have is how do you know after the fact, which db host the command actually executed against? Is there a way to retrieve the machine name from the load balanced set of machines?

+1  A: 

Either of these queries will return the instance name:

select instance from v$thread;

-or-

select instance_name from v$instance;
dpbradley
Not sure I follow. Does that mean that the instance name is pre-determined after the connection is made and prior to the command executing? I was under the impression that each execution of a command would result in a potential change in instance?
Leeks and Leaks
I guess this depends on whether your code opens a new connection with each query. If you have any doubt, you could always join the v$thread view into your application query to return the value as part of that query.
dpbradley