Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.12.11.255)(PORT = 1540)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = CSMFIRE03)))
I would like to extract the CSMFIRE03.
I have no clue which command to use. Could any of you in this forum reply with the solution.
Hi Naresh,
Might be not efficient but will giv you the solution
cat tns_names.txt |tr '(' '\n' |sed 's/)/ /g' | awk '/SERVICE_NAME/ { print $3}'
Hope for some other good answers 
Thank you panyam for the solution.
In the same way if i want to extract the IP address from that sentence how could i do that. Do you have any solution for this.
I am lil bit confused in using sed and awk . Do you have any suggestions for these which helps me in remembering them any link for the info abt them.
Thank You.
Naresh,
The solution remain almost same, only change is u need to search for the "HOST" instead of "SERVICE_NAME".
cat tns_names.txt |tr '(' '\n' |sed 's/)/ /g' | awk '/HOST/ { print $3}'
You can google and you will get so many good doc's and information related to awk and sed.
Regards
Sastry
To get the SERVICE_NAME:
sed -n 's/.*SERVICE_NAME = \(.*\))))/\1/p' file
For the IP address:
sed -n 's/.*HOST = \(.*\))(.*/\1/p' file
Thank You panyam and franklin..
I got it just now. I will google tr ,sed and then awk.
I executed the command in pieces and seen the output. I have understood 50 % of it.
Thank you once again. 