Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oracle SQL Developer export sources for version control

We have big database with a lot of stuff and I want to use version control (Git) to manage changes. There are a lot of articles how to do it step by step but one piece is missing for me. Is there standard or recommended way for file structure of whole database (data excluded) and how it can be obtained from existing database?

It is a lot of sources, procedures, functions, packages, etc. Version control articles show how to manage few files from version control perspective. But they suggest that each file should be selected and saved to file system separately.

Is there way to export/import all stuff to maybe some preorganized structure? Good IDEs have such structures defined by languages or products. But it looks for me that SQL Developer doesn't have one. It also looks for me that SQL Developer may have only one repository. No concept of projects which can combine or unite different databases in separate units.

Should I invent my whole structure and use something like

**project/Abc/DB1/Packages/packzgeXyz/source1.sql**

for each source? Sure I can do this but I worry that may miss something. Any advise?

like image 678
Alex Avatar asked Mar 06 '23 07:03

Alex


1 Answers

Yes, SQL Developer can unload a schema to files for you. And then you could take such files to your SVN or Git projects.

Tools - Database Export.

enter image description here

I set the output to multiple directories - so one directory for schema object type.

Then I set my application schema, then proceed to FINISH/OK.

Output looks like:

enter image description here

I talk about this in more detail here.

like image 118
thatjeffsmith Avatar answered Mar 11 '23 22:03

thatjeffsmith