DB2 Version 9.7 for Linux, UNIX, and Windows

db2updv97 - Update database to Version 9.7 fix pack command

Updates the database system catalog to support the fix pack you have installed. This command can be used only on a database running DB2® for Linux, UNIX and Windows Version 9.7 Fix Pack 1 or later.

Authorization

SYSADM

Required connection

Database. The command automatically establishes a connection to the specified database.

Command syntax

Read syntax diagramSkip visual syntax diagram
>>-db2updv97-- -d--database name-------------------------------->

>--+----------------------------+--+-----+--+-----+--+-----+---><
   '- -u--userid-- -p--password-'  '- -a-'  '- -i-'  '- -h-'   

Command parameters

-d database name
Specifies the name of the database to be updated.
-u userid
Specifies the user ID.
-p password
Specifies the password for the user.
-a
Forces all updates to be run.
-i
Fixes the INDEX_TBSPACEID column in SYSCAT.DATAPARTITIONS (Starting in DB2 Version 9.7 Fix Pack 2).
-h
Displays help information. When this option is specified, all other options are ignored, and only the help information is displayed.

Example

After installing Version 9.7 Fix Pack 1 or later, update the database system catalog in the SAMPLE database by issuing the following command:
db2updv97 -d sample
If your databases were created or upgraded to DB2 Version 9.7 GA and you applied DB2 Version 9.7 Fix Pack 1 or later, then running the command automatically applies all updates required from Version 9.7 GA up to and including the fix pack level that you are installing.

Usage notes

In a partitioned database environment, this command must be run on the catalog partition.

For Version 9.7 Fix Pack 2 or later, issuing the db2updv97 command is mandatory in order to execute the SYSPROC.ADMIN_GET_MSGS table function. However, if you revert to Version 9.7 Fix Pack 1 or earlier after running the db2updv97 command, contact your DB2 support representative before trying to run this table function.

For improved performance, the db2updv97 command applies only the updates that are required in order to make the databases appear as if they were created at the fix pack level that you are installing. Thus, if the command is issued more than once, no errors are reported and each of the system catalog updates is applied only once. However to force the reapplication of all updates, append the -a parameter.

Updates to the system catalogs include the following changes:
  • Creation of any new procedures available in the fix pack level that you are installing.
  • Alteration of routines to correct the definition.
  • Alteration of system administrative views to the correct definition.
The following query returns a result set that consist of tables with problems that can be resolved by the -i option:
SELECT TABSCHEMA, TABNAME 
FROM   SYSCAT.DATAPARTITIONS
WHERE  INDEX_TBSPACEID  = 0          AND 
       TBSPACEID       IS NOT NULL   AND
       TABSCHEMA NOT IN ('SYSIBM', 'SYSCAT', 'SYSSTAT',
                         'SYSIBMADM', 'SYSCATV82')
GROUP BY (TABSCHEMA, TABNAME);
If this query returns any results, then you can do one of the following steps:
  • Drop and recreate the tables shown in the query.
  • Run the db2updv97 with the -i option.
If the problem is not fixed, then the db2look command does not print the correct DDL for tables returned from the query. Additionally, any applications that reference the INDEX_TBSPACEID column of SYSCAT.DATAPARTITIONS might contain inaccurate data.

After updating to DB2 Version 9.7 Fix Pack 1 or later and running the db2updv97 command, the database cannot move back to DB2 Version 9.7 GA level. The SQL0901N error will be returned when trying to connect to the database.