Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: shell script for dynamically building init.ora file

Re: shell script for dynamically building init.ora file

From: Maxim Demenko <mdemenko_at_arcor.de>
Date: Wed, 24 Aug 2005 16:39:09 +0200
Message-ID: <430c87c1$0$24163$9b4e6d93@newsread4.arcor-online.net>


nirav schrieb:
> Experts ,
>
> I am working on a need to clone databases..and in that I need to write
> a shell script which will 'dynamically generate' the init.ora file for
> target database using that of source database and a temp file which
> will hold changed value of parameters.
> For example in temp file there is a param like:
> db_name =targetdb
>
> and in source init.ora file db_name=db1 then the shell script should
> read the temp file and be able to create a new init.ora file with
> changed value
> ie db_name=targetdb (so all other parameters that are not specified in
> temp file will remain same, but all specified parameters will be
> changed.)
>
> Can you suggest some similar scripts for such work? Any help, I am very
> thankful..
>
> Regs
> Nirav
>

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 Received on Wed Aug 24 2005 - 09:39:09 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US