To upgrade from Ingres 6.4 using the alternate upgradedb procedure, follow this process.
Note: In this procedure, the notation [Each DB] means: "For each database, not including the iidbdb, become the DBA for that database, cd to the unload directory for the database created in Step 1, and perform this step." Do not include the iidbdb or Ingres Star databases unless instructed. If using Ingres Star, remember to include the coordinator database in the list of databases.
Note: You can omit Steps 2 through 4 if procedures already exist to recreate all database objects and storage structures. However, it will be necessary to make the appropriate changes to the oi_prep.sh script-see the step Remove Non-table Objects-for re-modifying all tables.
The sections that follow provide details on steps that differ from those described previously in this guide.
You must create a directory to hold scripts, but no data. Make the directory writable by anyone. The disk space needed is a maximum of 1 MB per directory.
To create a directory, issue the following commands for each database, including the Ingres Star databases:
UNIX:
mkdir /someplace/dbname
chmod 777 /someplace/dbname ![]()
Windows:
mkdir d:\someplace\dbname ![]()
Note on Steps 2 through 4: You can omit Steps 2 through 4 if procedures already exist to recreate all database objects and storage structures. However, it will be necessary to make the appropriate changes to the oi_prep.sh script-see the step Remove Non-table Objects-for re-modifying all tables.
Run unloaddb against each database. The unloaddb command does not unload the database; it simply creates scripts. You can edit these scripts to produce a collection of scripts that recreate various database objects and storage structures.
For Ingres Star databases, unload the CDB in the same way as for a local database. For a DDB, use unloaddb/star.
For a regular DB or CDB, issue this command:
unloaddb dbname
For an Ingres Star DDB, issue this command:
unloaddb ddbname/star
The unloaddb output must be modified for recreating just the database objects and storage structures.
To edit the unloaddb output, manually edit each cp{user}.in file that unloaddb created to extract the following statements:
For UNIX, the extract_unloaddb.sh shellscript is available that extracts one user's object definitions. The script is available on the Ingres Technical Support web site.
Note: The $ingres user should not own any non-catalog objects, so do not process the cp_ingre.in file that unloaddb creates.
As a result of this step, SQL scripts are created that can recreate any database object or storage structure owned by any user in any database.
The purpose of removing non-table objects is to reduce the database to base tables.
Some database objects such as procedures and views can be very complicated, and some past versions of upgradedb did not always process them successfully. Additionally, processing of some objects (grants in particular) is slow and expensive. Dropping the grants and later recreating them avoids any possible failure due to lack of transaction log space.
Note: Do not process Ingres Star distributed databases.
To remove non-table objects
UNIX:
To perform this step automatically
Using the C shell, issue this command:
oi_prep.sh dbname |& tee oi_prep.log
If there are any dependent views, "drop" errors messages may be reported on those views (oi_prep.sh does not drop views in reverse dependency order); ignore the "drop" errors
The verifydb -odbms command may output the following messages, which you can ignore:
S_DU1611_NO_PROTECTS iirelation indicates that there are protections for table (owner), but none are defined.
S_DU0305_CLEAR_PRTUPS Recommended action is to clear protection information from iirelation, and S_DU1619_NO_VIEW iirelation indicates that there is a view defined for table (owner), but none exists.
S_DU030C_CLEAR_VBASE Recommended action is to clear view base specification from iirelation.
Also ignore the "patch warning" message that warns of the loss of user tables in "runinteractive" mode. This mode will not be used.
sql +U dbname
SELECT * FROM iistatistics;\go
No rows should be returned. If there are rows, this is the probable cause of the verifydb problem.
DELETE FROM iistatistics;COMMIT;\go\quit
For each database, including the iidbdb, checkpoint each database and turn off journaling. Then save the configuration file.
The upgradedb process turns off journaling, so it is best to turn if off now. If upgradedb fails, you can use this checkpoint to recover and try again.
To checkpoint and turn off journaling
ckpdb -d -j dbname
Note: For the iidbdb, use the ckpdb -s option. The iidbdb database does not have an "unload" directory.
cp $II_DUMP/ingres/dmp/default/dbname/aaaaaaaa.cnf {somewhere secure}
Save your installation ID and default locations, which are kept in a file named symbol.tbl. Copy $II_SYSTEM/ingres/files/symbol.tbl to a safe area not in the Ingres directory tree.
Using the scripts generated by the step Edit the Unloaddb Output, recreate the views and other database objects.
Recreate objects in the following sequence:
sql -uuser dbname <user_grantview.sql
sql -uuser dbname <user_event.sql
sql -uuser dbname <user_dbsp.sql
sql -uuser dbname <user_rule.sql
Remember to run all four scripts for each user who owns objects in each database.
If your application system has its own scripts to recreate database objects, you may use them instead of the unloaddb-generated scripts.
For each user_modindex.sql script generated by the step Edit the Unloaddb Output, reapply storage structures and indexes:
sql -uuser dbname <user_modindex.sql
If your application system has its own scripts to reapply storage structures and create indexes, you may use them instead of the unloaddb-generated scripts.