| How to get the connect string from the data base [message #633975] |
Mon, 02 March 2015 03:25  |
 |
saipradyumn
Messages: 419 Registered: October 2011 Location: Hyderabad
|
Senior Member |
|
|
Hi All ,
I need to get the connect string from the data base which is already connected.
Is there any way to get the Connect string from the data base.
The following query gives the information about the user , insane name
select instance_name , user from v$instance;
Thanks
SaiPradyumn
|
|
|
|
| Re: How to get the connect string from the data base [message #633977 is a reply to message #633975] |
Mon, 02 March 2015 03:40   |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
saipradyumn wrote on Mon, 02 March 2015 14:55
select instance_name , user from v$instance;
So what's the problem?
SQL> show user
USER is "LALIT"
SQL> show parameter instance_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
instance_name string orcl
SQL>
SQL> select user, instance_name from v$instance;
USER INSTANCE_NAME
------------------------------ ----------------
LALIT orcl
SQL>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Re: How to get the connect string from the data base [message #633993 is a reply to message #633975] |
Mon, 02 March 2015 07:06   |
 |
EdStevens
Messages: 1377 Registered: September 2013
|
Senior Member |
|
|
As others have said, there is no way to know this from the database. When a client provides a 'connect string', that string is ultimately translated to an IP address, port number, and service name. This translation is done on the client side of the connection, and it is that information (ip, port, service) that is is used in routing the request to the server.
Suppose I could give you some magic, secret query that would produce the information you ask for. What would you do differently from what you are doing today? In other words, why is it deemed important to know the connect string that was used? That's like wanting to know what kind of telephone someone is using when they call you.
|
|
|
|
|
|