Thursday, May 31, 2012

Get the SID, Host name and the IP adress in Oracle 10g


If you want to get the SID name of your current session, use this query:
select instance_name from v$instance; 
And in order to get the IP and the host name, execute this script:

SET serveroutput onBEGINDBMS_OUTPUT.PUT_LINE(UTL_INADDR.GET_HOST_NAME);DBMS_OUTPUT.PUT_LINE(UTL_INADDR.GET_HOST_ADDRESS); END;/