Oracle Certification, Database Administration, SQL, Application, Programming Reference Books
Shell Script To Dynamically Generate Init.ora File

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?

--------------------------------------------/

Try something this:
CODE
set pages 0 term off feed off trims on lin 132 ver off
def fdb='FromDB'
def tdb='ToDB'
spo /tmp/init&&tdb.ora
Select NAME||'='||replace(VALUE,'&&fdb','&&tdb')
 From DBA_PARAMETERS;
spo off

Quick Links:
Do you have an Oracle Question?

Best regards,
Oracle Database, SQL, Application, Programming Tips

All the site contents are Copyright © www.sap-img.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.
The site www.sap-img.com is not affiliated with or endorsed by any company listed at this site.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
 The content on this site may not be reproduced or redistributed without the express written permission of
www.sap-img.com or the content authors.