Replacing old TNS entries with New one in multiple files

I have requirement to replace old TNS entries with New one in multiple files.
one file may contain more then one occurrence of tns.

Example: Below is the one of occurrence in a current file(s). i am interested to replace only red part.

<connection-pool name="Google_APP_CP" inactivity-timeout="20" initial-limit="10" max-connections="40" min-connections="10" validate-connection="true">
      <connection-factory factory-class="oracle.jdbc.pool.OracleDataSource" user="APP1" password="oracle_app#@%$" url="jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=apap1-vip.mydomain.com)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=apap2-vip.mydomain.com)(PORT=1521))(LOAD_BALANCE=yes)(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=SID.mydomain.com)(FAILOVER_MODE=(TYPE=SELECT)(METHOD=BASIC)(RETRIES=180)(DELAY=5))))" commit-record-table-name=""/>
   </connection-pool>

After replace, It should be like below:

<connection-pool name="Test_APP_CP" inactivity-timeout="20" initial-limit="10" max-connections="40" min-connections="10" validate-connection="true">
      <connection-factory factory-class="oracle.jdbc.pool.OracleDataSource" user="APP1" password="oracle_app#@%$" url="jdbc:oracle:thin:@(DESCRIPTION =(ADDRESS=(PROTOCOL=TCP)(HOST=mydomain-scan)(PORT=1621))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=NEWSID.mydomain.com)))" commit-record-table-name=""/>
   </connection-pool>

There should not be any change other then this replace, otherwise application will not read the file. (even 1 extra space is not tolerable )

You can do that with sed and its s (substitute) command.
For example the following provides a good match:

sed 's/\(url="jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)\).*\())"\)/\1new text\2/' file

The delimiter / must not occur in the strings (otherwise another character can be taken).
Two parts of the search expression are in \( \) and can be put back by \1 and \2 .
The .* (everything) in between is replaced by the new text .

Can you please make search and replace for me.

This is not working...anyone can suggest some other solution.

What is not working? Please describe what happened.