instant database - from script
Posted in 2004
Topics: Server Administration
hello all! i have a request from developers for a script that would "instantly" create a database, such as copying production to development, that they could run on their own. i have the "manual" sql i use to do this but can someone provide some feedback on how i would turn this into a complete batch-type script that they could fire off (or that i could fire off and review any errors). mostly it is the mechanics needed of how to do this... thanks, Tom
tomL wrote:
> i have a request from developers for a script that would "instantly"
> create a database, such as copying production to development, that
> they could run on their own. i have the "manual" sql i use to do this
> but can someone provide some feedback on how i would turn this into a
> complete batch-type script that they could fire off (or that i could
> fire off and review any errors). mostly it is the mechanics needed of
> how to do this...
Depending on whether the database lock it uses is acceptable or not,
the simplest answer is to dbexport the original database and dbimport
it - possibly afer renaming it. If you only need the schema and not
the data, then dbschema and dbaccess will do the trick. You could
also consider onunload and onload. Art Kagel has a program, myschema,
which does a pretty good job of schema replication - and myexport and
myimport, which are scripts that use myschema and sqlcmd. All that's
available from the IIUG software archive.
--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/