my tnsnames.ora file has 2 formats : db_cl = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = a55)(PORT = 1522)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = cl) ) )
dbcd = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = a66 )(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = cd) ) )
myx5= (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = v55)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = x5) ) )
i want to get the hostname of a specific service_name or sid. in some cases it is sid and in some cases it is service_name. what should i search with grep in order to get the hostname? In this example i want to get the string "host_name".
****UPDATE**** I ALSO NEED THE db_name2, if someone can help