sed allows alternative separators for precisely this reason.
Code:
sed -e "s%${ORACLE_SID}:${ORACLE_HOME}%${ORACLE_SID}:${NEW_HOME}%g
It's "turtles all the way down" if you can't find a character which is guaranteed not to be in the replacement strings, though.
I have been known to write
sed scripts which write
sed scripts with all the special characters in the input backslashed, but there are obviously more elegant solutions. (
Perl comes to mind, and should be easy to get started with if you know
sed.)