Previous |
Next |
When you run your installation script files, their DDL statements create the schema objects of your application in the deployment environment. To create the installation script files correctly and run them in the correct order, you must understand the dependencies between the schema objects of your application.
If the definition of object A references object B, then A depends on B. Therefore, you must create B before you create A. Otherwise, the statement that creates B either fails or creates B in an invalid state, depending on the object type.
Typically, you install schema objects and data in the deployment environment in this order:
Package specifications
Tables (with constraints and indexes) in correct order
Sequences (often used by triggers)
Triggers
Synonyms
Views (which might reference functions, procedures, or synonyms)
Package bodies
Data
However, for a complex application, the order for creating the objects is rarely obvious. Usually, you must consult the database designer or a diagram of the design.