Upgrade Database Schema
The Upgrade Database Schema phase performs all of the changes necessary to make the source database’s schema compatible with the target installation. This entails the modifying the schema of tables, columns, indices, sequences and procedures; it also includes the removal of invalid objects. Comparisons are made between the source database schema and the persistence metamodel of the target system (stored in its introspection information), from which SQL scripts of the schema differences are generated and executed to bring the source into compliance.
The following tasks are executed by the Upgrade Database Schema phase in the process of making the source database compatible with the target installation:
1. Searching for modified objects and gathering the modification details tasks are performed to identify tables that have been added, changed, or removed, as well as columns, regular indices, Column-based indices, non-modeled tables, non-modeled indexes, sequences, triggers, types, and procedures.
2. Batches all the SQL statements that are generated for the following:
a. Adding and altering of tables, columns
b. Adding, altering, and dropping of indices
c. All the non-modeled procedures from the target installation
d. Creating Array and Struct types
e. Creating class and column sequences
f. Creating the non-modeled types and triggers
3. Executes all the batched SQL statements to update the database. The addition of unique and not-null constraints is postponed for existing tables to the Add Database Constraints phase.
4. All the batched SQLs are executed in this step. Upon completion of this step, all necessary updates to the source database by the Upgrade Database Schema phase will have been completed.
5. Compile the invalid objects.
6. Hashes for the source database are calculated and stored during finalize upgrade schema task.
7. HTML and XML schema differences reports are generated which includes the SQL statements and other important details.
* 
The Upgrade Manager never removes obsolete tables or columns. These are reported as obsolete in the Schema Differences report. They are left in place and the data is untouched. If you want to reclaim the space from these unused tables or columns, you can do so independently after the upgrade is complete. The schema comparison report produced in the last step enumerates these tables and columns. The Upgrade Manager does drop non-modeled indexes.
Est-ce que cela a été utile ?