DB2Upgrading Db2upge970
DB2Upgrading Db2upge970
7
for Linux, UNIX, and Windows
SC27-2452-00
IBM DB2 9.7
for Linux, UNIX, and Windows
SC27-2452-00
Note
Before using this information and the product it supports, read the general information under Appendix C, “Notices,” on
page 215.
Edition Notice
This document contains proprietary information of IBM. It is provided under a license agreement and is protected
by copyright law. The information contained in this publication does not include any product warranties, and any
statements provided in this manual should not be interpreted as such.
You can order IBM publications online or through your local IBM representative.
v To order publications online, go to the IBM Publications Center at www.ibm.com/shop/publications/order
v To find your local IBM representative, go to the IBM Directory of Worldwide Contacts at www.ibm.com/
planetwide
To order DB2 publications from DB2 Marketing and Sales in the United States or Canada, call 1-800-IBM-4YOU
(426-4968).
When you send information to IBM, you grant IBM a nonexclusive right to use or distribute the information in any
way it believes appropriate without incurring any obligation to you.
© Copyright International Business Machines Corporation 2006, 2009.
US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract
with IBM Corp.
Contents
About this book . . . . . . . . . . . v Chapter 7. Upgrading a DB2 server
(Linux and UNIX) . . . . . . . . . . 67
Part 1. Upgrading your DB2 Upgrading instances . . . . . . . . . . . 68
Upgrading the DB2 Administration Server (DAS) . . 70
environment . . . . . . . . . . . . 1 Upgrading databases . . . . . . . . . . . 71
Chapter 1. Upgrade to DB2 Version 9.7 3 Chapter 8. Upgrading DB2 servers with
specific characteristics . . . . . . . . 75
Chapter 2. Planning your DB2 Upgrading DB2 32-bit servers to 64-bit systems
environment upgrade . . . . . . . . . 5 (Windows). . . . . . . . . . . . . . . 75
Planning your DB2 servers upgrade . . . . . . 6 Upgrading non-root installations . . . . . . . 77
Planning your clients upgrade . . . . . . . . 8 Upgrading a DB2 server with multiple DB2 copies 78
Planning your database applications and routines Upgrading to a new DB2 server . . . . . . . 80
upgrade . . . . . . . . . . . . . . . . 8 Upgrading a DB2 server using online backups from
a previous release . . . . . . . . . . . . 83
Part 2. Upgrading DB2 servers . . . 13 Upgrading partitioned database environments . . . 84
Upgrading DB2 Text Search . . . . . . . . . 85
Upgrading DB2 Data Links Manager environments 88
Chapter 3. DB2 servers upgrade . . . . 15 Upgrading a DB2 server with XML Extender to DB2
Version 9.7. . . . . . . . . . . . . . . 89
Chapter 4. Upgrade essentials for DB2 Upgrading DB2 servers in Microsoft Cluster Server
servers . . . . . . . . . . . . . . 17 environments . . . . . . . . . . . . . . 91
DB2 command actions to upgrade instances and
databases . . . . . . . . . . . . . . . 17 Chapter 9. Post-upgrade tasks for DB2
Upgrade restrictions for DB2 servers . . . . . . 19 servers . . . . . . . . . . . . . . 93
Best practices for upgrading DB2 servers . . . . 22 Adjusting the log space size in upgraded databases 94
Disk space requirements for DB2 server upgrades 25 Activating a database after upgrade . . . . . . 95
Support changes for 32-bit and 64-bit DB2 servers 27 Managing DB2 server behavior changes . . . . . 96
DB2 server behavior changes . . . . . . . . 28 Setting up security to manage database auditing in
Deprecated or discontinued functionality that affects upgraded databases . . . . . . . . . . . 97
DB2 server upgrades . . . . . . . . . . . 37 Rebinding packages in upgraded databases . . . . 99
Migration from non-DB2 relational database Migrating explain tables . . . . . . . . . . 99
management systems . . . . . . . . . . . 39 Converting XML storage objects to the Version 9.7
format . . . . . . . . . . . . . . . . 100
Chapter 5. Pre-upgrade tasks for DB2 Ensuring system temporary table spaces page sizes
servers . . . . . . . . . . . . . . 41 meet requirements . . . . . . . . . . . . 101
Converting type-1 indexes to type-2 indexes . . . 42 Re-creating write-to-table event monitors . . . . 102
Verifying that your databases are ready for upgrade 44 Verifying upgrade of DB2 servers . . . . . . 103
Backing up databases before upgrade. . . . . . 46
Backing up DB2 server configuration and diagnostic Chapter 10. Adopting new Version 9.7
information . . . . . . . . . . . . . . 47 functionality in upgraded databases . 105
Increasing table space and log file sizes before
upgrade . . . . . . . . . . . . . . . 49
Chapter 11. Migrating DB2
Changing raw devices to block devices (Linux) . . 51
Upgrading DB2 servers in a test environment . . . 52 functionality to DB2 product features . 109
Creating database duplicates . . . . . . . 53 Migrating from DB2 Governor to DB2 workload
Taking a DB2 server offline before upgrade . . . . 54 manager . . . . . . . . . . . . . . . 109
Migrating from Query Patroller to DB2 workload
manager . . . . . . . . . . . . . . . 111
Chapter 6. Upgrading a DB2 server
Migrating from XML Extender to pureXML . . . 113
(Windows) . . . . . . . . . . . . . 57
Upgrading instances . . . . . . . . . . . 58
Chapter 12. Reversing DB2 server
Upgrading the DB2 Administration Server (DAS) . . 61
Upgrading databases . . . . . . . . . . . 62 upgrade . . . . . . . . . . . . . . 115
This book contains information about how to create an upgrade plan and how to
upgrade each component of your DB2 environment:
v Part 1, “Upgrading your DB2 environment,” on page 1
v Part 2, “Upgrading DB2 servers,” on page 13
v Part 3, “Upgrading clients,” on page 117
v Part 4, “Upgrading applications and routines,” on page 139
Your DB2 environment has several components such as DB2 servers, DB2 clients,
database applications, and routines. Upgrading these components requires an
understanding of DB2 database products and their upgrade concepts. For example,
if you have an existing DB2 environment with DB2 Version 9.5, DB2 Version 9.1, or
DB2 UDB Version 8 copies and you want to upgrade them to DB2 Version 9.7, then
you must upgrade your DB2 environment.
The upgrade process consists of all the tasks that you must perform to have your
DB2 environment running successfully on a new release. The upgrade of each of
the components in your DB2 environment requires that you perform different
tasks:
v Upgrading DB2 servers involves upgrading your existing instances and
databases so that they can run in the new release.
v Upgrading clients involves upgrading your client instances to keep the
configuration of your existing clients.
v Upgrading database applications and routines involves testing them in the new
release and modifying them only when you must support changes in this new
release.
The following information is provided to document the upgrade process for DB2
Version 9.7:
v Upgrade overviews define upgrade concepts and describe the upgrade process
for a component.
v Upgrade essentials include the details about upgrade support, restrictions and
best practices that you must know to plan your upgrade strategy.
v Pre-upgrade tasks describe all the preparation tasks that you must perform
before upgrade.
v Upgrade tasks describe step by step the basic upgrade process for a component
and how to upgrade DB2 environment components with special characteristics.
v Post-upgrade tasks describe all the tasks that you must perform after upgrade to
have your DB2 server running at the optimum level.
In the upgrade tasks, the term pre-Version 9.7 DB2 releases refers to a DB2 Version
9.5, DB2 Version 9.1, and DB2 UDB Version 8 release.
First, devise a strategy on how to approach your environment upgrade. You must
determine the order in which you are going to upgrade each component. The
characteristics of your environment and the information in upgrade essentials,
especially the best practices and restrictions, can help you determine your strategy.
The following is an example of a good upgrade strategy in which you test your
database applications and routines and determine that they run successfully in
DB2 Version 9.7:
1. Set up a DB2 Version 9.7 test server and create test databases.
2. Test your database applications and routines on a DB2 Version 9.7 test database
to determine whether they run successfully. If your application requires a client,
use a Version 9.7 client.
3. Upgrade your DB2 servers and clients in a test environment. Determine what
the issues are and how to resolve them. Use this information to adjust your
upgrade plan.
4. Upgrade your DB2 servers to DB2 Version 9.7 in your production environment.
Ensure that they operate as expected.
5. Upgrade your clients to DB2 Version 9.7 in your production environment.
Ensure that your clients operate as expected.
6. Test your database applications and routines in the DB2 Version 9.7 upgraded
environment to determine whether they run as expected.
7. Make your upgraded environment available to users.
8. Identify the use of deprecated functionality that will eventually become
discontinued and new functionality that can improve the functionality and
performance of your applications and routines. Plan how to modify your
applications and routines.
9. Modify your database applications and routines as planned. Ensure that they
run successfully in DB2 Version 9.7.
After you have a strategy that will give you the outline for your upgrade plan, you
can define the upgrade plan details for each component in your environment. An
upgrade plan should include for each component:
v Upgrade prerequisites
v Pre-upgrade tasks
v Upgrade tasks
v Post-upgrade tasks
If you have previous upgrade plans, review them and compare them with the
upgrade plan for DB2 Version 9.7. Include in your new plan any steps related to
internal procedures to request access, software installation or other system services
within your organization.
Finally, plan to remove the use of deprecated functionality and incorporate new
functionality from DB2 Version 9.7. Although you are only required to remove the
use of discontinued functionality, you should also plan to remove the use of
deprecated functionality after upgrade because they will become unsupported in a
future release. Also, you should take advantage of new functionality for your
database products, applications, and routines to enhance functionality and improve
performance.
2. If you must be able to reverse the upgrade, add details to the plan about the
tasks required to reverse a DB2 server upgrade. These details should include
any steps required in the upgrade task that enables you to reverse the upgrade.
3. Combine with the upgrade plan for other components such as clients, database
applications, and routines to create an overall upgrade plan for your DB2
environment.
2. Combine with the upgrade plan for other components such as DB2 servers,
database applications, and routines to create an overall upgrade plan for your
DB2 environment.
2. Write the upgrade plan for routines, using all the details that apply to your
environment:
Table 4. Upgrade plan details for routines.
Upgrade plan Details
Prerequisites Ensure that you:
v meet the development software requirements. See “Support for
elements of the database application development environment”
in Getting Started with Database Application Development.
v resolve any support issues in upgrade essentials for routines
during the upgrade.
v meet all prerequisites for the upgrade task and subtasks,
especially obtaining required DB2 authorization.
Pre-upgrade tasks Include the following task:
v Test your routines in a DB2 Version 9.7 testing environment. If
your routines run successfully, the rest of the upgrade steps are
not required.
In addition, check the list of pre-upgrade tasks for optional tasks
that you might want to perform for your environment. Even if
your development software is supported, consider upgrading your
development software to the latest supported level.
Upgrade task You must include these steps:
v Modify your routines to support changes in DB2 Version 9.7 and
to remove use of functionality that is discontinued in DB2
Version 9.7.
v Modify your routines to support changes specific to the
development environment.
v Rebuild all external routines after completing your modifications.
v Retest your routines using DB2 Version 9.7.
Review the following upgrade tasks to determine the additional
steps that are required by your development environment to
upgrade routines:
v “Upgrading C, C++, and COBOL routines” on page 190
v “Upgrading Java routines” on page 192
v “Upgrading .NET CLR routines” on page 193
v “Upgrading SQL procedures” on page 194
v “Upgrading 32-bit external routines to run on 64-bit instances”
on page 195
3. Combine with the upgrade plan for other components such as clients and DB2
servers to create an overall upgrade plan for your DB2 environment.
Upgrading your DB2 server requires that you install a DB2 Version 9.7 copy and
then upgrade all the instances and databases to be able to run them under the DB2
Version 9.7 copy.
You can directly upgrade existing DB2 Version 9.5, DB2 Version 9.1, or DB2 UDB
Version 8 instances and databases to DB2 Version 9.7. Learn details, limitations
about the upgrade process, and possible issues that you must be aware of in the
upgrade essentials section. Refer to the upgrading DB2 server tasks for details on
how to upgrade to DB2 Version 9.7. In the upgrading DB2 server topics, the term
pre-Version 9.7 DB2 copy refers to a DB2 Version 9.5, DB2 Version 9.1, or DB2 UDB
Version 8 copy.
If your DB2 servers are running on a release prior to DB2 UDB Version 8, migrate
them first to DB2 UDB Version 8, and then upgrade to DB2 Version 9.7. It is
recommended that you migrate to the latest fix pack of DB2 UDB Version 8.2.
Refer to the DB2 UDB Version 8 migration roadmap for details on how to migrate
to DB2 UDB Version 8.2.
Upgrade to DB2 Version 9.7 is supported for the following DB2 products:
Table 5. DB2 database products supported for upgrade
DB2 Version DB2 product name
Version 9.5 v DB2 Enterprise Server Edition
v DB2 Workgroup Server Edition
v DB2 Personal Edition
v DB2 Express Edition
v DB2 Express-C
v DB2® Connect™ Enterprise Edition
v DB2 Connect Personal Edition
v DB2 Connect Unlimited Edition
v DB2 Connect Application Server Edition
v DB2 Query Patroller
v IBM® Data Server Client
v IBM Data Server Runtime Client
Note:
1. If you are upgrading databases from DB2 UDB Version 8 FixPak 8 or
lower level (Version 8.2 FixPak 1 or lower level), the automatic
collection of statistics does not occur. You have to manually collect
statistic after upgrading your databases.
2. If statistics were previously collected for the table, the RUNSTATS
command is issued as indicated in the table. If there are no statistics
collected for the table, the RUNSTATS command is not issued.
Note:
1. The highest level for each DB2 database product is the default
instance type as indicated in Table 7 on page 20 ordered from lower
to higher-level. Each instance type supports instance types of a
lower-level. For example, the ese instance type supports wse,
standalone, and client. You can use the db2icrt command with the -s
parameter to create instances of a lower-level. If you do not specify
the -s parameter, the instance is created using the highest level of
instance type supported by the DB2 database product installed.
2. Database manager configuration parameters have default values for
the created instance. Previous database manager configuration
settings are not retained. If the configuration parameters are available
in the new instance, after upgrade, you can restore previous settings.
Avoid upgrading from a higher-level instance type to a lower-level
instance type if possible.
v The db2ckupgrade command fails and causes the db2iupgrade
command to fail. The db2iupgrade command calls the db2ckupgrade
command to verify whether cataloged local databases are ready for
upgrade to DB2 Version 9.7.
v DB2 Data Links Manager Version 8 is installed on the DB2 server. DB2
Data Links Manager is unsupported in DB2 Version 9.7. You can
upgrade to a standard DB2 Version 9.7 instance without the DB2 Data
Links Manager functionality.
v DB2 Data Warehouse Manager Version 8 and any extensions are
installed on the DB2 server. DB2 Data Warehouse Manager is
unsupported in DB2 Version 9.7. However, when you run the
db2iupgrade command, the error message that is generated includes
instructions on how to upgrade to a standard DB2 Version 9.7 instance
without the DB2 Data Warehouse Manager functionality.
The UPGRADE DATABASE command fails if the following situations exist:
v You do not have authorization to upgrade the database.
v A cataloged database does not exist.
v Database upgrade encounters any of the problems described in the
reason codes of error message “SQL1704N” in Message Reference Volume
2.
You cannot specify the bit size for the instance when you create or upgrade an
instance. The bit size for new instances is determined by the operating system
where DB2 Version 9.7 is installed. The following table summarizes the DB2
Version 9.7 bit size support that is available for each of the following operating
systems:
Table 8. DB2 Version 9.7 32-bit and 64-bit support available per operating system
Operating systems DB2 Version 9.7 support available
If you have 32-bit instances and you upgrade to DB2 Version 9.7 on a 64-bit
system, you must manage incompatibilities so that your applications and routines
can run successfully. Incompatibilities arise because of discontinued functionality
or incorrect shared library path specification. Table 8 on page 27 summarizes the
details on the available 32-bit and 64-bit support. For example, 32-bit unfenced
stored procedures in any supported language except Java are not supported. By
dropping and recreating these stored procedures as fenced you can resolve this
issue.
As a general rule, instance profile variables that you set in your DB2 profile
registry or your system environment retain their values after an instance upgrade.
Some global profile registry variables, such as DB2SYSTEM and DB2PATH, are set
by the DB2 installation procedure or instance upgrade. However, the global profile
registry variables that you set by running the db2set command with the -g option
are not upgraded. Therefore, you must define them after upgrade.
The following tables describe in detail the upgrade impact of all of the changes to
variables, database and database manager configuration parameters, physical
design characteristics of databases, and database authorities and privileges:
v New registry variables
v Changes to existing registry variables
v Deprecated and discontinued variables
v New database manager configuration parameters
v Changes to existing database manager configuration parameters
v Deprecated and discontinued database manager configuration parameters
v New database configuration parameters
v Changes to existing database configuration parameters
After upgrading your instance, leaving this variable unset, it has the
same effect as the AUTOMATIC setting and you might experience
this change in I/O access. The benefits of using non-buffered I/O
are reduced memory requirements and more efficient I/O access for
log files. Therefore, carefully consider the impact before you decide
to disable this feature by setting this variable to OFF.
DB2_SKIPINSERTED For statements operating under cursor stability isolation level with
currently committed behavior enabled, this registry variable has no
effect. Read the row for the cur_commit configuration parameter in
Table 13 on page 32 for details.
The limit for the locklist parameter is now 134 217 728 pages (4
KB).
If the database does not have a user with SECADM authority, the
UPGRADE DATABASE command explicitly grants SECADM
authority to the user performing this command. If any users in the
SYSADM group need SECADM authority, you must explicitly
grant it to them.
If you are upgrading from DB2 Version 9.1 or earlier, also review all of the changes
to variables, database and database manager configuration parameters, and
physical design characteristics of databases between pre-Version 9.7 releases that
might also impact your upgrade:
v DB2 server behavior changes between DB2 Version 9.1 and DB2 Version 9.5
v DB2 server behavior changes between DB2 UDB Version 8 and DB2 Version 9.1
To deal with these functionality changes, you must perform additional tasks before
or after upgrade. The majority of these tasks are pre-upgrade or post-upgrade tasks
for DB2 servers. The following list describes changes that are not included in the
pre-upgrade and post-upgrade tasks for DB2 servers:
Control Center tools have been deprecated
The Control Center tools have been deprecated in DB2 Version 9.7 and
might be discontinued in a future release. See “Control Center tools and
DB2 administration server (DAS) have been deprecated” in What’s New for
DB2 Version 9.7 for a completed list of the tools that have been deprecated.
Start using the Data Source Explorer in IBM Data Studio to perform
database administration tasks. See Database administration from the Data
Source Explorer for details. Also, visit the Data Studio product page at
http://www.ibm.com/software/data/studio/ for details about product
offerings and downloads.
Netscape support has been discontinued
Netscape is no longer a supported Web browser for First Steps and the
installation launchpad. If Netscape is set up as your default Web browser,
running First Steps will return the DBI1435E error message.
Setup a supported Web browser as the default Web browser before running
First Steps or the installation launchpad. See a list of supported Web
The new setting does not become effective until the database is in a
consistent state and all users are disconnected from the database. The
database manager moves the logs to the new location after the first user
connects to the database.
DB2 Products
Certain Net Search Extender (NSE) features and commands have been
deprecated and might be discontinued in a future release. See “Net Search
Extender features and commands have been deprecated” in What’s New for
DB2 Version 9.7 for details on how to start using equivalent features or
commands.
The porting plan should include tasks such as, converting your database objects to
create the equivalent database objects in a DB2 database, moving the actual data to
the new DB2 database and porting your database applications. Porting your
applications refers to converting SQL statements, modifying interface calls, and
converting any database specific code to access DB2 databases.
The most common approaches to converting database application code are manual
conversion, dynamic call translation, and automated conversion. In general,
conversion tools take source code as input and translate data management calls to
equivalent SQL calls. Information from the source and target database, as well as
program code, is used to build the new SQL statements.
The IBM Migration Toolkit (MTK) is a conversion tool that is designed to migrate
data and the query and procedure language from source database management
systems such as Informix® Dynamic Server, Informix Extended Parallel Server
(XPS), Microsoft SQL Server, Oracle, and Sybase Enterprise to DB2 database
products. MTK runs on AIX, Linux, Solaris, and Windows operating systems. The
only language supported is English. MTK is available as a complementary
download from the IBM Migration Toolkit Web page.
Prepare for the upgrade of your DB2 servers by performing the following tasks:
1. If you use distributed transactions involving DB2 databases, ensure that the
databases to be upgraded do not contain any indoubt transactions by using
the LIST INDOUBT TRANSACTIONS command to get a list of indoubt
transactions and to interactively resolve any indoubt transactions.
2. Convert type-1 indexes to type-2 indexes because type-1 indexes are
discontinued in DB2 Version 9.7. Converting them before upgrade eliminates
the overhead of index rebuild when you access tables using these indexes for
the first time after upgrading to DB2 Version 9.7.
3. Verify that databases are ready for DB2 upgrade to identify any problems
before the actual upgrade. You must resolve them before you proceed with the
upgrade.
4. Optional: Stop HADR on the primary and standby databases. You can
upgrade only the primary database.
5. Back up your databases to be able to upgrade them to a new upgraded
system or restore them in the original pre-upgrade system.
6. Back up configuration and diagnostic information to have a record of your
current configuration that you can compare with the configuration after the
upgrade. You can also use this information to create new instances or
databases using the same configuration that you had before upgrade.
7. Archive all of the DB2 log files, either for SQL replication or Q replication if
the log files are needed by the Capture or Q Capture programs, or for high
availability disaster recovery (HADR) replication if the log files are needed to
create a standby database.
8. Review the disk space requirements to ensure that you have enough free disk
space, system temporary table space and log space for the upgrade and
increase table space and log file sizes if necessary. Depending on the number
of database objects, you might require more log space to perform the upgrade.
9. Windows only: If you obtained customized code page conversion tables from
the DB2 support service, you need to backup all of the files in the
DB2OLD\conv directory where DB2OLD is the location of your existing
pre-Version 9.7 DB2 copy.
You do not need to backup standard code page conversion tables. Upgrading
your pre-Version 9.7 DB2 copy removes these tables because standard code
page tables are contained in a DB2 Version 9.7 library.
10. Linux only: Change raw devices to block devices.
11. Optional: Upgrade your DB2 server in a test environment to identify upgrade
issues and to verify that applications, scripts, tools and routines work as
expected before upgrading your DB2 server in the production environment.
12. In DB2 Version 9.7, all significant upgrade events are logged in the db2diag
log files when the diaglevel database manager configuration parameter is set
to 3 (default value) or higher. If this parameter is set to 2 or less, set this
You should only perform this task if you know or suspect that your database has
type-1 indexes.
By default, all new indexes created in pre-Version 9.7 releases were type-2 indexes
except when you created an index on a table that already had type-1 indexes, in
which case the new index is also type-1. You might have type-1 indexes on
databases that you created on DB2 UDB Version 7 or earlier and that you
upgraded all the way through to DB2 Version 9.5 or databases under an instance
where the DB2_INDEX_TYPE2 registry variable was set to OFF.
If you decide not to convert your type-1 indexes before the database upgrade, the
type-1 indexes are marked invalid during database upgrade. If the indexrec
database configuration parameter is set to RESTART, indexes marked invalid are
rebuilt when the database is restarted. Otherwise, the type-1 index rebuild starts on
your first access to the table and you might experience an unexpected degradation
in response time.
Procedure
If you have type-1 indexes, you will receive the following message: Type-1
indexes were found in the inspected tables. The convert-t1-indexes-
Use the values for TBSPACEID and TABLEID from the query result in the
previous step to match the Object and Tablespace identifiers in the formatted
output from the db2inspf command and determine the index type for each
root table as shown in the following example:
...
Table phase start (ID Signed: 4, Unsigned: 4;
Tablespace ID: 3) :
You can edit this command file and add or remove commands to convert
type-1 indexes.
The db2ckupgrade command verifies that a list of conditions are true in order to
succeed at the database upgrade. Also, this command writes to the log file,
specified with the -l parameter, a warning message for a list of conditions that
impact database upgrades. See the Command Reference for details about the list of
conditions.
The db2iupgrade calls the db2ckupgrade command. The db2iupgrade fails if the
db2ckupgrade command finds any of the conditions are not true, and returns the
error code DBI1205E.
Prerequisites
v Ensure that you have SYSADM authority.
v Ensure that all the local databases that you want to upgrade are
cataloged.
v On Linux or UNIX operating systems, uncompress a DB2 Version 9.7
installation image to be able to run the db2ckupgrade command.
v Ensure that you meet the installation requirements for DB2 database
products. See “Installation requirements for DB2 database products” in
Installing DB2 Servers .
Restriction
In a partitioned database environment, to verify that your databases are
ready for upgrade, you must run the db2ckupgrade command on each
database partition. If you do not run the db2ckupgrade command on each
database partition, the db2iupgrade command could succeed even when
one or more database partitions are not ready for upgrade. However, the
database upgrade will fail. The db2iupgrade command only runs the
db2ckupgrade command on the database partition where you issue the
db2iupgrade command.
Procedure
where sample is the database name and db2ckupgrade.log is the log file
created in the current directory that includes details on errors and warnings.
Each time you issue this command, it overwrites the existing log file. You can
rename the log file to avoid losing the error details. You must correct these
errors before you upgrade.
If you performed the “Converting type-1 indexes to type-2 indexes” on page
42 pre-upgrade task, you can use the -not1 parameter to skip the check for
type-1 indexes. See 7 for details.
When the db2iupgrade command runs the db2ckupgrade command, the log
file specified is the db2ckupgrade.log file in the instance home directory for
Linux and UNIX operating systems or in the current directory for Windows
operating systems.
5. If you created user-defined data types using a name that is a system built-in
data type name, drop these user-defined data types and re-create them using a
different name that is not restricted. The db2ckupgrade command returns the
SQL0473N error message when user-defined data types have a name that is a
system built-in data type name. If you try to upgrade the database, the
UPGRADE DATABASE command will fail.
6. If you created database objects using restricted schema names, drop all the
database objects that use reserved schema names and re-create them using a
schema name that is not restricted. The db2ckupgrade command returns the
SQL0553N error message when database objects have restricted schema
names. If you try to upgrade the database, the UPGRADE DATABASE
command will fail.
7. If you have type-1 indexes, perform the “Converting type-1 indexes to type-2
indexes” on page 42 pre-upgrade task or run the generated script file.
Alternatively, if you omit the -not1 parameter, you can run the
type1_index_dbname.db2 script file.
The db2ckupgrade command returns the SQL1498W warning message and
generates the type1_index_database-name.db2 script file in the same directory
as the db2ckupgrade log file. The script file contains REORG INDEXES ALL
statements with the ALLOW WRITE ACCESS and CONVERT clauses for each
identified type-1 index.
If you do not perform the pre-upgrade task or do not run the generated script,
the UPGRADE DATABASE command marks all type-1 indexes as invalid. The
database manager will automatically rebuild the type-1 indexes as type-2
indexes on the first table access after database upgrade and you might
experience an unexpected degradation in response time. Access to the table is
not allowed until the index rebuild is completed.
After you upgrade your instances to DB2 Version 9.7, you cannot backup databases
until you upgrade them.
Prerequisites
v To backup a database, you require SYSADM, SYSCTRL, or SYSMAINT
authority.
v Databases must be cataloged. To view a list of all the cataloged
databases in the current instance, enter the following command:
where sample is the database alias, the username is arada, the password is
password, and the directory to create back up files is backup-dir.
In partitioned database environments, . Refer to “Backing up partitioned
databases” in Data Recovery and High Availability Guide and Reference.
If you activated and configured DB2 ACS on your databases in DB2 Version
9.5, you can use the USE SNAPSHOT parameter to perform a snapshot
backup. However, you can only restore a snapshot backup in a DB2 Version 9.5
instance. You cannot use snapshot backup to upgrade to a new server. Refer to
Performing a snapshot backup in Data Recovery and High Availability Guide and
Reference
If you performed a full offline database backup recently and you cannot
perform another one before upgrade, you can perform an incremental offline
database backup instead. Refer to “Upgrading to a new DB2 server” on page 80
for details on how to upgrade your database using an incremental offline
database backup.
3. Optional: Test the integrity of a backup image to ensure that the image can be
restored using the db2ckbkp Check Backup command. The following is an
example on UNIX operating systems:
cd backup-dir
db2ckbkp SAMPLE.0.arada.NODE0000.CATN0000.20051014114322.001
In addition, you can collect information from your DB2 servers about the database
system catalogs, DB2 registry variables settings, explain table data, and diagnostic
information that can help in problem determination if you encounter any
post-upgrade differences in the database manager behavior or performance.
If you have multiple instances, repeat this command for each instance.
4. Back up all your external routines. See “Backup and restore of external routine
library and class files” in Administrative Routines and Views. The following
example shows how to backup all external routines created using the default
path in UNIX operating systems:
cp -R $INSTHOME/sqllib/function $INSTHOME/routine_backup
Where INSTHOME is set to the home directory of the instance owner. If you
have specified a full path that is not under the default routines path when you
created your external routines in the database, you do not need to back up
your routines but you must ensure the existing libraries remain on the current
location.
5. Optional: The db2support command HTML report includes the database
manager configuration parameter settings for the instance that owns the
specified database. You can use the GET DATABASE MANAGER
CONFIGURATION command to back up your settings for database manager
configuration parameters and redirect the command output to a file to save
these settings for each instance:
db2 GET DBM CFG > dbm_instname.cfg
where instname is the instance name.
2 record(s) selected.
Take note of the number of containers, total pages, used pages, free pages,
MAXSIZE, and page size.
If you are upgrading from Version 8.1, use the following command: db2 LIST
TABLESPACES SHOW DETAIL
3. Increase the size of the system catalog table spaces using one of the following
options:
v If you have an SMS table space, ensure that you have at least the same amount
of used pages available as free disk space; in this example, about 60 MB.
v If you have a DMS table space and the number of used pages is greater than
the number of free pages, use the following formula to calculate the number
of pages to increase per container:
number_of_pages = ( used_pages - free_pages ) /
number_of_containers_in_SYSCATSPACE
Then use the following command to increase the size of all containers in the
system catalog table space:
db2 “ALTER TABLESPACE SYSCATSPACE EXTEND (ALL number_of_pages)”
v If you have a DMS table space with AUTORESIZE enabled and MAXSIZE is
set to NONE, ensure that you have at least twice the amount of used pages
available in free disk space. If MAXSIZE is set to an integer value that is less
than twice the amount of used pages, then you need to increase MAXSIZE
using the ALTER TABLESPACE statement as shown in the following
example:
db2 "ALTER TABLESPACE SYSCATSPACE
MAXSIZE (2*used_pages_in_SYSCATSPACE*page_size/1024) K"
The automatic resizing of table spaces is available since DB2 UDB Version 8
FixPak 9.
In our example, the query results in the previous step shows that
SYSCATSPACE is a DMS table space with AUTORESIZE enabled and a
MAXSIZE value of -1 which indicates unlimited maximum size. Therefore, you
must have twice the amount of used pages available in free disk space.
4. Increase the size of the temporary table spaces using one of the following
options:
v
If you have an SMS table space you only need to ensure that you have at
least twice the amount of total pages for the system catalog table space in
free disk space; in this example, about 128 MB.
v If you have a DMS table space, use the following formula to calculate the
number of pages to increase per container:
Use the following command to increase the size of all containers in the
temporary table space:
db2 “ALTER TABLESPACE TEMPSPACE1 EXTEND (ALL number_of_pages)”
v If you have a DMS table space with AUTORESIZE enabled and MAXSIZE is
set to NONE, ensure that you have at least twice the amount of total pages
for the system catalog table space in free disk space. If MAXSIZE is set to an
integer value that is less than twice the amount of total pages for the system
catalog table space, then you need to increase MAXSIZE using the ALTER
TABLESPACE statement:
db2 "ALTER TABLESPACE TEMPSPACE1
MAXSIZE (2*total_pages_in_SYSCATSPACE*page_size/1024) K"
5. Determine the current log space size using the GET DATABASE
CONFIGURATION command. The following example shows how to record the
values for logfilsiz, logprimary, and logsecond database configuration parameters
on Linux and UNIX operating systems:
db2 GET DB CFG FOR sample |grep ’(LOG[FPS]’| tee logsize.txt
Log file size (4KB) (LOGFILSIZ) = 1000
Number of primary log files (LOGPRIMARY) = 3
Number of secondary log files (LOGSECOND) = 2
6. Increase your log space size using the following commands:
db2 UPDATE DB CFG FOR sample using LOGSECOND
(current_value of LOGPRIMARY + current_value of LOGSECOND) * 2
If you already have a large log space, you might not need to increase it.
7. Optional: Enable infinite active logging instead of increasing the log space, by
setting logsecond to -1 and enabling archive logging. Infinite active logging
allows an active unit of work to span the primary logs and archive logs,
effectively allowing a transaction to use an infinite number of log files. You
should be aware that if the upgrade fails, the time to rollback the transactions
will depend on how many archived logs need to be retrieved. The following
command shows an example on how to enable archive logging to disk and
infinite logging:
db2 UPDATE DB CFG FOR sample using LOGARCHMETH1 DISK:archive-dir
db2 UPDATE DB CFG FOR sample using LOGSECOND -1
The previous raw I/O method that required binding the block device to a raw
(character) device using the raw utility is deprecated since DB2 Version 9.1, and
will be removed in a future release of DB2 database product. This raw I/O method
is also deprecated in the Linux operating system and will be removed in a future
release of Linux.
The block device method uses Direct I/O to achieve an equivalent performance
compared to using the raw (character) device method.
If you are restoring from a pre-Version 9.7 backup in DB2 Version 9.7, you must do
a redirected restore to indicate block devices instead of raw character devices for
your containers and log path.
This procedure uses DDL scripts to create database duplicates. If you have enough
resources, you can also create database duplicates by restoring a database backup
to create a new database. See “Restoring to a new database” in Data Recovery and
High Availability Guide and Reference for details.
Procedure
If you choose to automatically upgrade your existing pre-Version 9.7 copy during
the DB2 Version 9.7 installation, your instances and DB2 administration server
(DAS) are upgraded but you still need to upgrade your databases after installation.
If you choose to install a new DB2 Version 9.7 copy, you must manually upgrade
your instances, your DAS, and databases.
This upgrade task describes the steps for direct upgrade to DB2 Version 9.7 from
DB2 Version 9.5, DB2 Version 9.1, or DB2 UDB Version 8. Review upgrading
environments with specific characteristics and determine which task applies better
to your environment.
Prerequisites
v Ensure that you have Local Administrator authority. See the
Prerequisites section in “Installing DB2 servers (Windows)” in Installing
DB2 Servers for additional authorization details.
v Ensure that you meet the installation requirements for DB2 database
products. Refer to “Installation requirements for DB2 database products”
in Installing DB2 Servers.
v Review upgrade recommendations and disk space requirements.
v Perform pre-upgrade tasks.
Restrictions
v This procedure applies only to upgrade from DB2 32-bit servers when
you install the DB2 Version 9.7 32-bit database product or from DB2
64-bit servers when you install the DB2 Version 9.7 64-bit database
product. The instance bit size is determined by the operating system and
the DB2 Version 9.7 database product that you install, see “Support
changes for 32-bit and 64-bit DB2 servers” on page 27 for details.
v If you are performing a response file installation to automatically
upgrade a DB2 UDB Version 8 copy with multiple DB2 products
installed, your copy must be at DB2 UDB Version 8 FixPak 7 or later.
v Additional upgrade restrictions apply. Review the complete list.
Procedure
After upgrading the DB2 server, perform the recommended post-upgrade tasks
such as resetting the diagnostic error level to its pre-upgrade value, adjusting log
space size, and rebinding packages. In addition, verify that the upgrade of your
DB2 server was successful.
Upgrading instances
As part of the overall process of upgrading your DB2 server to DB2 Version 9.7,
you must upgrade your instances. On Linux and UNIX, you must manually
upgrade them. On Windows, you must manually upgrade them if you did not
choose to automatically upgrade your existing DB2 copy during the DB2 Version
9.7 installation.
Prerequisites
v You must have root authority on Linux and UNIX operating systems or
Local Administrator authority on Windows.
v You must install any DB2 add-on products that were installed in the
DB2 copy from which you are upgrading.
On Linux and UNIX, you must manually upgrade your instances. On Windows,
you must manually upgrade them if you did not choose to automatically upgrade
your existing DB2 copy during the DB2 Version 9.7 installation.
Procedure
To manually upgrade your existing instances to DB2 Version 9.7 using the
db2iupgrade command:
1. Determine if you can upgrade your existing instances to a DB2 Version 9.7 copy
that you installed by performing the following actions:
v Determine the node type. The following examples show how to use the GET
DBM CFG command to find out the node type:
v Review Table 7 on page 20 to determine the instance type using the node
type and whether instance upgrade is supported. In the previous example,
the node type is “Partitioned database server with local and remote clients”
therefore the instance type is ese and you can only upgrade to a DB2 Version
9.7 copy of DB2 Enterprise Server Edition. On Linux and UNIX operating
systems, you can upgrade to a DB2 Version 9.7 copy of DB2 Workgroup
Server Edition but your instance is recreated with type wse using default
configuration values.
If you cannot upgrade your instance to any DB2 Version 9.7 copy that you
installed, you need to install a copy of the DB2 Version 9.7 database product
that supports upgrade of your instance type before you can proceed with the
next step.
2. Disconnect all users, stop back-end processes and stop your existing instances
by running the following command:
db2stop force (disconnects all users and stops the instance)
db2 terminate (terminates back-end process)
Note:
a. Where DB2DIR is set to the location you specified during DB2 Version 9.7
installation, fencedID is the user name under which the fenced user-defined
functions (UDFs) and stored procedures will run, and InstName is the login
name of the instance owner. This example upgrades the instance to the
highest level for DB2 database product that you installed, use the -k option
if you want to keep the pre-upgrade instance type.
b. Where DB2PATH is set to the location you specified during DB2 Version 9.7
installation, user,password are the user name and password under which the
DB2 service will run, and InstName is the name of the instance.
If you did not install all DB2 add-on products that were installed in the DB2
copy from which you are upgrading, the instance upgrade fails and returns a
warning message. If you plan to install these products later on or you no
longer need the functionality provided by these products, use the -F parameter
to upgrade the instance.
The db2iupgrade command implicitly calls the db2ckupgrade command with
the -not1 parameter to verify that your local databases are ready for upgrade
and logs any errors in the db2ckupgrade.log log file. On Linux and UNIX
operating systems, the log file is created in the instance home directory. On
Windows operating systems, the log file is created in the current directory
where you are running the db2iupgrade command. The -not1 parameter
disables the check for type-1 indexes. You should verify that you do not have
type-1 indexes in your databases before upgrading the instance, refer to
“Converting type-1 indexes to type-2 indexes” on page 42. The db2iupgrade
does not run as long as the db2ckupgrade command reports errors. Check the
log file if you encounter any errors.
5. Log on to the DB2 server as a user with sufficient authority to start your
instance.
6. Restart your instance by running the db2start command:
db2start
7. Verify that your instance is running on to DB2 Version 9.7 by running the
db2level command:
db2level
The Informational tokens should include a string like ″DB2 v9.7.X.X″ where X
is a digit number.
Otherwise, you can drop your existing DAS and create a new DAS in DB2 Version
9.7. See “Creating a DB2 administration server (DAS) ” in Installing DB2 Servers.
The DB2 administration tools and the DAS have been deprecated in DB2 Version
9.7 and might be discontinued in a future release. If you plan to use the Data
Source Explorer in IBM Data Studio to perform database administration tasks, you
do not have to upgrade the DAS. Also, you can drop the DAS and the tools
catalog database.
Prerequisite
v Ensure that you have SYSADM authority, and root access on Linux and
UNIX operating systems or Local Administrator authority on Windows
operating systems.
Restriction
v You can have only one DAS per computer.
Procedure
Where DB2DIR and DB2PATH indicate the location that you specified during
DB2 Version 9.7 installation.
If the DAS is running, the dasmigr command stops the DAS before upgrade
and starts the DAS after upgrade.
3. If you created a tools catalog database and want to use your existing scripts
and schedules on the Version 9.7 DB2 Control Center, perform the following
steps:
v Upgrade the instance that owns the tools catalog database.
v Upgrade the tools catalog database.
v Log on to the DB2 server as a user with SYSADM authority and run the
db2tdbmgr command. This stops the scheduler before upgrading the tools
catalog database and restarts it after the upgrade. If you run this tool from a
remote client, you must stop the scheduler at the server before running this
command and restart it after running this command.
Use the UPDATE ADMIN CFG command if you need to change any
configuration settings for the tools catalog database.
You should upgrade your tools catalog whether you decide to upgrade your
DAS or not.
4. If you do not upgrade or do not have a tools catalog database, you can create
one in a Version 9.7 instance to use the task scheduling capability. See
“CREATE TOOLS CATALOG command ” in Command Reference.
You can now use the Control Center for remote administration of DB2 Version 9.7
instances, as well as pre-Version 9.7 instances.
Upgrading databases
After you upgraded your instances to DB2 Version 9.7, you need to upgrade each
database under each instance.
Prerequisites
v Ensure that you have SYSADM authority.
v Ensure that all the local databases that you want to upgrade are
cataloged.
v Ensure that you backed up your databases as indicated in the
pre-upgrade tasks.
v Ensure that you installed DB2 Version 9.7 and upgraded the instance to
Version 9.7.
Restrictions
v Review the upgrade restrictions for database upgrade.
Procedure
You must increase log file size and execute the UPGRADE DATABASE
command again. After the database upgrade is complete reset the value of
logfilsiz, logprimary, and logsecond database configuration parameters.
There are additional error codes that are returned by the UPGRADE
DATABASE command for specific cases not supported by database upgrade.
These cases are described in the upgrade restrictions.
5. If the UPGRADE DATABASE command returns the SQL1243W warning
message, you need to drop or rename the SYSTOOLS.DB2LOOK_INFO table.
Otherwise, the ALTER TABLE and COPY SCHEMA statements will fail to run.
Check if the SYSTOOLS.DB2LOOK_INFO table exists by running the
following command:
db2 "SELECT tabname, tabschema, definer FROM syscat.tables
WHERE tabschema = ’SYSTOOLS’ AND tabname = ’DB2LOOK_INFO’"
If you did not create this table, remove it by running the DROP command:
db2 DROP TABLE SYSTOOLS.DB2LOOK_INFO
6. If the UPGRADE DATABASE command returns the SQL1499W warning
message and writes the ADM4100W warning message with all the details to
the administration notification log, you have external unfenced routines on
Linux or UNIX that have no dependency on the DB2 engine libraries and the
UPGRADE DATABASE command redefines your external routines as
FENCED and NOT THREADSAFE. Also, the DB2_FENCED option is set to
’Y’ for all user-defined wrappers.
This command also generates a script called alter_unfenced_database-name.db2
with all the SQL statements to redefine external unfenced routines, altered
during the database upgrade, as NOT FENCED and THREADSAFE. This
script is created in the directory specified by the diagpath database manager
configuration parameter. If the diagpath parameter is not set, the script is
created in the INSTHOME/sqllib/db2dump directory where INSTHOME is
the instance home directory.
If you need to define your routines as NOT FENCED and THREADSAFE,
refer to “Upgrading C, C++, and COBOL routines” on page 190 for details on
how to safely run your routines in the new multithreaded database manager
and then use the generated script to redefine your routines.
7. If the UPGRADE DATABASE command returns the SQL1499W warning
message and writes the ADM4101W warning message to the administration
notification log, take note of the system catalog tables reported in the
ADM4101W message so that you collect statistics on these tables as part of the
post-upgrade tasks.
Alternatively, if you have sample files installed, run the testdata.db2 script:
cd samplefile-dir-clp
db2 connect to sample
db2 -tvf testdata.db2
This upgrade task describes the steps for direct upgrade to DB2 Version 9.7 from
DB2 Version 9.5, DB2 Version 9.1, or DB2 UDB Version 8 regardless of the instance
bit size. Review upgrading environments with specific characteristics and
determine which task applies better to your environment.
Procedure
Upgrading instances
As part of the overall process of upgrading your DB2 server to DB2 Version 9.7,
you must upgrade your instances. On Linux and UNIX, you must manually
upgrade them. On Windows, you must manually upgrade them if you did not
choose to automatically upgrade your existing DB2 copy during the DB2 Version
9.7 installation.
Prerequisites
v You must have root authority on Linux and UNIX operating systems or
Local Administrator authority on Windows.
v You must install any DB2 add-on products that were installed in the
DB2 copy from which you are upgrading.
v Before running the db2iupgrade command, the following steps are
recommended:
– Verify that databases are ready for DB2 upgrade.
– On Linux and UNIX operating systems, ensure that there is 20 MB of
free space in the /tmp directory. The instance upgrade trace file is
written to /tmp.
Restriction
v On Linux and UNIX operating systems, you must not set up the
instance environment for the root user. Running the db2iupgrade or the
db2icrt command when you set up the instance environment is not
supported.
v Review the upgrade restrictions for instance upgrade.
On Linux and UNIX, you must manually upgrade your instances. On Windows,
you must manually upgrade them if you did not choose to automatically upgrade
your existing DB2 copy during the DB2 Version 9.7 installation.
Procedure
To manually upgrade your existing instances to DB2 Version 9.7 using the
db2iupgrade command:
1. Determine if you can upgrade your existing instances to a DB2 Version 9.7 copy
that you installed by performing the following actions:
v Determine the node type. The following examples show how to use the GET
DBM CFG command to find out the node type:
Note:
a. Where DB2DIR is set to the location you specified during DB2 Version 9.7
installation, fencedID is the user name under which the fenced user-defined
functions (UDFs) and stored procedures will run, and InstName is the login
name of the instance owner. This example upgrades the instance to the
highest level for DB2 database product that you installed, use the -k option
if you want to keep the pre-upgrade instance type.
b. Where DB2PATH is set to the location you specified during DB2 Version 9.7
installation, user,password are the user name and password under which the
DB2 service will run, and InstName is the name of the instance.
If you did not install all DB2 add-on products that were installed in the DB2
copy from which you are upgrading, the instance upgrade fails and returns a
warning message. If you plan to install these products later on or you no
longer need the functionality provided by these products, use the -F parameter
to upgrade the instance.
The db2iupgrade command implicitly calls the db2ckupgrade command with
the -not1 parameter to verify that your local databases are ready for upgrade
and logs any errors in the db2ckupgrade.log log file. On Linux and UNIX
operating systems, the log file is created in the instance home directory. On
Windows operating systems, the log file is created in the current directory
where you are running the db2iupgrade command. The -not1 parameter
disables the check for type-1 indexes. You should verify that you do not have
type-1 indexes in your databases before upgrading the instance, refer to
“Converting type-1 indexes to type-2 indexes” on page 42. The db2iupgrade
does not run as long as the db2ckupgrade command reports errors. Check the
log file if you encounter any errors.
The Informational tokens should include a string like ″DB2 v9.7.X.X″ where X
is a digit number.
Otherwise, you can drop your existing DAS and create a new DAS in DB2 Version
9.7. See “Creating a DB2 administration server (DAS) ” in Installing DB2 Servers.
The DB2 administration tools and the DAS have been deprecated in DB2 Version
9.7 and might be discontinued in a future release. If you plan to use the Data
Source Explorer in IBM Data Studio to perform database administration tasks, you
do not have to upgrade the DAS. Also, you can drop the DAS and the tools
catalog database.
Prerequisite
v Ensure that you have SYSADM authority, and root access on Linux and
UNIX operating systems or Local Administrator authority on Windows
operating systems.
Restriction
v You can have only one DAS per computer.
Procedure
Where DB2DIR and DB2PATH indicate the location that you specified during
DB2 Version 9.7 installation.
Use the UPDATE ADMIN CFG command if you need to change any
configuration settings for the tools catalog database.
You should upgrade your tools catalog whether you decide to upgrade your
DAS or not.
4. If you do not upgrade or do not have a tools catalog database, you can create
one in a Version 9.7 instance to use the task scheduling capability. See
“CREATE TOOLS CATALOG command ” in Command Reference.
You can now use the Control Center for remote administration of DB2 Version 9.7
instances, as well as pre-Version 9.7 instances.
Upgrading databases
After you upgraded your instances to DB2 Version 9.7, you need to upgrade each
database under each instance.
Prerequisites
v Ensure that you have SYSADM authority.
v Ensure that all the local databases that you want to upgrade are
cataloged.
v Ensure that you backed up your databases as indicated in the
pre-upgrade tasks.
v Ensure that you installed DB2 Version 9.7 and upgraded the instance to
Version 9.7.
Restrictions
v Review the upgrade restrictions for database upgrade.
Procedure
where database-alias is the name or the alias of the database you want to
upgrade and the username and password to authenticate a user with
SYSADM authority.
4. If the UPGRADE DATABASE command fails and returns the SQL1704N error
message with a reason code that describes the cause of the failure, find this
SQL error code and determine the action to take from the list of the possible
solutions for each reason code. One of the most common causes of upgrade
failure is that the log file space is not large enough, in which case the
following error is returned:
SQL1704N Database upgrade failed. Reason code "3".
You must increase log file size and execute the UPGRADE DATABASE
command again. After the database upgrade is complete reset the value of
logfilsiz, logprimary, and logsecond database configuration parameters.
There are additional error codes that are returned by the UPGRADE
DATABASE command for specific cases not supported by database upgrade.
These cases are described in the upgrade restrictions.
5. If the UPGRADE DATABASE command returns the SQL1243W warning
message, you need to drop or rename the SYSTOOLS.DB2LOOK_INFO table.
Otherwise, the ALTER TABLE and COPY SCHEMA statements will fail to run.
Check if the SYSTOOLS.DB2LOOK_INFO table exists by running the
following command:
db2 "SELECT tabname, tabschema, definer FROM syscat.tables
WHERE tabschema = ’SYSTOOLS’ AND tabname = ’DB2LOOK_INFO’"
If you did not create this table, remove it by running the DROP command:
db2 DROP TABLE SYSTOOLS.DB2LOOK_INFO
6. If the UPGRADE DATABASE command returns the SQL1499W warning
message and writes the ADM4100W warning message with all the details to
the administration notification log, you have external unfenced routines on
Linux or UNIX that have no dependency on the DB2 engine libraries and the
UPGRADE DATABASE command redefines your external routines as
FENCED and NOT THREADSAFE. Also, the DB2_FENCED option is set to
’Y’ for all user-defined wrappers.
This command also generates a script called alter_unfenced_database-name.db2
with all the SQL statements to redefine external unfenced routines, altered
during the database upgrade, as NOT FENCED and THREADSAFE. This
script is created in the directory specified by the diagpath database manager
Alternatively, if you have sample files installed, run the testdata.db2 script:
cd samplefile-dir-clp
db2 connect to sample
db2 -tvf testdata.db2
If you installed multiple DB2 product components, if you are upgrading from a
32-bit Windows operating system to a 64-bit Windows operating system, or if you
are upgrading from a partitioned database environment, you must perform
upgrade tasks that include steps specific to that environment instead of the basic
DB2 server upgrade task.
Determine which of the following upgrade tasks apply to your DB2 server, and
perform this task:
v “Upgrading DB2 32-bit servers to 64-bit systems (Windows)”
v “Upgrading non-root installations” on page 77
v “Upgrading a DB2 server with multiple DB2 copies” on page 78
v “Upgrading to a new DB2 server” on page 80
v “Upgrading a DB2 server using online backups from a previous release” on page
83
v “Upgrading partitioned database environments” on page 84
v “Upgrading DB2 Text Search” on page 85
v “Upgrading DB2 Data Links Manager environments” on page 88
v “Upgrading a DB2 server with XML Extender to DB2 Version 9.7” on page 89
v “Upgrading DB2 servers in Microsoft Cluster Server environments” on page 91
v “Upgrading DB2 Connect servers” in Installing and Configuring DB2 Connect
Servers
v “Upgrading Query Patroller” in Query Patroller Administration and User’s Guide
v “Upgrading DB2 Net Search Extender” in Net Search Extender Administration and
User’s Guide
v “Upgrading DB2 Spatial Extender” in Spatial Extender and Geodetic Data
Management Feature User’s Guide and Reference
The other way is to upgrade to a new computer where DB2 Version 9.7 64-bit
database product is installed.
Prerequisites
v Ensure that you have Local Administrator authority.
v Ensure that the DB2 server is running 64-bit windows operating system.
v Review upgrade recommendations and disk space requirements.
v Perform pre-upgrade tasks.
To upgrade a pre-Version 9.7 DB2 32-bit server to a DB2 Version 9.7 64-bit server:
1. Log on to the DB2 server as a user with Local Administrator authority.
2. If you have multiples copies of DB2 UDB Version 8 32-bit server, DB2 Version
9.1 32-bit server, or DB2 Version 9.5 32-bit server, perform the following actions
to have all instances running under one DB2 copy:
v Update all your instances to run under one DB2 Version 8 32-bit server copy,
one DB2 Version 9.1 32-bit server copy, or one DB2 Version 9.5 32-bit server
copy. You can only update instances of the same version.
v If you have instances running on multiple pre-Version 9.7 copies of different
version, upgrade all instances to the highest release of pre-Version 9.7 copies.
For example, if you have a Version 8 and a Version 9.1 instance, upgrade
your Version 8 instance to the DB2 Version 9.1 32-bit server copy.
v Uninstall all the remaining DB2 server copies except the DB2 server copy
where all instances are running. You should have only one DB2 UDB Version
8 32-bit server copy, DB2 Version 9.1 32-bit server copy, or DB2 Version 9.5
32-bit server copy.
3. Install DB2 Version 9.7 32-bit database product and select the Work with
Existing option on the Install a Product panel. See “Installing DB2 servers
(Windows) ” in Installing DB2 Servers. Then in the Work with an existing
window, choose the DB2 copy name with the upgrade action. The selected DB2
copy is removed, and all your instances running on the selected DB2 copy and
your DB2 Administration Server (DAS) are automatically upgraded. Do not
install additional copies of 32-bit DB2 Version 9.7.
You will get a warning that recommends that you to run the db2ckupgrade
command if you have local databases. Ignore this warning and continue the
upgrade if you completed the pre-upgrade tasks. Otherwise, verify that your
databases are ready for DB2 upgrade before you continue with the installation.
4. Install DB2 Version 9.7 64-bit database product and select the Work with
Existing option on the Install a Product panel. See “Installing DB2 servers
(Windows) ” in Installing DB2 Servers . Then in the Work with an existing
window, choose the DB2 copy name with the upgrade action. This procedure
removes DB2 Version 9.7 32-bit database product, and upgrades your existing
32-bit instances to 64-bit instances.
5. If you want your applications to access DB2 Version 9.7 copy through the
default interface or if you upgraded your existing DB2 UDB Version 8 copy, set
the DB2 Version 9.7 copy as the DB2 default copy. See“Changing the default
DB2 and default IBM database client interface copy after installation
(Windows)” in Installing DB2 Servers .
6. Upgrade your databases.
7. If you want to have your instances running on multiples copies of DB2 Version
9.7, install additional DB2 Version 9.7 copies and issue the db2iupdt command
to run an instance under a different DB2 Version 9.7 copy.
Prerequisites
Restrictions
v You cannot upgrade a DB2 Version 9.5 root installation to a DB2 Version 9.7
non-root installation. You can upgrade databases from a DB2 Version 9.5 root
installation to a DB2 Version 9.7 non-root installation by restoring database
backups taken in the DB2 Version 9.5 root installation. Use the same process
described in “Upgrading to a new DB2 server” on page 80.
v On Linux and UNIX operating systems except for Linux on x86, your existing
32-bit or 64-bit instances are upgraded to DB2 Version 9.7 64-bit instances. The
operating system and DB2 Version 9.7 database product that you installed
determines the instance bit size, see “Support changes for 32-bit and 64-bit DB2
servers” on page 27 for details.
v Additional upgrade restrictions apply. Review the complete list.
Procedure
Where BackupDir is the backup directory for the configuration files of the
non-root installation prior to upgrade.
6. If the DB2 database product installation fails, review the installation log file to
determine the cause and how to resolve the issue before attempting the
installation again. By default, the installation log file is located in the /tmp
directory.
7. Upgrade databases.
8. Enable root-based features by running the db2rfe command.
9. If you had additional DB2 products installed in your Version 9.5 non-root copy,
install one DB2 product at a time.
You can have a DB2 server with multiple copies of DB2 database products Version
9.5 and 9.1 installed. On Linux and UNIX, you could also have multiples copies of
You can manually upgrade a pre-Version 9.7 instance at any fix pack level by
executing the db2iupgrade command from the target DB2 Version 9.7 copy of your
choice. After an instance is upgraded to a DB2 Version 9.7 copy, you cannot
upgrade it to another DB2 Version 9.7 copy. However, you can update an instance
between different DB2 Version 9.7 copies using the db2iupdt command.
Prerequisites
v Ensure that you have root access on Linux and UNIX operating systems
or Local Administrator on Windows.
v Ensure that you meet the installation requirements for DB2 database
products. The requirements for operating systems have changed.
v Review upgrade recommendations and disk space requirements.
v Perform pre-upgrade tasks.
Restrictions
v This procedure does not apply to upgrade from DB2 32-bit servers to
64-bit systems on Windows. Refer to “Upgrading DB2 32-bit servers to
64-bit systems (Windows)” on page 75 for details.
v On Linux and UNIX operating systems, you must not set up the
instance environment for the root user. Running the db2iupgrade or the
db2icrt command when you set up the instance environment is not
supported.
v Review the upgrade restrictions for DB2 servers.
Procedure
You can then run the following commands to successfully upgrade your
instances to DB2 Version 9.7:
Table 18. Instance upgrade command examples.
Upgrade Instance Commands
db2inst1 cd /opt/IBM/db2/V9.7/instance
./db2iupgrade -u db2fenc1 db2inst1
db2inst2 cd /opt/IBM/db2/V9.7/instance
./db2iupgrade db2inst2
db2inst3 cd /home/db2/myV9.7/instance
./db2iupgrade db2inst3
DB2 cd C:\Program Files\IBM\SQLLIB_97\BIN
db2iupgrade DB2 /u:db2admin1,password1
DB2_91 cd C:\Program Files\IBM\SQLLIB_97\BIN
db2iupgrade DB2_91 /u:db2admin2,password2
DB2_95 cd C:\Program Files\IBM\SQLLIB_97\BIN
db2iupgrade DB2_95 /u:db2admin3,password3
4. Optional: Upgrade the DB2 Administration Server if you want to keep your
existing configuration and to administer your DB2 Version 9.7 instances using
the Control Center.
5. Log on to the DB2 server as a user with SYSADM authority.
6. Upgrade databases.
After upgrading the DB2 server, perform the recommended post-upgrade tasks
such as resetting the diagnostic error level, adjusting log space size, and rebinding
packages. In addition, verify that the upgrade of your DB2 server was successful.
where sample is the database name and /db2/backups is the directory for the
database backup file.
If you performed an incremental offline database backup before upgrade, you
must have access to the most recent full offline database backup and the
incremental offline database backup and use an automatic incremental restore
to upgrade the database. See “Using incremental restore in a test and
production environment” in Data Recovery and High Availability Guide and
Reference. A manual incremental restore will fail because each RESTORE
DATABASE command tries to upgrade the database before the database is
completely recovered. The following example shows how to perform an
automatic incremental restore:
db2 RESTORE DATABASE sample INCREMENTAL AUTOMATIC
TAKEN AT timestamp WITHOUT PROMPTING
In a partitioned database environment, you must execute the RESTORE
DATABASE command in all database partitions starting with the catalog
partition first.
9. When the database was restored but the database was not upgraded, the
RESTORE DATABASE command returns the following error and includes the
upgrade error message with the reason code:
The error message SQL1704N indicates the database upgrade failed. Find this
SQL error code in the Message Reference Volume 2 to read the list of the
possible solutions for each reason code. In the previous example, tokens ″3″
means reason code 3 which indicates that the upgrade failed because the
database logs are full. If this error occurs, complete the following steps to
upgrade the database:
a. Increase the size of the log files.
b. Upgrade the database using the UPGRADE DATABASE command.
c. If the log file size is still not large enough, the following error is returned:
SQL1704N Database upgrade failed. Reason code "3".
You must increase the log file size and attempt to upgrade the database
again.
d. After the database upgrade is completed reset the size of the log files to
their pre-upgrade values.
10. Optional: Configure your new DB2 server to use the new resources available
by running the AUTOCONFIGURE command to calculate the buffer pool
sizes, and the database manager and database configuration parameters
values. The following example shows how to run this command to only
display recommended values for the sample database:
db2 CONNECT TO sample
db2 AUTOCONFIGURE USING MEM_PERCENT 80
WORKLOAD_TYPE complex
NUM_STMTS 1 TPM 73
ADMIN_PRIORITY performance
IS_POPULATED YES
NUM_REMOTE_APPS 15
ISOLATION CS
APPLY NONE;
If you choose not to run this command or not to apply the recommended
values, manually configure your DB2 server to use the new resources.
Otherwise, your databases might not perform as expected.
11. Restore any external routines that you backed up in the pre-upgrade tasks. See
“Backup and restore of external routine library and class files” in
Administrative Routines and Views.
12. Verify your database upgrade is successful. Connect to the upgraded
databases and issue a small query:
db2 CONNECT TO sample
Alternatively, if you have sample files installed, run the testdata.db2 script:
cd samplefile-dir-clp
db2 connect to sample
db2 -tvf testdata.db2
After upgrading the DB2 server, perform the recommended post-upgrade tasks
such as resetting the diagnostic error level, adjusting log space size, and rebinding
packages. In addition, verify that the upgrade of your DB2 server was successful.
Restrictions
Procedure
Procedure
After upgrading the DB2 server, perform the recommended post-upgrade tasks
such as resetting the diagnostic error level, adjusting log space size, and rebinding
packages. In addition, verify that the upgrade of your DB2 server was successful.
This task describes the procedure to upgrade DB2 Text Search to DB2 Version 9.7
by installing a new DB2 copy. On Windows operating systems, you also have the
option to upgrade a DB2 copy with the upgrade action in the Work with Existing
window. However, this option upgrades all the instances under the copy without
Text Search functionality.
Procedure
where DB2PATH is the location of the DB2 Version 9.7 copy and
INSTPROFDIR is the instance profile directory.
12. Review the values for all the properties that are configurable for DB2 Text
Search and compare with the values that you backed up to ensure the
properties have correct values by using the following command:
configTool printAll -configPath configuration-directory
13. If you disabled DB2 Text Search for rich text document support in step 2 on
page 86, setup and enable rich text document support by performing the
following tasks:
v Setup DB2 Text Search for rich text document support. See “Setting up DB2
Text Search for rich text document support” in DB2 Text Search Guide for
details
v Enable DB2 Text Search for rich text document support. See “Enabling DB2
Text Search for rich text document support” in DB2 Text Search Guide for
details
14. Verify that the upgrade was successful by starting the DB2 Text Search
instance service and printing the status for all collections, as follows:
db2ts "START FOR TEXT"
adminTool status -configPath configuration-directory
If you disabled DB2 Text Search for rich text document support in step 2 on
page 86, verify that rich text document support is enabled by issuing text
search queries and compare with pre-upgrade results.
After upgrading the DB2 server, perform the recommended post-upgrade tasks
such as resetting the diagnostic error level to its pre-upgrade value, adjusting log
space size, and rebinding packages. In addition, verify that the upgrade of your
DB2 server was successful.
To upgrade a DB2 server in the Data Links environment to DB2 Version 9.7:
1. Remove Data Links Manager from your databases.
2. If you installed DB2 Net Search Extender (NSE), you need to drop the
following UDFs :
db2 DROP SPECIFIC FUNCTION DB2EXT.DATALINKCONTENT1;
db2 DROP SPECIFIC FUNCTION DB2EXT.DATALINKCONTENT2;
db2 DROP SPECIFIC FUNCTION DB2EXT.DATALINKCONTENT4;
db2 DROP SPECIFIC FUNCTION DB2EXT.DATALINKCONTENT3;
These UDFs are always created by NSE for Data Links support, regardless of
Data Links Manager installation. Therefore you need to remove these
functions even when Data Links Manager is not installed.
If you plan to upgrade by restoring from a database backup, you must drop
these UDFs before you back up the database. You cannot restore from a
database backup if these UDFs are defined.
3. Drop all references to the DATALINK data type from tables, distinct types,
structured types, user-defined functions (UDFs), methods, and dependent
objects.
4. Uninstall Data Links Manager on the DB2 server that you want to upgrade.
5. Update your instances to remove the Data Links functionality by running the
db2iupdt command:
db2iupdt instance-name
6. Optional: Disable use of DB2 Data Links functionality by setting the datalinks
database manager configuration parameter to NO:
db2 UPDATE DBM CFG USING datalinks NO
After upgrading the DB2 server, perform the recommended post-upgrade tasks
such as resetting the diagnostic error level, adjusting log space size, and rebinding
packages. In addition, verify that the upgrade of your DB2 server was successful.
Restrictions
v Review the upgrade restrictions for DB2 servers.
Procedure
To upgrade a pre-Version 9.7 DB2 server with XML Extender functionality to DB2
Version 9.7:
1. Optional: Back up all DAD or DTD files from the db2xml.DTD_REF or
db2xml.XML_USAGE table for each database that you enabled for XML
Extender. The following example shows how to export the DTD files stored in
the DTD_REF table to a specific directory:
db2 EXPORT TO dtdfiles.del OF del LOBS TO dir-name
MODIFIED BY lobsinsepfiles
SELECT CONTENT FROM DB2XML.DTD_REF
The following example shows how to export the DAD files stored in the
db2xml.XML_USAGE table to a specific directory:
db2 EXPORT TO dadfiles.del OF del LOBS TO dir-name
MODIFIED BY lobsinsepfiles
SELECT DAD FROM DB2XML.XML_USAGE
2. Disable all XML columns that you enabled for XML Extender in all databases
by using the following command:
What to do next
After upgrading the DB2 server, perform the recommended post-upgrade tasks
such as resetting the diagnostic error level, adjusting log space size, and rebinding
packages. In addition, verify that the upgrade of your DB2 server was successful.
After upgrading the DB2 server, perform the recommended post-upgrade tasks
such as resetting the diagnostic error level, adjusting log space size, and rebinding
packages. In addition, verify that the upgrade of your DB2 server was successful.
Perform the following post-upgrade tasks that apply to your DB2 server:
1. If you set the diaglevel database manager configuration parameter to 3 or
higher as recommended in the pre-upgrade tasks for DB2 servers, reset this
parameter to the value set before the upgrade.
2. Adjust the log space size. If you changed your log space setting as
recommended in the pre-upgrade tasks for DB2 servers, reset the logfilsiz,
logprimary, and logsecond database configuration parameters to their
pre-upgrade values. Ensure that the amount of log space that you allocate is
adequate for your DB2 server.
3. Activate your database after upgrade to start your database and all necessary
database services.
4. Manage changes in DB2 server behavior. There are new registry variables,
new configuration parameters, and new default values for registry variables
and configuration parameters introduced in DB2 Version 9.7 that can impact
the behavior of DB2 server. There are also changes in physical design
characteristics of databases and changes to security that also have an impact.
5. Set up security to manage database audit in upgraded databases. If you
enabled the audit facility in your upgraded databases, grant security
administrator (SECADM) authority to allow users to configure and manage
database audit using DDL statements.
6. If the automatic collection of statistics failed on certain system catalog tables
during database upgrade, update the statistics on those system catalog tables.
See “Collecting catalog statistics” in Troubleshooting and Tuning Database
Performance.
7. Rebind packages in upgraded databases to validate packages and to use
updated statistics or new index information.
8. Migrate DB2 explain tables to retain explain table information that you
previously gathered.
9. If you have tables with XML columns that you created in a pre-Version 9.7
release, convert the XML storage object to the Version 9.7 format by re-creating
these tables to have access to new functions such as compression on XML data
and collection of statistics to estimate the inline length for XML columns.
10. Ensure that you meet system temporary table spaces page sizes requirements
to accommodate the largest row size in your result sets from queries or
positioned updates, and create a system temporary table space with a larger
page size if necessary.
11. If you obtained customized code page conversion tables from the DB2 support
service, copy all of the files for those tables from the DB2OLD/conv to
DB2DIR/conv, where DB2OLD is the location of your DB2 Version 9.1 or DB2
UDB Version 8 copy and DB2DIR is the location of your DB2 Version 9.7 copy.
You do not have to copy standard code page conversion tables.
If you upgraded your existing DB2 Version 9.1 or DB2 UDB Version 8 copy on
Windows operating systems, you can restore the customized code page
Perform the following post-upgrade tasks that apply to your DB2 products or
add-on features:
v If you upgrade a DB2 server running high availability disaster recovery (HADR)
replication, initialize HADR replication. See “Initializing high availability
disaster recovery (HADR)” in Data Recovery and High Availability Guide and
Reference. During upgrade to DB2 Version 9.7 in a high availability disaster
recovery (HADR) replication environment, a database role is changed from
primary to standard. Upgrade of standby databases is not supported because
these databases are in roll forward pending state.
v If you are using index extensions or spatial indexes and you upgraded from a
DB2 UDB Version 8 32-bit instance to a DB2 Version 9.7 64-bit instance, re-create
your index extensions or spatial indexes. If you are a Spatial Extender user,
review the upgrading the Spatial Extender environment task for details on how
to re-create your spatial indexes. The DB2 Spatial Extender and Geodetic Data
Management Feature User’s Guide and Reference is available by at
http://www.ibm.com/software/data/spatial/db2spatial/library.html.
After updating statistics for your upgraded databases, determine if index or table
reorganization is necessary by running the REORGCHK command. Table and
index reorganization can help you to improve performance.
At this point, you should resume all of your maintenance activities such as backing
up databases and updating statistics. You should also remove any DB2 Version 9.1
or DB2 UDB Version 8 copies that you no longer need.
where previous-value is the setting that you save before upgrade and sample is
the database name. In the pre-upgrade task, only the logprimary and the
logsecond parameters were changed. If you change the setting for the logfilsiz
parameter, you should restore the previous value.
If you enabled infinite active logging, disable it by running the following
commands:
db2 UPDATE DB CFG FOR sample using LOGARCHMETH1 previous-value
db2 UPDATE DB CFG FOR sample using LOGSECOND previous-value
where previous-value is the setting that you save before upgrade and sample is
the database name.
3. Optional: If you are upgrading from Version 9.1 or Version 8, increase your log
file size settings. The RID for log records has increased in the amount of 2
bytes, depending on the type of log record this could represent less than 2%
increase in the log record size.
In general, your current setting for log space should be sufficient to
accommodate this change. However, if you have a concern that your log space
setting is undersized, monitor the log space usage to find out the appropriate
size. The following example increases log file size by 5% to accommodate the
log record size increase:
db2 UPDATE DB CFG FOR sample using LOGFILSIZ previous-value*1.05
where previous-value is the setting that you save before upgrade and sample is
the database name.
4. Disconnect from the database that you upgraded:
db2 CONNECT RESET
LOGFILSIZ changes only take effect when the database is reactivated. All
applications must first disconnect from the database then deactivate and
activate the database again.
After upgrading your DB2 server, compare the values of your registry variables
and configuration parameters to their values before upgrade. If you find any
differences, take the time to understand them because they could alter the behavior
or performance of your applications. However, consider carefully whether to
disable any new functionality because it provides support for new resources
needed by the database manager. You should disable new functionality only if you
experience negative performance or unwanted behavior.
If you change the settings of any database manager configuration parameters that
are not dynamic, you might need to restart the instance so the new settings take
effect.
Database and instance-level auditing are separate since DB2 Version 9.5. You can
configure database auditing only by using DDL statements. You can continue to
use the db2audit command to configure instance auditing.
When you upgrade an instance, the audit configuration file is converted to the DB2
Version 9.7 format.
Procedure
Now, you can use the following DDL statements to manage database auditing:
v CREATE AUDIT POLICY
v ALTER AUDIT POLICY
v AUDIT
Packages will be implicitly rebound the first time an application uses them after
upgrading your database. To eliminate this overhead, you can rebind invalid
packages by running the REBIND command or the db2rbind command after the
upgrade process is complete. You must explicitly rebind inoperative packages.
Procedure
The all clause rebinds valid and invalid packages. Review the logfile file and
address any issues rebinding any database packages.
3. Verify that your DB2 server upgrade was successful. Test your applications and
tools to ensure the server is working as expected.
After you have rebound all your database packages, you will automatically be able
to take advantage of optimizer improvements. Refer to Chapter 22, “Upgrade
essentials for database applications,” on page 143 for details on the optimizer
improvements available in this release.
You can manually migrate your explain tables after you upgrade your database, or
you can later re-create the explain tables and gather new information.
where:
v dbname represents the database name. This parameter is required.
v explain_schema represents the schema name of the explain tables to be
migrated. This parameter is required.
v userid and password represent the current user’s ID and password. These
parameters are optional.
The explain tables belonging to the user ID that is running db2exmig, or that is
used to connect to the database, are migrated. The explain tables migration tool
renames the existing explain tables, creates a new set of tables using the
EXPLAIN.DDL file, and copies the contents of the existing explain tables to the
new tables. Finally, it drops the existing explain tables. The db2exmig command
preserves any user added columns on the explain tables.
2. Use Visual Explain to see a graphical display of a query access plan or the
db2expln command to see the access plan information in the migrated explain
tables.
The following new functions require the XML storage object to be in the Version
9.7 format:
v Row compression on tables with XML columns
v Collection of statistics to estimate the inline length for XML columns
v Upgrade from a single-partition database environment to a multi-partition
database environment
Procedure
To ensure that the maximum page size of your system temporary table space is
large enough for your queries or positioned updates:
1. Determine the maximum row size in your result sets from queries or positioned
updates. Monitor your queries or calculate the maximum row size using the
DDL statement that you used to create your tables.
2. Determine the page size for each of your system temporary table spaces and
the page size of the table spaces where the tables referenced in the queries or
updates were created by issuing the following query:
db2 "SELECT CHAR(TBSP_NAME,20) TBSP_NAME, TBSP_CONTENT_TYPE, TBSP_PAGE_SIZE
FROM SYSIBMADM.SNAPTBSP"
6 record(s) selected.
You can identify the system temporary table spaces in the output by looking
for table spaces that have the TBSP_CONTENT_TYPE column with a value of
SYSTEMP.
where maximum_row_size is the maximum row size for your result sets, and
maximum_row_length is the maximum length allowed based on the largest
page size of all of your system temporary table spaces. Review the ″SQL and
XML limits″ in SQL Reference, Volume 1 to determine the maximum row length
per table space page size.
If the maximum row size is less than the calculated value then your queries
will run in the same manner that they did in DB2 UDB Version 8, and you do
not have to continue with this task.
4. Create a system temporary table space that is at least one page size larger than
the table space page size where the tables were created if you do not already
have a system temporary table with that page size. For example, on the
Windows operating systems, if you created your table in a table space with 8
KB page size , create the additional system temporary table space using an 16
KB page size:
db2 CREATE SYSTEM TEMPORARY TABLESPACE tmp_tbsp
PAGESIZE 16K
MANAGED BY SYSTEM
USING (’d:\tmp_tbsp’,’e:\tmp_tbsp’)
If your table space page size is 32 KB, you can reduce the information that you
are selecting in your queries or split the queries to fit in the system temporary
table space page. For example, if you select all columns from a table, you can
instead select only the columns that you really required or a substring of
certain columns to avoid exceeding the page size limitation.
Version 9.7 target tables now include new columns for new monitor elements,
changed column data types, or longer column lengths for existing monitor
elements. Activating existing write-to-table event monitors after database upgrade
results in lost data because data cannot be collected in your existing target tables.
Prerequisite
Ensure that you have DBADM authority.
You only need to rename the target tables if you want to keep the existing data
that you collected.
3. Drop the write-to-table event monitors by issuing the following statement for
each event monitor:
DROP EVENT MONITOR write-to-table-event-monitor-name
4. Create your write-to-table event monitors.
5. If you created your write-to-table event monitors without the AUTOSTART
command parameter, activate the write-to-table event monitor to start collecting
data by issuing the SET EVENT MONITOR STATE statement as shown in the
following example:
SET EVENT MONITOR write-to-table-event-monitor-name 1
If you have applications that query target tables, you need to modify your
applications to manage the changes.
If you have DB2 command scripts with SQL statements, you can use the db2batch
benchmark tool command to execute the statements in these scripts, and gather
performance information details and statistics such as CPU time and elapsed time.
This tool can work in both a single partition database and in a multiple partition
database.
Prerequisite
Ensure that you have the same authority level that is required to run the
SQL statements in your script.
Procedure
Type Number Total Time Min Time Max Time Arithmetic Mean Geometric Mean
--------- ------ ---------- -------- -------- --------------- --------------
Statement 1 0.281284 0.281284 0.281284 0.281284 0.281284
Statement 2 0.073158 0.073158 0.073158 0.073158 0.073158
Statement 3 0.000823 0.000823 0.000823 0.000823 0.000823
Statement 4 0.155366 0.155366 0.155366 0.155366 0.155366
* Total Entries: 4
* Total Time: 0.510630 seconds
* Minimum Time: 0.000823 seconds
* Maximum Time: 0.281284 seconds
* Arithmetic Mean Time: 0.127658 seconds
* Geometric Mean Time: 0.040271 seconds
Procedure
Perform any of the following steps to adopt the specified Version 9.7 functionality
in your upgraded DB2 environment:
v Enable automatic storage in existing databases by issuing the following
statement:
ALTER DATABASE database-name ADD STORAGE ON storage-location
After enabling your databases for automatic storage, enable your existing DMS
table spaces for automatic storage. One way to do this enablement is to keep
existing containers intact and use automatic storage for future growth and
reduction operations by issuing the ALTER TABLESPACE statement:
ALTER TABLESPACE tablespace-name MANAGED BY AUTOMATIC STORAGE
If you want to convert existing containers in your table spaces to use automatic
storage, perform a redirected restore to re-create existing DMS table spaces as
automatic storage table spaces. See “Existing databases and table spaces can now
use automatic storage” in What’s New for DB2 Version 9.7.
In addition, you can now drop storage paths from an automatic storage database
as well as add them. After altering the database storage paths, you can
optionally rebalance the data in the automatic storage table spaces to better
utilize data striping and increase I/O throughput. The following example shows
how to rebalance an automatic storage table space:
ALTER TABLESPACE tablespace-name REBALANCE
The following SQL statement generates a list of all the regular and large
automatic storage table spaces for the currently connected database:
SELECT TBSP_NAME
FROM SYSIBMADM.SNAPTBSP
WHERE TBSP_USING_AUTO_STORAGE = 1 AND TBSP_CONTENT_TYPE IN (’ANY’,’LARGE’)
ORDER BY TBSP_ID
All of these enhancements provide greater control over your automatic storage
databases and table spaces.
v If you are using DMS table spaces in databases with or without automatic
storage enabled, start using new DMS table spaces created in Version 9.7 or
migrate existing DMS table spaces. Newly created DMS table spaces have
reclaimable storage enabled by default. You can trigger the extent movement
operation to relocate the maximum number of extents in them and reduce the
high water mark by using the following commands:
– For automatic storage DMS table spaces, use the ALTER TABLESPACE
statement with the REDUCE clause.
Prerequisites
v Review your overall approach to workload management in light of the DB2
WLM capabilities provided to determine the best implementation. Refer to
Workload management roadmap for a number of resources that are available to
get you started with DB2 WLM, including “Best Practices: DB2 Workload
Management.”
v Review the Chapter 11. Query Patroller and DB2 Governor in DB2 Workload
Manager for Linux, UNIX, and Windows available at http://
www.redbooks.ibm.com/redpieces/abstracts/sg247524.html for details about
migration from DB2 Governor to DB2 WLM.
v If your existing workload management solution includes Query Patroller, also
review “Migrating from Query Patroller to DB2 workload manager” on page
111.
Procedure
Prerequisites
v Ensure that you have root access.
v Ensure that you meet the installation requirements for Query Patroller. See
“Installation requirements for DB2 database products” in Installing DB2 Servers.
v Review your overall approach to workload management in light of the DB2
WLM capabilities provided to determine the best implementation. Refer to
Workload management roadmap for a number of resources that are available to
get you started with DB2 WLM, including “Best Practices: DB2 Workload
Management.”
Restriction
v There is no equivalent in DB2 WLM for the bypass options in Query Patroller.
Procedure
To migrate your applications from the XML Extender to the new native XML
storage support:
1. Upgrade your DB2 server where XML Extender is installed to DB2 Version 9.7.
2. Optional: Convert your databases to Unicode databases. See ″Converting
non-Unicode databases to Unicode″ in Globalization Guide . Although XML type
support is provided for non-Unicode databases in DB2 Version 9.7, using a
Unicode database eliminates the overhead of character conversion from the
database code page to the Unicode code page and preserves the data integrity
because there is no character conversion.
3. Add XML type columns to your tables. Use the ALTER TABLE command:
db2 ALTER TABLE table_name
ADD column_name XML [NOT NULL]
You only need to perform this step if you stored entire XML documents in its
native format in a column of data type CLOB, VARCHAR, XMLCLOB,
XMLVARCHAR, or XMLFILE.
4. Register your XML schemas in the XML Schema repository (XSR). See
″Registering and enabling XML schemas for decomposition″ in pureXML Guide .
5. Import XML documents into the table with the new XML data type column.
6. Convert your application to use annotated XML schema decomposition to store
content from XML documents in table columns, and the new SQL/XML
functions to construct or publish XML using the new XML data type.
Details on all these migration steps and examples of application migration are
available in the XML application migration series at http://www.ibm.com/
developerworks/views/db2/libraryview.jsp?search_by=viper+migration+series.
Performing an upgrade in a test environment will help you identify any issues
with the process and avoid having to reverse the upgrade.
Prerequisites
v Ensure that you have SYSADM authority, as well as root on Linux and
UNIX operating systems or Local Administrator authority on Windows
operating systems.
v Perform the following steps before upgrading your DB2 server:
– Review upgrade recommendations and disk space requirements.
– Take an offline full backup of all databases that you are going to
upgrade.
– Back up all database manager configuration parameter values for
each instance and all database configuration parameter values for
each database.
– Perform other pre-upgrade tasks that apply to your environment.
v Keep your existing pre-Version 9.7 DB2 UDB Version copy during
upgrade of your DB2 server. To do this, select the Install New option to
create a new copy when installing DB2 Version 9.7. Do not select the
Work with an existing option and then choose a pre-Version 9.7 copy
with the upgrade action that is available on Windows operating systems.
v Keep all the S*.MIG files in the active log path in case you want to
rollforward through these log files after reversing the upgrade. For
recoverable databases, the UPGRADE DATABASE command renames
log files in the active log path with the extension .MIG.
Restrictions
v This procedure applies only to DB2 server upgrade. It does not include
DB2 clients.
v In partitioned database environments you must perform this procedure
on all participating database partition servers. If you have several
database partitions on a partition server, execute tasks at the database
level, such as backup and restore, on each database partition.
v Additional upgrade restrictions apply. Review the complete list.
Procedure
To reverse a DB2 server upgrade, you need to perform the following steps:
1. Log on to the DB2 server as a user with SYSADM authority.
2. Drop all databases in DB2 Version 9.7 by running the DROP DATABASE
command.
3. Log on to the DB2 server as root on Linux and UNIX operating systems or a
user with Local Administrator authority on Windows operating systems.
Upgrading a client involves installing a Version 9.7 client copy and then upgrading
the client instance. A client instance allows you to connect your application to a
database and keeps the information about your client configuration, your cataloged
nodes, and your cataloged databases.
The current level of client that you have installed determines the way to proceed
with upgrade to DB2 Version 9.7. You can directly upgrade to Version 9.7 clients
from Version 8, Version 9.1, or Version 9.5 clients. If you have Version 7 or earlier
clients, migrate to any Version 8 client first.
Review Chapter 14, “Upgrade essentials for clients,” on page 121 for details about
upgrade support and options available for clients.
After you have a complete understanding of what upgrading your clients involves,
you can create your own plan to successfully upgrade your clients to DB2 Version
9.7.
In the upgrading client topics, the term pre-Version 9.7 clients refers to Version 9.5,
Version 9.1, and Version 8 clients.
Upgrade options for clients
The upgrade options vary depending on the type of client that you want to
install. The following table describes the upgrade options for each type of
Version 9.7 client:
Table 19. Upgrade options for Version 9.7 clients
Upgrading from Upgrading to Upgrade support details
v Version 8 DB2 Version 9.7 Data v Install the Version 9.7 Data Server Runtime Client
Run-Time Server Runtime as a new copy, and then manually upgrade your
Client Client(Windows) existing client instance.
v Version 8 DB2
Run-Time
Client Lite
v Version 9.1 DB2
Runtime Client
v Version 9.5
Data Server
Runtime Client
(Windows)
All Version 9.5, All Version 9.7 v Install a new copy of any Version 9.7 client, and
9.1, or Version 8 clients (Linux or then manually upgrade your existing client
clients (Linux or UNIX) instance.
UNIX)
Prepare for the upgrade of your clients by performing the following tasks:
1. Review the upgrade essentials for clients to determine which factors might
impact your client upgrade.
2. Review the supported and non-supported client configurations.
3. Plan your upgrade strategy. For example, you might need to upgrade your DB2
server first, then your clients.
4. Optional: Upgrade your DB2 servers.
5. Back up your client configuration information.
6. Optional: Upgrade your clients in a test environment to identify upgrade issues
and to verify that applications, scripts, tools and routines work as expected
before upgrading your production environment.
The BACKUP option creates the cfg_profile file as a configuration profile of the
client instance that contains all of the instance configuration information,
including the registry profile settings and information of a specific nature
relevant only to this client instance. You can also use the DB2 Configuration
Assistant to export your configuration profile.
where DB2PATH and DB2DIR are set to the location of the client copy that you
installed in the previous step, and InstName is the name of the instance.
3. Perform the pre-upgrade tasks that apply to your client.
4. Install a Version 9.7 client that you can upgrade to depending on the client that
you are upgrading from. Select the Install New option to install a new copy.
Refer to Table 19 on page 121 to determine what client product to install.
5. Upgrade your client instance by running the db2iupgrade command:
where DB2PATH and DB2DIR are set to the location of the Version 9.7 client
copy that you installed in the previous step, and InstName is the name of the
instance.
6. If you found any issues upgrading your test client instance, resolve these issues
and add the tasks to resolve these issues to your upgrade plan.
7. Perform post-upgrade tasks that apply to your client.
8. Verify the client upgrade was successful.
9. Test your applications, scripts, tools and maintenance procedures using the
Version 9.7 client.
When you install a Version 9.7 Data Server Client, you can choose to automatically
upgrade an existing pre-Version 9.7 client copy. Your existing client instances are
upgraded to a new Version 9.7 Data Server Client copy and the existing
pre-Version 9.7 client copy is removed. You can also choose to install a new copy
of Version 9.7 Data Server Client and then manually upgrade your existing client
instance after installation.
Procedure
To upgrade from an existing client copy to a Version 9.7 Data Server Client on
Windows:
1. Install Version 9.7 Data Server Client by running the setup command to launch
the DB2 Setup wizard. You have three choices:
v Select the Work with Existing option on the Install a Product panel. Then in
the Work with an existing DB2 copy window, select a client copy name with
action upgrade. The selected DB2 copy is removed and your client instance
is upgraded. You can choose this option, if you have an existing copy of
Version 8 Administration Client, Version 8 Application Development Client,
Version 9.1 Client, or Version 9.5 Data Server Client.
v Select the Install New option in the Install a Product panel. You should
choose this option to create a new copy of Version 9.7 Data Server Client and
keep your existing client copy. After installation, you must manually upgrade
the client instance to run on the Version 9.7 Data Server Client copy:
– Log on to the system as a user with Local Administrator authority.
– Run the db2iupgrade command:
"%DB2PATH%"\bin\db2iupgrade InstName
To create the same client connectivity environment you had, including the
database manager configuration parameter and DB2 profile registry settings,
run the db2cfimp command with the configuration profile that you save in the
pre-upgrade tasks.
4. Compare the upgraded database manager configuration parameter values with
the pre-upgrade values to ensure the changed values are compatible with your
database applications.
After upgrading your client, perform the recommended post-upgrade tasks for
DB2 clients, especially verifying upgrade for clients to ensure that your client
upgrade was successful.
After you install a Version 9.7 Data Server Runtime Client copy, you can manually
upgrade your existing client instance from a Version 8 DB2 Run-Time, Version 8
DB2 Run-Time Client Lite copy, Version 9.1 DB2 Runtime Client copy, or a Version
9.5 Data Server Runtime Client.
Prerequisites
v Ensure that you have SYSADM, SYSCTRL, or SYSMAINT authority and
Local Administrator authority to run the db2iupgrade and the db2icrt
commands.
v Review supported connectivity between clients and DB2 servers in
upgrade essentials for clients.
v Perform pre-upgrade tasks for clients.
Restrictions
v The bit size of the client instance is determined by the operating systems
where you install Version 9.7 client. The instance is 32-bit only in 32-bit
Windows on x86 or x64. The instance is 64-bit only in 64-bit Windows
on x64. Refer to Table 8 on page 27 for details.
Procedure
To upgrade from a Version 8 DB2 Run-Time, Version 8 DB2 Run-Time Client Lite,
or a Version 9.1 DB2 Runtime Client copy to Version 9.7 Data Server Runtime
Client on Windows:
1. Install Version 9.7 Data Server Runtime Client. See “Installing IBM data server
clients (Windows)” in Installing IBM Data Server Clients. Run the setup
command to launch the DB2 Setup wizard.
2. If you want your applications to use the Version 9.7 Data Server Runtime
Client copy through the default interface or if you upgraded your existing
Version 8 client copy, set the Version 9.7 Data Server Runtime Client copy as
the DB2 default copy. See “Changing the default DB2 and default IBM database
client interface copy after installation” in Installing DB2 Servers.
3. Log on to the system as a user with Local Administrator authority.
4. Upgrade your existing client instance by running the db2iupgrade command:
"%DB2PATH%"\bin\db2iupgrade InstName
where DB2PATH is set to the location that you specified during the Version 9.7
Data Server Runtime Client installation and InstName is the name of the
instance.
5. Optional: You can create a new Version 9.7 client instance instead of upgrading
an existing client instance. You only need to create a new Version 9.7 client
instance when you want to keep multiple client copies running on the same
machine. To create a new Version 9.7 client instance, run the db2icrt command
with the option -s:
To create the same client connectivity environment you had, including the
database manager configuration parameter and DB2 profile registry settings,
run the db2cfimp command with the configuration profile that you saved in
the pre-upgrade tasks.
6. Compare the upgraded database manager configuration parameter values with
the pre-upgrade values to ensure the changed values are compatible with your
database applications.
After upgrading your client, perform the recommended post-upgrade tasks for
clients, especially verifying upgrade for clients to ensure that your client upgrade
was successful.
where
where
DB2DIR
is set to the location you specified during the Version 9.7 client
installation.
InstName
Is the login name of the instance owner.
To create the same client connectivity environment you had, including the
database manager configuration parameter and DB2 profile registry settings,
run the db2cfimp command with the configuration profile that you backed up
in the pre-upgrade tasks.
5. Compare the upgraded database manager configuration parameter values with
the pre-upgrade values to ensure the changed values are compatible with your
database applications.
After upgrading your client, perform the recommended post-upgrade tasks for
clients, especially verifying upgrade for clients to ensure that your client upgrade
was successful.
Procedure
1. Install a Version 9.7 DSDRIVER copy. See “Installation methods for IBM data
server clients” in Installing IBM Data Server Clients for details.
2. If you have installed a Version 9.5 Data Server Client copy, you can use this
copy to configure the Version 9.7 DSDRIVER copy by issuing the following
command:
db2dsdcfgfill [ -i instance-name | -p instance-directory | -o output-dir ]
3. If you want your applications to use the Version 9.7 DSDRIVER copy through
the default interface, set the Version 9.7 DSDRIVER copy as the DB2 client
interface default. See “Changing the default DB2 and default IBM database
client interface copy after installation” in Installing DB2 Servers.
If you did not have a Version 9.1 or Version 9.5 DSDRIVER installed, the
Version 9.7 DSDRIVER copy is set as the client interface default.
What to do next
After upgrading your IBM Data Server Driver Package, perform only the
post-upgrade tasks for DB2 clients that apply.
The NetBIOS and SNA protocols are discontinued since DB2 Version 9.1. You must
recatalog, using a valid protocol, any nodes that you cataloged with the NetBIOS
and SNA protocols. If you try to connect to any databases cataloged on a node that
uses the NetBIOS or SNA protocol, your connection request returns an error
because these protocols are invalid.
If you have a Version 8 client installed on the same system as a DB2 Version 9.7
server or a Version 9.7 client installed on the same system as a DB2 Version 8
server, connections to the databases on the DB2 server from the DB2 client
cataloged using a local node are not supported. If you do not upgrade the Version
8 client or DB2 Version 8 server to DB2 Version 9.7, recatalog local nodes as
TCP/IP nodes.
If you want to use the trusted context capability on upgraded databases that are
cataloged using a local node, recatalog the nodes using the TCP/IP protocol.
Prerequisites
v Ensure that you have SYSADM or SYSCTRL authority.
v Ensure that you have network connectivity from the client to the DB2
server.
Restriction
The only protocols available in DB2 Version 9.7 are TCP/IP, Named Pipes,
and SSL.
Procedure
Redirect the output of this command to a file and keep it, because the
information is useful to recatalog your nodes.
2. Remove the local nodes that you want to recatalog and all nodes that use
NetBIOS or SNA protocol from the node directory by issuing the UNCATALOG
NODE command:
db2 UNCATALOG NODE node-name
3. Determine which databases use the nodes that you uncataloged in the previous
step by issuing the LIST DATABASE DIRECTORY command:
db2 LIST DATABASE DIRECTORY show detail > database_list.log
4. If you are going recatalog your nodes using a different node name, remove all
databases using those nodes by issuing the UNCATALOG DATABASE
command:
db2 UNCATALOG DATABASE database-name
5. Recatalog your nodes specifying TCP/IP as the protocol by issuing the
CATALOG TCPIP NODE command. If you use the original node name, you do
not have to recatalog your databases.
db2 CATALOG TCPIP NODE new-node REMOTE host-name
SERVER instance-svcename REMOTE_INSTANCE instance-name
You can determine the value of instance-svcename by looking at the value of the
svcename database manager configuration parameter for that instance.
6. If you did not recatalog your nodes using the original node names, recatalog
your databases using the new node name by issuing the CATALOG
DATABASE command.
db2 CATALOG DATABASE db-name [AS alias-db-name]
AT NODE new-node
If your applications and routines use any functionality that is deprecated in DB2
Version 9.7, you should plan how to remove this functionality from your
application code in the near future.
Also, you should consider adopting new functionality available in DB2 Version 9.7
to enhance functionality and improve performance.
Note:
1. $INSTHOME/sqllib/lib is a symbolic link to $INSTHOME/sqllib/lib32.
2. $INSTHOME/sqllib/lib is a symbolic link to $INSTHOME/sqllib/lib64.
where INSTHOME is your instance home directory, and DB2PATH is the
directory of your DB2 Version 9.7 copy.
During DB2 Version 9.7 installation, statements are added to the db2profile
and db2cshrc file to set the environment variables for the library search
path. These environment variables specify additional locations where DB2
shared libraries can be loaded at application run time, allowing your
application to run after you upgrade to DB2 Version 9.7 if you did not
specify the correct shared library path. The following table shows the
settings that you should have for the library search path environment
variables:
Table 22. Environment variable settings for library search paths
Environment variable and Operating
system Application Variable value
In base tables, the dependent MQTs output now includes a new field
called MQT Flags.
db2ckmig This command is deprecated and might be removed in a future
release. Use the db2ckupgrade command instead.
db2ckupgrade This command replaces the db2ckmig command.
This command checks for type-1 indexes and generates a script file
using the REORG TABLE command to convert type-1 indexes to
type-2 indexes. Type-1 indexes are not supported in DB2 Version 9.7.
See “Converting type-1 indexes to type-2 indexes” on page 42 for
details.
This command now requires that the instance owning the databases
that you want to verify is running. You no longer have to stop the
instance to run this command. If the instance is not started, the
db2ckupgrade command returns the SQL1032N error message.
db2dart The /DD parameter now includes inline length data as part of the
formatted table data.
db2expln, Due to changes in the DB2 authorization model, the SYSADM group
db2exmig, is no longer authorized to perform these commands. The UPGRADE
db2jdbcbind, DATABASE command grants DBADM authority to the SYSADM
db2sqljbind, group so that there is no upgrade impact. However, for these
db2sqljcustomize commands, you should review all of the changes in authorization
and and grant any required authorization to users.
db2rbind
If you create databases in DB2 Version 9.7, you have to grant the
required authorization to users that need to run these commands or
grant DBADM authority to the SYSADM group to maintain the same
authorization as in previous releases.
db2gpmap The output generated by this command is larger due to the increase
of the distribution map size.
For partitioned tables, the -tcbstats parameter output now shows the
new PartID column to indicate the data partition ID in the TCB
Index Information section and the TCB Index Stats section.
db2secv82 The db2secv82 command is now discontinued. Use the db2extsec
command instead to set the permissions for DB2 objects such as files,
directories, network shares, registry keys, and services.
db2uiddl The db2uiddl command is now discontinued. This command
generated a script with CREATE UNIQUE INDEX statements to
convert unique indexes created on your database before DB2 UDB
Version 5. If you ran the db2uiddl command after you upgraded
your databases to a pre-Version 9.7 DB2 release, you do not have to
run this command again before your databases are upgraded to DB2
Version 9.7.
If you are converting type-1 indexes to type-2 indexes, you are also
converting the unique indexes created on your database before DB2
UDB Version 5 and you do not have to run the db2uiddl command.
db2_deinstall If you specify the -F TEXT_SEARCH parameter and you have one or
more instances configured as DB2 Text Search instance services on
the DB2 copy that you are uninstalling, this command returns the
DBI1325E error message.
installFixPack If you have one or more instances configured as DB2 Text Search
instance services on the DB2 copy that you updating, this command
issues the db2ts STOP FOR TEXT command for each instance to stop
the Text Search instance service. If stopping the Text Search instance
service fails, the installFixPack command returns DBI1325E error
message.
You must also manage changes to the IMPORT and LOAD command
that impact importing or loading files that you exported in previous
releases. Refer to the Command Reference for details about changes to
the IMPORT and LOAD command.
If you issue the LOAD command with the REPLACE mode and the
RESETDICTIONARY keyword on a table that has XML data in a
Version 9.7 XML storage object and row compression enabled, this
command now builds a compression dictionary for the XML data in
addition to the dictionary for the table data. The compression
dictionary for the XML data is stored in the XML storage object
object.The automatic compression dictionary creation (ADC) now
builds a compression dictionary for the XML data as part of the table
data population operations performed by the INSERT, IMPORT with
mode INSERT, LOAD with mode INSERT, and REDISTRIBUTE
DATABASE PARTITION GROUP commands.
MIGRATE This command is deprecated. Use the UPGRADE DATABASE
DATABASE command instead.
REDISTRIBUTE If you issue this command without the NOT ROLLFORWARD
DATABASE RECOVERABLE parameter, ADC now builds a compression
PARTITION dictionary for the XML data in a Version 9.7 XML storage object on
GROUP all database partitions without a dictionary as part of the table data
population operations performed by this command provided that
row compression is enabled. After the compression dictionary is
built, XML data is compressed as well as table data.If you issue this
command with the NOT ROLLFORWARD RECOVERABLE
parameter, ADC now builds a compression dictionary for the XML
data in a Version 9.7 XML storage object on new database partitions
without a dictionary as part of the table data population operations
performed by this command. ADC will not build a compression
dictionary on existing database partitions that receive new data.
When you run this command on tables with LOB columns, it now
collects statistics for the average length of column and number of
null values in a column. Refer to the Command Reference for
additional details.
The changes to SQL statements include new default behaviors and modifications to
statement output. In addition, some statements are discontinued. The following
table lists the changes that impact applications and scripts:
Table 25. Changes to SQL statements
SQL statement Summary of changes with upgrade impact
ALTER Due to changes in the DB2 authorization model, the SYSADM group
FUNCTION, is no longer authorized to run these statements. The UPGRADE
ALTER DATABASE command grants DBADM authority to the SYSADM
HISTOGRAM group so that there is no upgrade impact. However, for these
TEMPLATE, statements, you should review all of the changes in authorization
ALTER METHOD, and grant any required authorization to users.
ALTER
NICKNAME, If you create databases in DB2 Version 9.7, grant the required
ALTER authorization to users that need to run these statements or explicitly
PROCEDURE, grant DBADM authority to the SYSADM group to maintain the same
ALTER authorization as in previous releases.
SEQUENCE,
ALTER SERVER, Soft invalidation is supported on ALTER FUNCTION and ALTER
ALTER TABLE, VIEW statements when the DB2_DDL_SOFT_INVAL registry
ALTER TYPE variable is set to ON. Refer to “Automatic invalidation and
(Structured), revalidation of database objects” in Database Administration Concepts
ALTER USER and Configuration Reference for details about soft invalidation
MAPPING, semantics.
ALTER VIEW,
ALTER WRAPPER,
and
ALTER XSROBJECT
ALTER SERVICE Due to changes in the DB2 authorization model, the SYSADM group
CLASS, is no longer authorized to run these statements. The UPGRADE
ALTER DATABASE command grants DBADM authority to the SYSADM
THRESHOLD, group so that there is no upgrade impact. However, for these
ALTER WORK statements, you should review all of the changes in authorization
ACTION SET, and grant any required authorization to users.
ALTER WORK
CLASS SET, However, if you create databases in DB2 Version 9.7, grant the
ALTER required authorization to users that need to run these statements or
WORKLOAD, explicitly grant DBADM or WLMADM authority to the SYSADM
CREATE group to maintain the same authorization as in previous releases.
HISTOGRAM
TEMPLATE,
CREATE SERVICE
CLASS,
CREATE
THRESHOLD,
CREATE WORK
ACTION SET,
CREATE WORK
CLASS SET, and
CREATE
WORKLOAD
If you issue the ALTER TABLE statement with the COMPRESS YES
clause in a table with XML columns created in a pre-Version 9.7
release, only table data compression is supported. To convert the
XML storage object to the new Version 9.7 format that supports
compression on XML data, re-create the table. See “Converting XML
storage objects to the Version 9.7 format” on page 100 for details.
You can now add columns with the XML type to MDC tables. In
previous releases, the SQL1242N error message with reason code 1
was returned.
When you create indexes for partitioned tables, they are now created
as partitioned indexes by default. If you must create non-partitioned
indexes, use the NOT PARTITIONED clause. Partitioned indexes are
not supported for spatial indexes, indexes over XML data, and
unique indexes with index key columns that are not a superset of the
range partitioning key columns.
In SQL procedures, when you assign XML data to input and output
parameters of XML type or local variables of XML type, the XML
data is now passed by reference. In previous releases, the XML data
was passed by value. Therefore, some operations using XML data
can return results that are different from the results returned by the
same operations in previous releases.
You can now specify columns using the XML type when creating
partitioned tables. In previous releases, the SQL1242N error message
with reason code 2 was returned. XML data placement on a
partitioned table follows the long data placement rules. The XML
storage objects and the XML regions indexes are partitioned in the
same manner as table data.
You can now specify columns with the XML type and use the
ORGANIZE BY clause in the CREATE TABLE statement. If you
specify columns with the XML type in the ORGANIZE BY clause,
you will receive the SQL0350N error message. In previous releases,
the SQL1242N error message with reason code 1 was returned.
The NOT LOGGED option only applies to LOB data that is not
inlined. In upgraded databases, the LOB data is implicitly inlined
when the length is less than the LOB descriptor size. In this case, the
NOT LOGGED option does not apply to implicitly inlined LOB data.
Refer to the SQL Reference, Volume 2 guide for details about any of the statements.
New ATTR_TYPEMODULENAME,
SOURCE_TYPEMODULENAME, TARGET_TYPEMODULENAME,
TYPEMODULENAME, columns are added.
SYSCAT.BUFFERPOOLS New column NUMBLOCKPAGES is added.
The SCALE column now has a value for TIMESTAMP data type to
indicate the number of digits of fractional seconds.
Use the new db2GetPmap API to read the distribution map. See
“Upgrade impact from DB2 API changes” on page 149 for details.
SYSCAT.ROUTINEDEP New columns BMODULEID, BMODULENAME,
ROUTINEMODULEID, and ROUTINEMODULENAME are added.
If you are using the default setting for SQL path, function
calls to DOUBLE resolves to SYSIBM.DOUBLE over
SYSFUN.DOUBLE. The SYSFUN.DOUBLE is still available.
If you rely on the previous release behavior for this
function, fully qualify references to SYSFUN.DOUBLE.
LONG_VARGRAPHIC, LONG_VARGRAPHIC and LONG_VARCHAR scalar
LONG_VARCHAR functions are deprecated. Although the use of these scalar
functions is still supported in the current release, consider
using other scalar functions such as CHAR, VARCHAR, and
CLOB. The LONG VARCHAR and LONG VARGRAPHIC
data types are deprecated and might be removed in a future
release. See Table 15 on page 35 for details.
To convert the XML storage object to the new Version 9.7 format
that supports this function, re-create the table. The new
SYSPROC.ADMIN_MOVE_TABLE system-defined procedure
allows you to re-create the table while the data remains online
and available for access. See “ Moving tables using the
ADMIN_MOVE_TABLE procedure” in Data Movement Utilities
Guide and Reference.
AUDIT_ARCHIVE, In DB2 Version 9.7, the UPGRADE DATABASE command revokes
AUDIT_DELIM_EXTRACT, the EXECUTE privilege from PUBLIC on the audit routines,
AUDIT_LIST_LOGS AUDIT_LIST_LOGS, AUDIT_DELIM_EXTRACT, and
AUDIT_ARCHIVE. For each authorization ID holding SECADM
authority, the UPGRADE DATABASE command explicitly grants
the EXECUTE privilege on the audit routines by granting the
SYSROLE_AUTH_SECADM system role. You need to explicitly
grant the EXECUTE privilege on these audit routines to any users
that do not hold SECADM authority but need to call these
routines.
DBCFG, Selecting from the DBMCFG view or the GET_DBM_CONFIG
GET_DB_CONFIG table function now returns new database configuration manager
parameters listed in Table 13 on page 32.
DBMCFG, Selecting from the DBMCFG view or the GET_DBM_CONFIG
GET_DBM_CONFIG table function now returns new database configuration manager
parameters listed in Table 11 on page 31.
If you are upgrading from DB2 Version 9.1 or DB2 UDB Version 8, the following
additional system catalog changes between pre-Version 9.7 releases can also impact
your applications and scripts:
v System catalog changes between DB2 Version 9.5 and DB2 Version 9.1.
v System catalog views and system-defined routines changes between DB2 Version
9.1 and DB2 UDB Version 8.
In DB2 Version 9.7 64-bit instances, Java external routines require that the
jdk_path parameter is set to a 64-bit SDK for Java installation path to run
successfully. A DB2 Version 9.7 64-bit instance cannot load a 32-bit JVM.
The IBM Software Developer’s Kit (SDK) for Java 1.4.2 is deprecated and
might be discontinued in a future release.
Starting with DB2 Version 9.5, the default JDBC driver to run JDBC
routines is the IBM Data Server Driver for JDBC and SQLJ. See
“Upgrading Java routines” on page 192 for details on how to manage this
change.
Upgrade of routines from DB2 Version 9.1 or DB2 UDB Version 8
Prepare for the upgrade of your database applications and routines by performing
the following tasks:
1. Review upgrade essentials for database applications to determine which
changes might impact your database applications.
2. Review upgrade essentials for routines to determine which changes might
impact your routines.
3. Plan your upgrade strategy.
4. Upgrade your operating system to a supported level if necessary.
5. Upgrade your development software to a supported level if necessary.
6. Perform benchmark tests on your database applications and routines in your
production environment and save these baseline results to compare with
benchmark test results after the upgrade.
7. Optional: Upgrade your client or install a Version 9.7 application driver if your
application requires one. Although DB2 Version 9.7 server provides connectivity
support for earlier clients, using a Version 9.7 client eliminates any limitations
and incompatibilities between releases.
8. Test your database applications in a DB2 Version 9.7 testing environment. If
testing is successful, you do not need to upgrade your applications. However,
review the upgrading database applications task and consider performing any
steps that can help you improve performance.
9. Test your routines in a DB2 Version 9.7 testing environment. If testing is
successful, you do not need to upgrade your routines. However, review the
upgrading routines task and consider performing any steps that can help you
improve performance.
You only need to modify your application code to manage changes in DB2 Version
9.7 that impact your applications, to remove the use of deprecated or discontinued
functionality in DB2 Version 9.7, or to use new functionality.
Prerequisites
v Ensure that you have access to a DB2 Version 9.7 server, including
instances and databases. The DB2 server can be part of a testing
environment.
v Ensure that you meet the installation requirements for DB2 database
products.
v Ensure that the development software is at a version level that is
supported by DB2 database products.
v Perform the pre-upgrade tasks for database applications.
Restriction
This procedure only applies to database applications programmed in C,
C++, COBOL, FORTRAN, Java, Perl, PHP, REXX, and .NET languages.
Procedure
After upgrading your embedded SQL applications, perform the remaining steps in
the upgrading database applications task.
After upgrading your CLI applications, perform the remaining steps in the
Chapter 25, “Upgrading database applications,” on page 179 task.
Upgrading Java applications that use IBM Data Server Driver for JDBC
and SQLJ
Upgrading Java applications that use previous releases of the IBM Data Server
Driver for JDBC and SQLJ Version 4.7 or Version 3.57 involves managing the
changes between different releases of this driver and the changes in DB2 Version
9.7 that can impact these applications.
Prerequisites
v Review the upgrade essentials for applications to identify key changes
that might impact your Java database applications.
Procedure
To upgrade your Java database applications using the IBM Data Server Driver for
JDBC and SQLJ to DB2 Version 9.7:
1. Install the IBM Data Server Driver for JDBC and SQLJ Version 4.7 or Version
3.57:
v If you use methods in JDBC 4.0 or earlier specifications in your applications,
install IBM Data Server Driver for JDBC and SQLJ Version 4.7.
v If you use methods in JDBC 3.0 or earlier specifications in your applications,
install IBM Data Server Driver for JDBC and SQLJ Version 3.57.
2. If you are upgrading applications that use the IBM DB2 Driver for JDBC and
SQLJ before Version 3.57, update your applications to manage the following
differences between this driver and the IBM Data Server Driver for JDBC and
SQLJ Version 4.7 or Version 3.57:
v The IBM Data Server Driver for JDBC and SQLJ Version 4.7 returns a
different result set than previous releases of this driver for the
ResultSetMetaData.getColumnName and ResultSetMetaData.getColumnLabel
methods to conform to the JDBC 4.0 standard. If you need these methods to
return the same result set returned with the IBM DB2 Driver for JDBC and
SQLJ before Version 4.7, you can set the
useJDBC4ColumnNameAndLabelSemantics property to DB2BaseDataSource.NO
in the Connection or DataSource object.
v The IBM Data Server Driver for JDBC and SQLJ allows you to invoke the
commit () or rollback () methods if the connection is in auto-commit mode
and your application does not receive an exception anymore.
v If the JNDI store is not available due to JNDI bind or lookup failures, then
the IBM Data Server Driver for JDBC and SQLJ attempts a connection to the
standard server and port properties of a datasource even when the
datasource is configured to use JNDI for client reroute primaries and
alternates. The driver now accumulates warnings to indicate these failures
with the original message from the exception appended. In previous releases,
the driver did not use this information and threw exceptions.
3. If you are upgrading applications that use IBM DB2 Driver for JDBC and SQLJ
before Version 3.1, update your applications to manage the following
differences between this driver and the IBM Data Server Driver for JDBC and
SQLJ Version 4.7 or Version 3.57:
v If your applications connect to a DB2 server that supports progressive
streaming, also known as dynamic data format, retrieving LOBs using
Chapter 25. Upgrading database applications 183
progressive streaming is enabled by default starting with IBM DB2 Driver for
JDBC and SQLJ Version 3.2 to provide improved performance to your Java
database applications. You need to manage any changes in semantic that
might impact your applications. Refer to LOBs in JDBC applications with the
IBM Data Server Driver for JDBC and SQLJ in Developing Java Applications for
details.
v If your application connects to a DB2 server that supports progressive
streaming, and you want to continue using LOB locators instead of LOB
retrieval using progressive streaming, set the progressiveStreaming property
to:DB2BaseDataSource.NO in the Connection or DataSource object.
v As of Version 3.0, you need to set the sendDataAsIs property to indicate if
you want the driver to do the data type conversion or not. To maintain the
conversion of input parameter values to the target column data types, which
was the default behavior before IBM DB2 Driver for JDBC and SQLJ Version
3.0, set the sendDataAsIs property to false. If you set the sendDataAsIs
property to true, the driver converts to the data type indicated by the
setXXX method regardless of the information in the Connection or
DataSource object.
v If you use the JDBC 1.0 method to update or delete data on a database
server that supports multiple-row FETCH and you intent to update or delete
a single row, modify your applications to use the method described in
Specifying updatability, scrollability, and holdability for ResultSets in JDBC
applications in Developing Java Applications to avoid updating or deleting
multiple rows.
4. If you changed your Java application source code, rebuild your Java
application. Refer to one of the following tasks in Developing Java Applications
for details on how to rebuild them:
v Building JDBC applications
v Building SQLJ applications
Upon completion of this task, your Java application should perform successfully
using DB2 Version 9.7.
After upgrading your Java applications, perform the remaining steps in the
upgrading database applications task.
After upgrading your Java applications, perform the remaining steps in the
upgrading database applications task.
You do not have to upgrade ADO.NET applications that use the OLE DB .NET
Data Provider or the ODBC .NET Data Provider to run with DB2 Version 9.7.
However, upgrading these applications to the Data Server Provider for .NET can
be beneficial for the following reasons:
v The Data Server Provider for .NET has a far more extensive set of APIs than the
OLE DB and ODBC .NET data providers.
v Access to the DB2 database development productivity tools integrated with
Visual Studio.
v Use of the Data Server Provider for .NET can bring significant performance
improvements.
Prerequisites
v Ensure that you have access to a DB2 Version 9.7 server, including
instances and databases. The DB2 server can be part of a testing
environment.
After upgrading your ADO.NET applications, perform the remaining steps in the
upgrading database applications task.
Upgrading scripts
Upgrading your existing scripts that use DB2 command line processor (CLP)
commands, DB2 system commands or SQL statements involves managing the
changes between DB2 Version 9.7 and previous releases related to SQL statements,
DB2 CLP and system commands, SQL Administrative views and routines, built-in
functions, and catalog views.
Prerequisites
v Ensure that you have access to a DB2 Version 9.7 server, including
instances and databases.
v Ensure that a DB2 Version 9.7 client is installed.
v Perform the previous steps in the upgrading database applications task.
Restriction
This procedure only applies to scripts that use DB2 CLP commands, DB2
system commands or SQL statements.
Procedure
To upgrade your scripts with DB2 CLP commands to DB2 Version 9.7:
1. Run your scripts to detect any incompatibilities with DB2 Version 9.7. If your
scripts run successfully, you do not need to perform any additional steps.
However, consider performing the remaining steps to remove deprecated
functionality in DB2 Version 9.7 before they become discontinued or to use new
command functionality.
2. Remove the DB2 CLP and system commands that display or update registry
variables and configuration parameters that are deprecated or discontinued:
v Deprecated and discontinued registry variables
v Deprecated and discontinued database manager configuration parameters.
v Deprecated and discontinued database configuration parameters
3. If your scripts perform snapshot or event monitoring, you need to modify your
scripts to remove references to discontinued monitor elements or use a new
name when they have been replaced by a new monitor element.
4. Determine the upgrade impact from system catalog changes. Using the changed
views and routines requires that you:
v Change the view names on your queries.
After upgrading your scripts, perform the remaining steps in the upgrading
database applications task.
You do not need to modify your 32-bit database applications if you linked them to
the $INSTHOME/sqllib/lib32 shared library path on Linux and UNIX or the
DB2PATH\lib\Win32 shared library path on Windows, where INSTHOME is the
instance home directory and DB2PATH is the location of the DB2 copy.
Prerequisites
v Ensure that you have access to a DB2 UDB Version 8 32-bit instance that
you upgraded to a DB2 Version 9.7 64-bit instance that includes 32-bit
shared libraries.
v Ensure that the development software is at a version level that is
supported by DB2 database products.
v Perform the previous steps in the upgrading database applications task.
Restrictions
v This procedure applies only to 32-bit database applications programmed
in C/C++, COBOL, FORTRAN, and REXX.
Procedure
After upgrading your 32-bit database applications, perform the remaining steps in
the upgrading database applications task.
Test your routines in a DB2 Version 9.7 testing environment. If they run
successfully, you are not required to change them. You only need to modify your
routines to manage any changes between releases, to remove the use of
discontinued or deprecated functionality in DB2 Version 9.7, or to use new
functionality.
Prerequisites
v Review upgrade essentials for routines to identify any changes that
apply to your routines.
v Ensure that you have access to upgraded DB2 Version 9.7 databases.
These can be test databases.
v Ensure that you meet the installation requirements for DB2 database
products. See “Installation requirements for DB2 database products” in
Installing DB2 Servers .
v Ensure that the development software is at a version level that is
supported by DB2 database products.
v Perform the pre-upgrade tasks for routines.
v Ensure that you have the necessary authorizations and privileges to use
the ALTER FUNCTION or ALTER PROCEDURE statements. The
authorizations allowed are listed in the SQL Reference, Volume 2.
Restriction
This procedure only applies to SQL routines and external routines
programmed in C/C++, COBOL (procedures only), Java, and .NET
languages.
Procedure
After upgrading your routines, perform the recommended post-upgrade tasks for
routines.
After upgrading your C, C++, or COBOL routines, perform the remaining steps in
the upgrading routines task.
Use the -i parameter instead of the -g parameter, to apply the registry variable
setting to a specific instance.
3. Test your Java routines in your DB2 Version 9.7 database. If testing is successful
and your Java routine perform as expected, you do not need to perform any
additional steps.
4. If you are using the IBM Data Server Driver for JDBC and SQLJ and found any
differences in the behavior of your Java routines, review “Upgrading Java
applications that use IBM Data Server Driver for JDBC and SQLJ” on page 182
to learn how to manage those differences.
5. If the pre-upgrade value of the jdk_path parameter was the installation path of
SDK for Java 1.4.2, manage any differences in behavior between SDK for Java
1.4.2 and SDK for Java 6.
6. Explicitly define your Java routines as fenced using the ALTER FUNCTION or
ALTER PROCEDURE statement with the FENCED clause. All Java routines run
as fenced, regardless of how you defined them, but defining your Java routine
definitions as fenced improves routine manageability and maintenance.
7. Optional: If your Java routine class is included within a JAR file that has been
installed into a DB2 instance using a specific JAR file ID, ensure that the Java
class is resolved more quickly by the DB2 database manager by specifying the
JAR file ID as part of the EXTERNAL NAME clause in the routine definition.
Use the ALTER PROCEDURE or ALTER FUNCTION statement to update the
EXTERNAL NAME clause if required.
8. If you created projects in the Development Center to develop your Java
routines, upgrade any existing projects to the Data Studio using the upgrade
wizard.
After upgrading your Java routines, perform the remaining steps in the upgrading
routines task.
After upgrading your .NET CLR routines, perform the remaining steps in the
upgrading routines task.
If you upgraded from a DB2 UDB Version 8 instance to a DB2 Version 9.7 instance
with the same bit size, your routines will run successfully in DB2 Version 9.7.
However, if you created your SQL procedures in DB2 UDB Version 8.1 and
upgraded from a 32-bit instance to a DB2 Version 9.7 64-bit instance, you must
drop and re-create those SQL procedures as part of the manual upgrade process.
Prerequisites
v Ensure that you have access to your upgraded database on DB2 Version
9.7.
v Ensure that you have the necessary authorizations and privileges to use
the CREATE PROCEDURE and DROP PROCEDURE statements. You
can find the complete list of authorizations and privileges required in
the SQL Reference, Volume 2.
v Perform the previous steps in the upgrading routines task.
Restriction
This procedure applies only to SQL procedures that were created in DB2
UDB Version 8.1 before FixPak 7 (also known as Version 8.2).
Procedure
Take note of the schema and specific name values returned by this query,
because you will need this information to perform subsequent steps.
where sample is the database name, the -e option generates DDL statements for
database objects, the -o db2look.sql option indicates the output file that will
contain the DDL statements, and the -a option indicates all objects created by
all users.
Edit the db2look.sql file to keep only the DDL statements necessary to create
the SQL procedures that you identified in step 2 on page 194.
4. For each SQL stored procedures that you identified in step 2 on page 194, use
the DROP PROCEDURE statement indicating the schema name and specific
name to uniquely identify each procedure:
DROP SPECIFIC PROCEDURE <schema-name>.<specific-name>
Alternatively, if you have a DDL script that drops and re-creates your SQL
procedures, edit it to drop and re-create only the SQL procedures identified in
step 2 on page 194, and run it. Then proceed to step 6.
5. Re-create the SQL procedures identified in step 2 on page 194 using the
CREATE PROCEDURE statement. Alternatively, you can run your own DDL
script or the db2look.sql file that you created in step 3.
6. Test your SQL procedures to ensure that they run as expected under DB2
Version 9.7. You can use the Data Studio or the Command Line Processor (CLP)
interface to test them. The following example illustrates how to invoke an SQL
procedure using the CLP :
CONNECT TO sample
After upgrading your SQL procedures, perform the remaining steps in the
upgrading routines task.
To upgrade 32-bit external routines to run on a DB2 Version 9.7 64-bit instance:
1. Ensure that the library path environment variables include the correct DB2
shared library path for 32-bit libraries as shown in Table 22 on page 147, so that
the correct library can be loaded at runtime.
2. Test your routines in a DB2 Version 9.7 testing environment. If testing is
successful, you do not need to perform any additional steps. However, consider
performing the remaining steps in this task if they apply to your routine for
better support by using the correct library path and development software.
3. Specify the correct library path by linking or rebuilding your 32-bit external
routines using the DB2 shared library paths for 32-bit libraries shown in
Table 21 on page 147. If you upgraded from a DB2 UDB Version 8 32-bit
instance to a DB2 Version 9.7 64-bit instance, you must rebuild 32-bit external
routines that use LOB locators as 64-bit routine libraries.
4. Optional: If you no longer have the source code to rebuild your routine library
or you cannot use environmental variables, use the db2chglibpath command to
change the DB2 shared library path to $INSTHOME/sqllib/lib32 on your
routine binary file as long as it has an embedded runtime path. The embedded
runtime path can be changed to a new path with the same length or less.
5. Perform any other steps in the “Upgrading C, C++, and COBOL routines” on
page 190 task that apply to your routines.
6. Determine if the external routines that were altered during database upgrade or
the external routines that use the DB2 engine libraries can safely run as NOT
FENCED and THREADSAFE. If you have external unfenced routines in your
database, the UPGRADE DATABASE command performs the following actions:
v Returns the SQL1349W warning message and writes the ADM4100W
message to the administration notification log.
v Redefines all your external unfenced routines that have no dependency on
the DB2 engine library as FENCED and NOT THREADSAFE.
v Creates a CLP script called alter_unfenced_dbname.db2 in the directory
specified by the DIAGPATH database manager configuration parameter to
redefine the affected routines as NOT FENCED and THREADSAFE.
If you can safely run the external routines altered by database upgrade as NOT
FENCED and THREADSAFE, you can redefine them as NOT FENCED and
THREADSAFE using the original CLP script or a modified version with just
specific routines that you want to redefine. If you can run them as FENCED
and NOT THREADSAFE and the performance degradation that you experience
is acceptable, you do not need to redefine your routines .
After upgrading your 32-bit external routines, perform the remaining steps in the
upgrading routines task.
Perform the following post-upgrade tasks that apply to your database applications
and routines:
1. Perform benchmark tests on your database applications and routines in your
production environment and compare with the baseline results that you saved
before the upgrade.
2. Tune your database applications. Review important guidelines related to:
v Character conversion
v Optimization class
v Isolation level
v Locks and concurrency
v Parallel processing for applications
v Query optimization
See related concepts for information about additional factors that can affect
application performance.
3. Tune your routines. Review important guidelines related to:
v Stored procedures
v SQL procedures
In addition, review guidelines on improving the performance of database
applications that also apply to routines, such as the guidelines on optimization
classes, locks, concurrency, and query tuning.
4. Remove dependencies on functionality that is deprecated in DB2 Version 9.7 in
your database applications and routines before that functionality becomes
discontinued.
5. Adopt new DB2 Version 9.7 functionality in database applications, where
appropriate, to improve performance or add new functionality. Check the
Sample files to understand how the new functionality works.
For applications that access upgraded databases, perform any of the following
steps to adopt the specified DB2 Version 9.7 functionality:
v Use optimization guidelines or view MQTs to improve MQT matching. Try
this new functionality in a testing environment before you implement it in your
production environment.
– Use the new MQTENFORCE element for optimization guidelines to choose an
MQT regardless of its cost estimate.
– Use a View MQT to create an MQT on views containing a complex query.
Any queries on the view containing a complex query can be matched to the
View MQT. In previous releases, a query on a view with a construct such as
OUTER JOIN or UNION ALL could not be matched to an MQT.
v Enable statement concentrator to improve performance for dynamic SQL
statements that are similar. The database server modifies these statements so
that they share the same access plan. See “Statement concentrator reduces
compilation overhead” in Troubleshooting and Tuning Database Performance.
The following example shows how to enable statement concentrator at the data
server level:
UPDATE DB CFG FOR dbname
USING stmt_conc LITERALS
After you enable statement concentrator, the following statements share the
same access plan:
SELECT FIRSTNME,LASTNAME FROM EMPLOYEE WHERE EMPNO=’000020’
and
SELECT FIRSTNME,LASTNAME FROM EMPLOYEE WHERE EMPNO=’000070’
You can also enable this functionality at the application level using the
statementConcentrator Connection or DataSource property or the
setDBStatementConcentrator method in JDBC. See “DB2Connection interface” in
Developing Java Applications for details.
v If the value of the pckcachesz database configuration parameter is close to the
upper limit in pre-Version 97 releases running on 64–bit operating systems, tune
this parameter or set to AUTOMATIC to enable self tuning. In Version 9.7 the
upper limit for this parameter has been increased to 2 147 483 646.
Having enough memory to cache the sections for static or dynamic SQL or
XQuery statements might improve performance, especially when you issue the
same statement multiple times from an application.
v If you want to increase concurrency for the cursor stability isolation level or
you are migrating Oracle applications, enable currently committed behavior.
To enable this behavior at the database level, perform the following steps:
1. Set the cur_commit configuration parameter to ON by issuing the following
statement:
If you upgraded from DB2 Version 9.1 or earlier, adopt functionality introduced in
DB2 Version 9.5 in your database applications and routines. See Enabling new DB2
Version 9.5 functionality in database applications and routines in the Migration
Guide (Version 9.5) for details.
Note: The DB2 Information Center topics are updated more frequently than either
the PDF or the hardcopy books. To get the most current information, install the
documentation updates as they become available, or refer to the DB2 Information
Center at ibm.com.
You can access additional DB2 technical information such as technotes, white
papers, and IBM Redbooks® publications online at ibm.com. Access the DB2
Information Management software library site at http://www.ibm.com/software/
data/sw-library/.
Documentation feedback
We value your feedback on the DB2 documentation. If you have suggestions for
how to improve the DB2 documentation, send an e-mail to [email protected].
The DB2 documentation team reads all of your feedback, but cannot respond to
you directly. Provide specific examples wherever possible so that we can better
understand your concerns. If you are providing feedback on a specific topic or
help file, include the topic title and URL.
Do not use this e-mail address to contact DB2 Customer Support. If you have a
DB2 technical issue that the documentation does not resolve, contact your local
IBM service center for assistance.
Although the tables identify books available in print, the books might not be
available in your country or region.
Note: The DB2 Information Center is updated more frequently than either the PDF
or the hard-copy books.
Table 31. DB2 technical information
Name Form Number Available in print Last updated
Administrative API SC27-2435-00 Yes August, 2009
Reference
Administrative Routines SC27-2436-00 No August, 2009
and Views
Call Level Interface SC27-2437-00 Yes August, 2009
Guide and Reference,
Volume 1
Call Level Interface SC27-2438-00 Yes August, 2009
Guide and Reference,
Volume 2
Command Reference SC27-2439-00 Yes August, 2009
Data Movement Utilities SC27-2440-00 Yes August, 2009
Guide and Reference
Data Recovery and High SC27-2441-00 Yes August, 2009
Availability Guide and
Reference
Database Administration SC27-2442-00 Yes August, 2009
Concepts and
Configuration Reference
Database Monitoring SC27-2458-00 Yes August, 2009
Guide and Reference
Database Security Guide SC27-2443-00 Yes August, 2009
DB2 Text Search Guide SC27-2459-00 Yes August, 2009
Developing ADO.NET SC27-2444-00 Yes August, 2009
and OLE DB
Applications
Developing Embedded SC27-2445-00 Yes August, 2009
SQL Applications
Developing Java SC27-2446-00 Yes August, 2009
Applications
Developing Perl, PHP, SC27-2447-00 No August, 2009
Python, and Ruby on
Rails Applications
Developing User-defined SC27-2448-00 Yes August, 2009
Routines (SQL and
External)
Getting Started with GI11-9410-00 Yes August, 2009
Database Application
Development
Getting Started with GI11-9411-00 Yes August, 2009
DB2 Installation and
Administration on Linux
and Windows
Printed versions of many of the DB2 books available on the DB2 PDF
Documentation DVD can be ordered for a fee from IBM. Depending on where you
are placing your order from, you may be able to order books online, from the IBM
Publications Center. If online ordering is not available in your country or region,
you can always order printed DB2 books from your local IBM representative. Note
that not all books on the DB2 PDF Documentation DVD are available in print.
Note: The most up-to-date and complete DB2 documentation is maintained in the
DB2 Information Center at http://publib.boulder.ibm.com/infocenter/db2luw/
v9r7.
To start SQL state help, open the command line processor and enter:
? sqlstate or ? class code
where sqlstate represents a valid five-digit SQL state and class code represents the
first two digits of the SQL state.
For example, ? 08003 displays help for the 08003 SQL state, and ? 08 displays help
for the 08 class code.
For DB2 Version 9.5 topics, the DB2 Information Center URL is
http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/
For DB2 Version 9 topics, the DB2 Information Center URL is http://
publib.boulder.ibm.com/infocenter/db2luw/v9/
For DB2 Version 8 topics, go to the Version 8 Information Center URL at:
http://publib.boulder.ibm.com/infocenter/db2luw/v8/
On some browser and operating system combinations, you must also change the
regional settings of your operating system to the locale and language of your
choice.
A DB2 Version 9.7 Information Center must already be installed. For details, see
the “Installing the DB2 Information Center using the DB2 Setup wizard” topic in
Installing DB2 Servers. All prerequisites and restrictions that applied to installing
the Information Center also apply to updating the Information Center.
Procedure
Results
The DB2 Information Center restarts automatically. If updates were available, the
Information Center displays the new and updated topics. If Information Center
updates were not available, a message is added to the log. The log file is located in
doc\eclipse\configuration directory. The log file name is a randomly generated
number. For example, 1239053440785.log.
Note: On Windows 2008, Windows Vista (and higher), the commands listed later
in this section must be run as an administrator. To open a command prompt or
graphical tool with full administrator privileges, right-click the shortcut and then
select Run as administrator.
Note: The help_end script contains the commands required to safely stop the
processes that were started with the help_start script. Do not use any other
method to stop the help_start script.
7. Restart the DB2 Information Center.
v On Windows, click Start → Control Panel → Administrative Tools → Services.
Then right-click DB2 Information Center service and select Start.
v On Linux, enter the following command:
/etc/init.d/db2icdv97 start
The updated DB2 Information Center displays the new and updated topics.
DB2 tutorials
The DB2 tutorials help you learn about various aspects of DB2 products. Lessons
provide step-by-step instructions.
You can view the XHTML version of the tutorial from the Information Center at
http://publib.boulder.ibm.com/infocenter/db2help/.
Some lessons use sample data or code. See the tutorial for a description of any
prerequisites for its specific tasks.
DB2 tutorials
Personal use: You may reproduce these Publications for your personal, non
commercial use provided that all proprietary notices are preserved. You may not
distribute, display or make derivative work of these Publications, or any portion
thereof, without the express consent of IBM.
Commercial use: You may reproduce, distribute and display these Publications
solely within your enterprise provided that all proprietary notices are preserved.
You may not make derivative works of these Publications, or reproduce, distribute
or display these Publications or any portion thereof outside your enterprise,
without the express consent of IBM.
IBM reserves the right to withdraw the permissions granted herein whenever, in its
discretion, the use of the Publications is detrimental to its interest or, as
determined by IBM, the above instructions are not being properly followed.
You may not download, export or re-export this information except in full
compliance with all applicable laws and regulations, including all United States
export laws and regulations.
IBM may not offer the products, services, or features discussed in this document in
other countries. Consult your local IBM representative for information on the
products and services currently available in your area. Any reference to an IBM
product, program, or service is not intended to state or imply that only that IBM
product, program, or service may be used. Any functionally equivalent product,
program, or service that does not infringe any IBM intellectual property right may
be used instead. However, it is the user’s responsibility to evaluate and verify the
operation of any non-IBM product, program, or service.
IBM may have patents or pending patent applications covering subject matter
described in this document. The furnishing of this document does not grant you
any license to these patents. You can send license inquiries, in writing, to:
The following paragraph does not apply to the United Kingdom or any other
country/region where such provisions are inconsistent with local law:
INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS
PUBLICATION “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS
FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or
implied warranties in certain transactions; therefore, this statement may not apply
to you.
Any references in this information to non-IBM Web sites are provided for
convenience only and do not in any manner serve as an endorsement of those Web
IBM may use or distribute any of the information you supply in any way it
believes appropriate without incurring any obligation to you.
Licensees of this program who wish to have information about it for the purpose
of enabling: (i) the exchange of information between independently created
programs and other programs (including this one) and (ii) the mutual use of the
information that has been exchanged, should contact:
The licensed program described in this document and all licensed material
available for it are provided by IBM under terms of the IBM Customer Agreement,
IBM International Program License Agreement, or any equivalent agreement
between us.
All statements regarding IBM’s future direction or intent are subject to change or
withdrawal without notice, and represent goals and objectives only.
This information may contain examples of data and reports used in daily business
operations. To illustrate them as completely as possible, the examples include the
names of individuals, companies, brands, and products. All of these names are
fictitious, and any similarity to the names and addresses used by an actual
business enterprise is entirely coincidental.
COPYRIGHT LICENSE:
Each copy or any portion of these sample programs or any derivative work must
include a copyright notice as follows:
© (your company name) (year). Portions of this code are derived from IBM Corp.
Sample Programs. © Copyright IBM Corp. _enter the year or years_. All rights
reserved.
Trademarks
IBM, the IBM logo, and ibm.com® are trademarks or registered trademarks of
International Business Machines Corp., registered in many jurisdictions worldwide.
Other product and service names might be trademarks of IBM or other companies.
A current list of IBM trademarks is available on the Web at “Copyright and
trademark information” at www.ibm.com/legal/copytrade.shtml.
Index 221
migration (continued) post-upgrade tasks (continued)
See upgrade applications 3 DB2 servers (continued)
See upgrade DB2 clients 3 re-creating write-to-table event monitors 102
See upgrade DB2 environment 3 rebinding packages 99
See upgrade DB2 servers 3 setting up database auditing 97
See upgrade routines 3 verifying upgrade 103
XML data type 114 routines
XML Extender 114 adopting new functionality 199
XML Extender to XML data store 109 removing deprecated functionality 197
multiple DB2 copies tuning 197
upgrading DB2 servers 78 pre-upgrade tasks
applications
overview 177
N clients
backing up configuration 125
Net Search Extender (NSE)
overview 125
upgrade impact from UDFs 88
upgrading in test environments 126
upgrading 75
DB2 servers
NetBIOS
backing up configuration 47
discontinued functionality
backing up databases 46
post-upgrade tasks for clients 135
changing raw devices to block devices (Linux) 51
new server
increasing log space 49
upgrading DB2 servers 80
overview 41
non-root installations
taking servers offline 54
upgrading
upgrading in test environments 53
Linux and UNIX 77
verifying databases are ready to upgrade 44
notices 215
routines
overview 177
problem determination
O information available 213
O_DIRECT tutorials 213
changing raw devices to block devices (Linux) 51
online database backups
upgrading DB2 servers 83
Oracle
Q
Query Patroller
migrating 39
Migrating to DB2 workload management 111
ordering DB2 books 208
upgrading 75
P R
partitioned database environments
raw I/O
upgrading 84
changing raw devices to block devices (Linux) 51
partitioned indexes
raw logs
upgraded databases 105
deprecated functionality
partitioned tables and XML data
upgrade impact 37
upgraded databases 105
re-creating write-to-table event monitors
post-upgrade tasks
post-upgrade tasks for DB servers 102
applications
read-only workloads
adopting new functionality 199
HADR Standby databases after upgrade 105
removing deprecated functionality 197
REBIND command
tuning 197
post-upgrade tasks for DB2 servers 99
clients
rebinding
managing server changes 135
packages
overview 135
post-upgrade tasks for DB2 servers 99
recataloging nodes 135
recataloging nodes
verifying upgrade 136
NetBIOS and SNA protocol
converting XML storage objects to Version 9.7 100
post-upgrade tasks for clients 135
DB2 servers
references
activating databases 95
upgrade 203
activating services 95
registry variables
adjusting log spaces 94
saving settings
adjusting system temporary table space page sizes 101
pre-upgrade tasks for DB2 servers 47
adopting new functionality 105
upgrade impact 28
converting type-1 indexes to type-2 indexes 42
upgrading 96
managing behavior changes 96
removing deprecated functionality
migrating explain tables 99
post-upgrade tasks 197
overview 93
Index 223
upgrade (continued) upgrade (continued)
applications (continued) HADR 19
DB2 API changes 149 important references 203
DB2 CLI 181 instances 58, 68
DB2 command changes 152 32-bit and 64-bit upgrade support 27
DB2 Version 9.7 3 Microsoft Cluster Server (MSCS) 91
embedded SQL 180 Net Search Extender (NSE) UDFs 88
Java using DB2 JDBC Type 2 driver 184 non-root installations
Java using IBM Data Server Driver for JDBC and Linux and UNIX 77
SQLJ 182 planning 5
planning 8 applications 8
post-upgrade tasks 197 clients 8
pre-upgrade tasks 177 DB2 environments 5
SQL statement changes 159 DB2 servers 6
support 143 routines 8
system built-in routine changes 166 routines 141
system-defined administrative routine and view 32-bit external routines 195
changes 166 C, C++, and COBOL 190
upgrade task 179 DB2 Version 9.7 3
C, C++, and COBOL applications 180 Java 192
C, C++, and COBOL routines 190 planning 8
clients 119 post-upgrade tasks 197
DB2 Version 9.7 3 pre-upgrade tasks 177
Linux and UNIX 131 SQL procedures 194
planning 8 support 173
post-upgrade tasks 135 upgrade task 189
pre-upgrade tasks 125 scripts 186
test environment 126 support 143
Data Links 88 SQL replication environments 22
Data Server Driver Package 133 support
database applications 179 32-bit and 64-bit instances 19
databases 62, 71 applications 143
DB2 Administration Server (DAS) 61, 70 clients 121
DB2 environment 3 DB2 servers 17
DB2 server performance 22 routines 173
DB2 servers 15 scripts 143
32-bit to 64-bit Windows 75 tools catalog database 61, 70
adjusting log space 94 Windows
alternate fix pack installations 78 Data Server Client 127
best practices 22 Data Server Runtime Client 129
complex environments 75 XML Extender 89
configuration parameters changes 28 upgrade best practices
configuration parameters, registry variables and clients 123
physical characteristics 96 DB2 servers 22
creating database duplicates for test environments 54 UPGRADE DATABASE command
database physical characteristics changes 28 upgrade support 19
DB2 Version 9.7 3 upgraded database entities 17
discontinued functionality 19 upgrading databases 62, 71
Linux and UNIX 67 upgrade support
log space and table space requirements 25 32-bit and 64-bit 27
multiple DB2 copies 78 instance type 19
new server 80 upgraded databases
partitioned database environments 84 adopting new functionality 105
planning 6 upgrading development software
post-upgrade tasks 93 pre-upgrade tasks for applications and routines 177
pre-upgrade tasks 41 upgrading operating system
registry variables changes 28 pre-upgrade tasks for applications and routines 177
restrictions 19 Upgrading to DB2 Version 9.7
support 17 description v
taking servers offline 54 upgrading applications and routines 139
test environments 53 upgrading clients 117
using online database backups 83 upgrading DB2 environments 1
Windows 57 upgrading DB2 servers 13
DB2 Spatial Extender 22 user-defined functions
DB2 Text Search 85 upgrade support 173
DB2 Version 9.7 3 upgrading 189
enabling autonomic computing functionality 22
W
Web sites
DB2 Migrate Now! 39
DB2 upgrade portal 5
developerWorks - Information Management 39
IBM Virtual Innovation Center 39
Windows operating systems
upgrading
Data Server Client 127
Data Server Runtime Client 129
DB2 servers 57
write-to-table event monitors
re-creating after upgrade 102
X
XML collections (XML Extender)
migrating applications 114
XML data stored in partitioned tables
upgraded databases 105
XML data type
migrating applications 114
XML Extender
upgrading 89
XML storage objects
converting to Version 9.7 format 100
Index 225
226 Upgrading to DB2 Version 9.7
Printed in USA
SC27-2452-00
Spine information:
IBM DB2 9.7 for Linux, UNIX, and Windows Upgrading to DB2 Version 9.7