gavenkoa
gavenkoa

Reputation: 48893

A way to deploy plsql to Oracle in Java project with Maven build tool

I join to project where plsql sources developed and stored in Oracle DB.

There are two copies of sources - on test and on production servers. So SPOT (single point of trust) rule was broken. Copies require synchronisation from time to time and this job is performed manually.

But most annoying thing come from configuration management - I can't reproduce previous working project copy because old plsql scripts was lost (new version have changes in API).

After studying subject I found awesome project: https://code.google.com/p/plsqlmaven

By following https://code.google.com/p/plsqlmaven/wiki/Basics I can dump all plsql scrips (and diff between production and testing) from DB'es:

  $ mvn plsql:extract -Dforce

but I stuck with plsql:deploy command (it print error about missing jars, I don't understand how to create it). I will contact to author soon and will fill some bug reports.

But I hope that community already solve such basic task for project vitality.

How can I deploy plsql scripts to Oracle DB in Java project (my project uses Maven build system)?

PS I look to SQL Developer tutorials on oracle.com - I can't find how to deploy entirely plsql files hierarchy by one button click. And I prefer command line solution...

PPS I report related errors to plsqlmaven project:

PPPS I ask question at http://rsdn.ru/forum/java/5011849.flat (Russian)

Upvotes: 3

Views: 4261

Answers (4)

aaaristo
aaaristo

Reputation: 2169

You should use plsql:compile not plsql:deploy:

mvn -Pyourdbprofile plsql:compile

ps: Take a look at par if you need a way to deploy an archive.

Upvotes: 1

aldrinleal
aldrinleal

Reputation: 3619

This is one of the situations I'd love to use flyway, as it lets you manage version and scripts.

It is also handy when testing, as it lets you seed the database into a given state.

Upvotes: 4

gavenkoa
gavenkoa

Reputation: 48893

I don't make deep look to:

but seems these projects provide not only solution for my problem but more complex solution for another related problems.

Both have Maven integration and Open Source.

Upvotes: 1

Andrey Nudko
Andrey Nudko

Reputation: 707

How about old good SQL Plus? Create master script that will call others as required, and pass it from command line to sqlplus (you'll need Oracle client installed on machine though). jisql is a command-line java sql tool - but don't think it has an option of calling sub-scripts. Running commands from maven is fairly easy with exec plugin.

Upvotes: 2

Related Questions