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

后端 未结 9 742
梦毁少年i
梦毁少年i 2020-12-31 09:18

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
9条回答
  •  萌比男神i
    2020-12-31 09:38

    After searching for a tool to handle version control for Oracle objects with no luck we created the following (not perfect but suitable) solution:

    1. Using dbms_metadata package we create the metadata dump of our Oracle server. We create one file per object, hence the result is not one huge file but a bunch of files. For recognizing deleted object we delete all the files before creating the dump again.
    2. We copy all the files from the server to the client computer.
    3. Using Netbeans we recognize the changes, and commit the changes to the CVS server (or check the diffs...). Any CVS-handler software would work here, but we were already using Netbeans for other purposes. And Netbeans also allows to create an ant task for calling the Oracle process mentioned in step 1, copying the files mention in step 2...

    Here is the most imporant query for step 1:

    SELECT object_type, object_name, 
      dbms_metadata.get_ddl(object_type, object_name) object_ddl FROM user_objects
    WHERE OBJECT_TYPE in ('INDEX', 'TRIGGER', 'TABLE', 'VIEW', 'PACKAGE', 
      'FUNCTION', 'PROCEDURE', 'SYNONYM', 'TYPE')  
    ORDER BY OBJECT_TYPE, OBJECT_NAME
    

    One file per object approach helps to identify the changes. If I add a field to table TTTT (not a real table name of course) then only TABLE_TTTT.SQL file will be modified.

    Both step 1 and step 3 are slow processes. (several minutes for a few thousand of files)

提交回复
热议问题