SQL Query
col username format a10
col service_name format a20
col host_name format a30
col instance_name format a15
select s.username, s.service_name, i.INSTANCE_NAME, i.HOST_NAME
from gv$session s, gv$instance i
where i.INST_ID = s.INST_ID
and s.username = 'SCOTT'
and s.service_name = 'HASERVICE'
/
Note: You will need to replace the username / service name with your details.
Results
SQL> @users
USERNAME SERVICE_NAME INSTANCE_NAME HOST_NAME
---------- -------------------- --------------- ------------------------------
SCOTT HASERVICE orcl1 apemrac1.au.oracle.com
SCOTT HASERVICE orcl1 apemrac1.au.oracle.com
SCOTT HASERVICE orcl1 apemrac1.au.oracle.com
SCOTT HASERVICE orcl1 apemrac1.au.oracle.com
SCOTT HASERVICE orcl2 apemrac2.au.oracle.com
SCOTT HASERVICE orcl2 apemrac2.au.oracle.com
SCOTT HASERVICE orcl2 apemrac2.au.oracle.com
SCOTT HASERVICE orcl2 apemrac2.au.oracle.com
SCOTT HASERVICE orcl2 apemrac2.au.oracle.com
SCOTT HASERVICE orcl2 apemrac2.au.oracle.com
10 rows selected.
No comments:
Post a Comment