This topic applies only to the Distributed platforms

Running SQL upgrade scripts

A database administrator (DBA) can run an SQL upgrade script by invoking the For Windows operating systemupgradeSchema.bat or the For Linux operating systemFor UNIX operating systemupgradeSchema.sh script or by running the SQL script directly.

Important: The scripts must be run in the following sequence:
  1. Run all upgradeTablespac* scripts before executing any upgradeSchema* scripts.
  2. Run the upgradSchema_SchemaStatus.sql script before running any other "upgradeSchema*" SQL scripts.

For most databases, including Oracle, the options are embedded in the SQL scripts. Additional options are not required. The following options are strongly recommended for specific database types. These options help in problem determination if the scripts do not work successfully, or if the scripts have to be re-run.

To run the SQL scripts directly, use the following parameters and commands.

DB2
db2 -s -t -v -z <log name> -f <script_name>
Options:
-s
Specifies that the script is to exit as soon as the first error occurs
-v
Specifies that the statement is to be printed on the command line so that it can be logged in a log file
 -z
Specifies that the output from the command is to be dumped into a log file that the database administrator (DBA) can use for error checking
-t
Specifies that the semicolon (;) is to be treated as a delimiter for the commands in the file
-f
Specifies a file name
SQLServer
osql -e -b -U <username> -P <password> -i <script_name> -o <log name> 
Options:
-e
Specifies that the command is to be echoed on prompt
-b
Specifies that the script is to exit when errors occur
-U
Specifies the user name
-P
Specifies the password
-i
Specifies the input file
-o
Specifies that all output is to be redirected to a file