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 )