3

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?

1 Answer 1

7

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Today I exported the schema files to my repo and I'm wondering if there's some kind of methodoly to work with these kind of repositories. I'm asking this 'cause the database isn't hosted locally and therefore any change in the schema will impact inmediatly.Thanks.
most folks create local databases (docker?) and do their work there, then when the're happy to share, will merge to whatever branch

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.