I’ve previously talked about Domains…this is the concept where say you want to have a JSON column in your Oracle TABLE, but you always want it defined the same way, e.g. as a CLOB.
Or maybe you have a NAME column, and you always wants names stored as a VARCHAR2(256).
If you open the Domains Administration dialog, you can create a new Domains file, and add your version of the TRUTH. This is stored in an XML file…somewhere.
You want to SOURCE CONTROL/VERSION this file. It gets stored outside your design.
Time to start that new project!
If we start by opening a new design, we’ll notice our domains aren’t present. BOO. HISS.
Import the domain
File – Import – Domains
Navigate to the XML file you’ve stored your Domains in, select it. That should load the list.
Check the domains you want to import, and click OK.
Now back to our Design tree, under Domains we’ll see our list.
And if I go into a new TABLE and add a couple of columns, one for a name and one for some JSON, we can preview the DDL…and all is right with the world again.
Let’s end on a trick
If you’ve been a reader for the past 8 years, you probably already know this one, but I find repetition is key for retention and really groking a topic.
When building out TABLEs, you’re going to be selecting from a set of data types over and over again. And there are a TON of data types to choose from, esp as you get into newer and newer versions of Oracle Database.
So, the tip is – tell us in Preferences, what you want to see by default. Hint: you don’t want to see everything by default!
I setup my preferred data types first, and then I setup my domains. I also say, let’s default with Domains when creating a new column SO I don’t forget about them.
Now, let’s see what we see when defining the properties of our new column.
Or if I switch over to Logical:
3 Comments
File -> Export -> “To Data Modeler Design”.
Jeff,
We’ve got a huge logical model that was created with domains. When we export the model and then import the model, non of the domains are transported with the model.
So, we went and found the defaultdomains.xml file and imported it into SDDM.
We then imported the export of the logical model, but despite the domains being there… Everything in the logical model was set to ‘Logical Data Types’ instead of ‘Domain Data Types’.
Any thoughts?
Thanks for all you do!
Rich
How do you mean, “Export the model?”
Also, I’d probably post this to the Data Modeler Community…