Hello All,
I am pulling my already rapidly disappearing hair out on this one.
I am working on an Oracle database clone script. As part of that I have to temporarily edit the tnsnames.ora file.
It has a structure like this:
In a tnsnames.ora file there are usually several entries like this so I must
1) find the correct entry
2) Navigate to the
line
3) insert a new line
4) on the new line add the following
5) save the file
6) move on to the next step
Can anyone point me to some sample code on how to do this in a bash script?
THANK YOU!!!!!
I am pulling my already rapidly disappearing hair out on this one.
I am working on an Oracle database clone script. As part of that I have to temporarily edit the tnsnames.ora file.
It has a structure like this:
Code:
DBNAME= (DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=db.acme.com)(PORT=1521)) (CONNECT_DATA= (SERVICE_NAME=ORCL) (INSTANCE_NAME=ORCL1) ) )
1) find the correct entry
2) Navigate to the
Code:
(CONNECT_DATA=)
3) insert a new line
4) on the new line add the following
Code:
(UR=A)
6) move on to the next step
Can anyone point me to some sample code on how to do this in a bash script?
THANK YOU!!!!!
Comment