title: Fetching connection data from tnsnames.ora via awk
body: <p>I try to build automation procedure which base on connection data from tnsnames.ora which is oracle connection base for database.</p>
  
  <p>Typical TNS build looks like this but there is much more connections than 1:</p>
  
  <pre><code>" 
  
  MY_BASE= 
    (DESCRIPTION= 
      (ADDRESS= 
        (PROTOCOL=TCP) 
        (HOST=10.20.30.40) 
        (PORT=1234) 
      ) 
      (CONNECT_DATA= 
        (SERVER=dedicated) 
        (SERVICE_NAME=MY_SERVICE) 
      ) 
    ) 
  
  "
  </code></pre>
  
  <p>I need to extract  base connection data which would be:
  BASE_NAME  HOST  PORT  SERVICE_NAME
  more or less would look like</p>
  
  <pre><code>MY_BASE 10.20.30.40 1234 MY_SERVICE
  </code></pre>
  
  <p>Some of connections got more than one service but I will not bother you with these cause I have no idea how to make it as variable at the end :P </p>
  
  <p>My point is to make a list in jenkins automation and make it to return list of connections in a checkbox. Than I and make variables out of those connection data so I will be able to do the same thing on many databases at the same time.</p>
  
  <p>More or less...</p>
  
  <p>Any idea?
  What to read, what to find, what to learn from AWK(cause it is a BIG tool). </p>
  
  <p>Best regards! </p>