On Import, when the DDL for an existing object differs from the statement as it appears in the file, then Lure needs to update the object in the database.
The strategy that Lure follows to achieve this depends on the type of the object. The main strategies are:
Type | CREATE OR REPLACE | Update | DROP and RE-CREATE | Patch |
---|---|---|---|---|
Package/Package Body | x | |||
Procedure | x | |||
Function | x | |||
Trigger | x | |||
Java Source | x | |||
Type | x | x | ||
Type Body | x | |||
View | x | |||
Table | x | |||
Global Temporary Table | x | x | ||
Materialized View | x | |||
Materialized View Log | x | |||
Index | x | x | ||
Constraint | x | x | ||
Sequence | x | |||
Synonym | x | |||
Database Link | x | x | ||
Object Privilege | x | |||
Refresh Group | x | |||
Cluster | x | x | ||
Operator | x | x | ||
Indextype | x | x | ||
Library | x | |||
Dimension | x |
If an operator has any dependent indextypes or functions then it cannot be updated using CREATE OR REPLACE. In that case the operator is first dropped and then re-created.
If an indextype has any dependent domain indexes then it cannot be updated using CREATE OR REPLACE. In that case the indextype is first dropped and then re-created.
If a type has any dependent types, indextypes or tables then the type cannot be updated using the CREATE OR REPLACE option. In that case you have to use the ALTER statement to update the type. Do however note the unique way in which any subsequent ALTER statements affect the source code of a type.
For example, given the following type:
CREATE TYPE MY_TYPE AS OBJECT ( id NUMBER, name VARCHAR2(30)); /
and then
ALTER TYPE MY_TYPE ADD ATTRIBUTE (length NUMBER);
The resulting source for this type is now:
TYPE MY_TYPE AS OBJECT ( id NUMBER, name VARCHAR2(30)) ALTER TYPE MY_TYPE ADD ATTRIBUTE (length NUMBER)
The ALTER statement has become part of the source code definition of the type as it is defined in the database.
Lure will export the entire source code for a type, including any additional ALTER statements. During import/deployment Lure will compare the source code for the type in the file with the source code of the type in the database. Lure will then install any ALTER statements that have not yet been installed.