Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2003
    Posts
    18

    Unanswered: adding to source coutrol

    Hi,

    I am in the process of moving all my stored procedures, views, table scripts etc into source control. Is there any way where I could generate the scripts for all the objects from the Oracle database. I am using Oracle 9i. Any help would be highly appreciated. Thanks in advance.

    Hari

  2. #2
    Join Date
    Mar 2002
    Location
    Reading, UK
    Posts
    1,137
    Have a look at dbms_metadata as this can generate DDL for any object including stored procs. You could probably write a small java stored proc to get the ddl and then do an OS call to your source control system to store it.

    Alan

  3. #3
    Join Date
    Jun 2003
    Posts
    18
    Hi Alan.

    I looked into this. But this seems to be using XML or XSLT for output. Is there any way to output to a normal ascii file. Thanks in advance.

    Hari

    Originally posted by AlanP
    Have a look at dbms_metadata as this can generate DDL for any object including stored procs. You could probably write a small java stored proc to get the ddl and then do an OS call to your source control system to store it.

    Alan

  4. #4
    Join Date
    Jun 2003
    Posts
    18
    Hi Alan,

    Your suggestion is awesome. Thanks a lot for the same. I have managed to write a PL/SQL script to extract all the functions for now. The script that it generates has the object name in the form of "SCHEMA NAME"."OBJECT NAME". As such when I try to compile this , it gives me a diagnostic error message saying, "SCHEMA NAME" not found in ALL_OBJECTS. Not sure why this is happening. Also is there any to generate the ddl with only the object name with the schema name prefix.Any help would be highly appreciated.

    Thanks,
    Hari

    Originally posted by AlanP
    Have a look at dbms_metadata as this can generate DDL for any object including stored procs. You could probably write a small java stored proc to get the ddl and then do an OS call to your source control system to store it.

    Alan

  5. #5
    Join Date
    Jul 2003
    Location
    US
    Posts
    314

    Formatter Plus

    I saw this tool called Formatter Plus which come in Handy for you.
    The only thing here .. for the first time you would have to export everything manually into the application, and then you would be fine.

  6. #6
    Join Date
    Mar 2002
    Location
    Reading, UK
    Posts
    1,137
    Try creating the user on your target database. Dont forget a schema = user so if you dont have user X it cant create X.table. You can get the package to write the DDL to create users aswell : ).

    Alan

  7. #7
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool

    You can also generate the schema script with TOAD from www.quest.com. There is a trial version you can use.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •