In general terms, the database upgrade script contains SQL statements that are understood by your RDBMS and that change the RDBMS tables, indexes and (in the case of Oracle RDBMS) sequences to create the data structures associated with your new application release. A database upgrade script may contain DDL statements such as CREATE TABLE, ALTER TABLE, DROP TABLE, CREATE INDEX.
To find out what is in the database upgrade script, inspect it. Do this by releasing the database upgrade script (see next section below), then finding the "application.200.upg.rdbms.sql" script in the \scripts subfolder of the current release folder, and then opening it in a text editor.
The database script attempts to preserve existing data. One strategy it uses for this is (roughly) the following sequence of statements, where existing data is temporarily preserved in an OLD_... table:
RENAME mytable TO OLD_mytable;
INSERT into OLD_mytable(...)
SELECT * FROM mytable;
CREATE TABLE mytable (...);
INSERT INTO mytable (...)
SELECT * from OLD_mytable;
Another strategy uses ALTER TABLE rather than CREATE TABLE:
ALTER TABLE mytable ADD COLUMN ...
With ALTER TABLE, existing data is preserved in the table itself while it undergoes change.
In Delivery Manager, you can influence how database change is implemented in the database upgrade script in 2 ways.
CAUTION: These 2 ways of interfering with the database upgrade script are NOT particularly recommended, except if you have special reasons:
•You can determine that a table must be ignored, ie, not included in the database upgrade script even if it has changed. Do this on a per-table basis by finding the table in the Application Tables window (choose Define, Application Tables) and setting Skip = Yes for the table. •You can suggest that a CREATE TABLE statement is used rather than an ALTER TABLE statement. Do this on a per-table basis by finding the table in the Application Tables window (choose Define, Application Tables from the menu) and setting Upgrade Hint = Create for the table. If you do not find the table in the Application Tables list, run the " Populate tables list " preparatory action.
|