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?
So I’m not sure about standard or recommended, but we do have a few tools for you to take advantage of.
I realized I had ONLY talked about the Cart previously – which is good for taking a subset or handful of objects, and loading to scripts. But this person wants the entire schema.
So let’s look at the Database Export Wizard, under the Tools menu.
Step 1: Your Connection
The easiest way to walk this is to login AS the schema you want to unload. I’m going with HR.
Then proceed to the tools menu.
Step 2: The Most Important Part, the Options
Two things to consider here – what types of objects do you want, and how do you want the output generated.
- Show Schema – do you want to see CREATE TABLE HR.TABLE1 or do you want to see CREATE TABLE TABLE1?
- Export Data – you probably do NOT want the data included as INSERT statements – unless these are lookup tables
- Save As – I have mine set to SEPARATE DIRECTORIES, so I will get a directory for each schema object type
Adjust according to your needs.
I could click ‘Finish’ here – as I am EXPORTING EVERYTHING in my schema. But if you don’t want everything, you could go to the next screen to use the Object Selector to say exactly what you want to export.
Let’s look at two files.
First a sample, generated file.
And there’s also a ‘master’ file in the root output directory.
Don’t Like GUIs?