Ant task for database script

B

Bhavin

Hello,

Has anybody worked on ant script for executing the database scripts. I
am working on build process and in which the sql command is working
fine for simple packages and stored procs. I am working on
interdependency of packages. My ant script fetches the database scripts
checked in visual source safe for oracle 9i. At the runtime i have to
check the interdependency. The dependency of package related stored
proc is described below.

There are two packages in oracle - A & B
Few Stored Procs in Package A are dependent / calling Stored Procs in
Package B and vise a versa, in this case the precedence of Package
needs to be set.

This senario comes in when getting scripts from VSS. Ant runs all the
files one by one thus unpredictable that when Package A will be
executed and when Package B will be executed.

Any input / suggestion to this senario will be greatly appreciated.
 
A

Andy Dingley

Bhavin said:
Has anybody worked on ant script for executing the database scripts.

I'm experimenting with it. Mainly to manage remote upgrades of
customers, to apply a bunch of individual bug fixes to them.

Fixes are stored in Subversion, which I query with Python to make an
RDF/XML document. This is then transformed by XSLT into an Ant script.
Each script maps to an Ant target.

I get two benefits from Ant:
- It's a competent SQL client that uses JDBC to connect to the DB. Our
main app is in Java / JDBC, so we can already assuem this is available.
We've had a lot of past trouble with varying behaviours under different
interactive SQL client tools.

- Ant does dependency management. If I annotate a patch script in
Subversion (I store Dublin Core on them as SVN properties) then I can
extract this into my RDF/XML document, then pass the dependency through
to Ant. Ant does the rest.

Ant also lets me use a "dry run" property to list the script names out
in sequence, without actually running them
 
W

Wibble

Bhavin said:
Hello,

Has anybody worked on ant script for executing the database scripts. I
am working on build process and in which the sql command is working
fine for simple packages and stored procs. I am working on
interdependency of packages. My ant script fetches the database scripts
checked in visual source safe for oracle 9i. At the runtime i have to
check the interdependency. The dependency of package related stored
proc is described below.

There are two packages in oracle - A & B
Few Stored Procs in Package A are dependent / calling Stored Procs in
Package B and vise a versa, in this case the precedence of Package
needs to be set.

This senario comes in when getting scripts from VSS. Ant runs all the
files one by one thus unpredictable that when Package A will be
executed and when Package B will be executed.

Any input / suggestion to this senario will be greatly appreciated.
It sounds like your package relationships are a bit of a mess.

It doesn't really matter which order you load them. You can
have a target 'loadDatabase' depends on
'loadPackage1,loadPackage2,compilePackages'
where compile packages does something like

http://www.oracle-base.com/articles/misc/RecompilingInvalidSchemaObjects.php

The order in which you load your packages then becomes irrelevant.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top