This content has been marked as final. Show 6 replies
>1 person found this helpful
Export tool (Tools-> Database Export) generates DDL for views in alphabetical order instead of dependency order, hence running generated .sql file fails to create views.
Tool does seem to generate DDL in correct order for objects in general (i.e., tables before constraints).
Is there something I am missing in the tool that will ensure the DDL for views is generated in the correct order?
No - you aren't missing anything.
Views can be dependent on tables, other views, procedures, functions, packages, synonyms. Each of those can have its own dependencies which will now include object types, database links and others. The dependency chain looks like a tree.
In general it isn't always possible to generate everything in 'dependency' order since objects can be dependent on many other objects of different types and you can have situations where there are circular references.
Thank you ... Looks like its time to do the 'old school' manual editing... :-)
Hi,1 person found this helpful
Possibly this is by design since the export dialog wizard provides a checkbox option to Add Force to Views. Then it is just a matter of recompiling any invalid objects.
Perhaps the developer responsible for export will comment further. This looks to be more of an enhancement request than a bug.
SQL Developer Team
Edited by: Gary Graham on Oct 24, 2012 3:31 PM
Also see this link concerning the Cart feature:
Does SQL Developer allow you to create a build script of schema objects?
You can also try the Cart. It will generate a series of scripts designed to avoid the dependency issues as much as possible.
View > Cart
Drag your objects into it.
Set your options, deploy.
It will be tedious to drag an entire schema's worth of objects into the cart (yes, we're working on that), but you'll have the added ability to include a subset or all the data as well.
Didn't mean to imply this was a bug. I was seeking advice and maybe a 'how to' solution. The FORCE VIEWs options is something I will try.
And if too many objects in the imported schema are in an INVALID state afterward, your connection node's context menu includes an item to Recompile Schema ....