Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: shell script for dynamically building init.ora file
Maxim Demenko schrieb:
> nirav schrieb: >
> > There are many ways to code it ( most flexible would be that with awk or > perl ), but to achieve simple merging of two files based on a key column > you can use join command. > > # Put all key/values from initSRC.ora which are > # not specified in temp file > # into target configuration > join initSRC.ora initTMP.ora -t "=" -v1 > initTGT.ora > # Put all key/values from temp file based on matched key pairs > # into target configuration > join initSRC.ora initTMP.ora -t "=" -o "0 2.2" >> init.TGT.ora > > Additionally you possibly would like to sort the contents of your files... > Best regards > > Maxim
That will provide wrong results if in the temp file are values containing "=" ( key/value separator in init.ora ). To get the correct results simply put the contents of temp file instead of second join: join initSRC.ora initTMP.ora -t "=" -v1 > initTGT.ora cat initTMP.ora >> init.TGT.ora
It can even be combined into oneliner:
join initSRC.ora initTMP.ora -t "=" -v1|cat initTMP.ora -> initTGT.ora
Best regards
Maxim Received on Wed Aug 24 2005 - 11:19:30 CDT
![]() |
![]() |