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|
|Global Temporary Table||x||x|
|Materialized View Log||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)); /
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.