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: How to call scripts from another scripts ?

Re: How to call scripts from another scripts ?

From: <krislioe_at_gmail.com>
Date: 15 Mar 2007 18:16:52 -0700
Message-ID: <1174007812.334627.184720@l77g2000hsb.googlegroups.com>


On Mar 15, 4:17 pm, Jim Smith <usene..._at_ponder-stibbons.com> wrote:
> In message <1173943177.561304.324..._at_y80g2000hsf.googlegroups.com>,
> krisl..._at_gmail.com writes
>
>
>
>
>
> >Hi all,
>
> >During development, we make database structure/constraint
> >modifications into sql file (scripts). So I will have some single
> >script files, e.g : script1.sql, script2.sql, script3.sql etc.
>
> >Then I create a mainscript.sql to call all the scripts. So I need only
> >to execute @mainscript.sql, which in turn execute script1.sql,
> >script2.sql, script3.sql.
>
> >mainscript.sql :
> >@script1.sql;
> >@script2.sql;
> >@script3.sql;
> >commit;
>
> >The question is :
> >How can I rollback if one of the script fails ?
>
> >Thank you for your help,
> >xtanto
>
> Tricky. You seem to be talking about DDL and DDL cannot be rolled back.
>
> In development the best approach is probably to have a baseline dump
> file (or a baseline script if there is no data involved). At each
> iteration, drop all objects, load the baseline and then the modification
> scripts. If a mod fails, reload the baseline.
>
> For live deployment you would need to backup the database and recover to
> a point in time if the upgrade fails. This is easier with 10g where you
> can use flashback database.
>
> How feasible this is will depend on your service level requirements etc.
> --
> Jim Smith
> Ponder Stibbons Limited <http://oracleandting.blogspot.com/>
> RSS <http://oracleandting.blogspot.com/atom.xml>- Hide quoted text -
>
> - Show quoted text -

Hi,
Thank you for your reply..

Since the DDL cannot be rolled back. Another approach is : How can I capture all error into one file (created when error occurs) so that I can see all error in one file and fix it ?

Thank you,
xtanto Received on Thu Mar 15 2007 - 20:16:52 CDT

Original text of this message

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