Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tools to work with stored procedures in Oracle, in a team?

What tools do you use to develop Oracle stored procedures, in a team :

  • To automatically "lock" the current procedure you are working with, so nobody else in the team can make changes to it until you are finished.
  • To automatically send the changes you make in the stored procedure, in an Oracle database, to a Subversion, CVS, ... repository

Thanks!

like image 575
Aurelio Martin Massoni Avatar asked Sep 21 '08 19:09

Aurelio Martin Massoni


People also ask

Does Oracle support stored procedures?

You can store PL/SQL procedures in the database, and call these stored procedures from Oracle applications.

What are stored procedures called in Oracle?

Stored procedures and functions (subprograms) can be compiled and stored in an Oracle Database XE, ready to be executed. Once compiled, it is a schema object known as a stored procedure or stored function, which can be referenced or called any number of times by multiple applications connected to Oracle Database XE.

How do you find where a stored procedure is being used in Oracle?

Answer: The dba_source view contains the details on Oracle stored procedures and it's easy to query dba_source to see stored procedure details.


2 Answers

I'm not sure if the original poster is still monitoring this, but I'll ask the question anyways.

The original post requested to be able to:

To automatically "lock" the current procedure you are working with, so nobody else in the team can make changes to it until you are finished.

Perhaps the problem here is one of development paradigm more than the inability of a product to "lock" the stored proc. Whenever I hear "I want to lock this so noone else changes it" I immediately get the feeling that people are sharing a schema and everyone is developing in the same space.

If this is the case, why not simply let everyone have their own schema with a copy of the data model? I mean seriously folks, it doesn't "cost" anything to create another schema. That way, each developer can make changes until they're blue in the face without affecting anyone else.

Another trick I've used in the past (on small teams) when it wasn't feasible to let every developer have their own copy of the data because of size, was to have a master schema with all the tables and code in it, with public synonyms pointing to it all. Then, if the developer wants to work on a stored proc, he simply creates it in his schema. That way Oracle name resolution finds that one first instead of the copy in the master schema, allowing them to test their code without affecting anyone else. This does have it's drawbacks, but this was a very specific case where we could live with them. I would NEVER implement something like this in production obviously.

As for the second requirement:

To automatically send the changes you make in the stored procedure, in an Oracle database, to a Subversion, CVS, ... repository

I'd be surprised to find tools out there smart enough to do this (perhaps an opportunity :). It would have to connect to your db, query the data dictionary (USER_SOURCE) and pull out the associated text. A tall order for source control systems where are almost universally file based.

like image 169
Dwayne King Avatar answered Sep 20 '22 21:09

Dwayne King


Oracle's new SQL Developer has version control built-in.

Here is a link to the product.

http://www.oracle.com/technology/products/database/sql_developer/files/what_is_sqldev.html

http://www.oracle.com/technology/products/database/sql_developer/images/what_version.png http://www.oracle.com/technology/products/database/sql_developer/images/what_version.png

like image 38
Jason Stevenson Avatar answered Sep 23 '22 21:09

Jason Stevenson