| ramesh |
Posted: Apr 11, 2008 01:57:13 AM |
Total Post: 40
Joined: Aug, 2007
|
Hi all,
To find out that which database is connecting to which server this query is correct or there is any other query please tell me....
select instance_name,hostname,status from v$instance;
select machine,terminal,sid,username,status from v$session;
Thanks in Advance.... |
|
|
Gitesh |
| Posted: Apr 11, 2008 03:11:00 AM | |
|
Total Post: 322
Joined: May, 2005
|
select (select name from v$database) "DATABASE",(SELECT UTL_INADDR.get_host_name FROM dual) "HOST NAME",(SELECT UTL_INADDR.get_host_address from dual) "IP Address" from dual;
|
|
|
|
|
Murtuja |
| Posted: Apr 11, 2008 03:18:30 AM | |
|
Total Post: 815
Joined: Jan, 2006
|
Hi,
Thanks Gitesh,
Can you please explain me why this query need to be executed ? where we can use this query in DBA activities ?
Regards,
Murtuja
|
|
|
|
|
Gitesh |
| Posted: Apr 11, 2008 05:21:40 AM | |
|
Total Post: 322
Joined: May, 2005
|
This query is needed to be executed when we have more than 1 databases with same name or in 1 server we have more than 1 databases.
Example: If you have a production database named flexcube. Now you have also 1 standby in local and 1 report database for same in local location. All databases are containing same name and same instance name. And you want get output from report database or want to apply some user patch on specify database that time you should identified with hostname or ip address that you are sitting and executing query/patch in right database.
|
|
|
|
|
Murtuja |
| Posted: Apr 11, 2008 06:04:51 AM | |
|
Total Post: 815
Joined: Jan, 2006
|
Thanks Gitesh for detailed answer.
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |