title: regex on tnsnames.ora
body: <p>my tnsnames.ora file has 2 formats :
  db_cl =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = a55)(PORT = 1522))
      (CONNECT_DATA =
        (SERVER = DEDICATED)
        (SERVICE_NAME = cl)
      )
    )</p>
  
  <p>dbcd =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = a66 )(PORT = 1521))
      (CONNECT_DATA =
        (SERVER = DEDICATED)
        (SERVICE_NAME = cd)
      )
    )</p>
  
  <p>myx5=
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = v55)(PORT = 1521))
      (CONNECT_DATA =
        (SERVER = DEDICATED)
        (SERVICE_NAME = x5)
      )
    )</p>
  
  <p>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".</p>
  
  <p>****UPDATE****
  I ALSO NEED THE db_name2, if someone can help</p>