Troubleshooting Guide: IBM DB2 Universal Database
Troubleshooting Guide: IBM DB2 Universal Database
Troubleshooting Guide: IBM DB2 Universal Database
Troubleshooting Guide
GC09-2850-01
® ®
IBM DB2 Universal Database IBM
Troubleshooting Guide
GC09-2850-01
Before using this information and the product it supports, be sure to read the general information under Notices.
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 1993, 2000. All rights reserved.
US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract
with IBM Corp.
Contents
Chapter 1. Troubleshooting overview . . 1 Interpreting diagnostic log file entries . . . 58
7 Introduction to problem determination . . . . . 1 Interpreting the db2diag.log file informational
Identifying the version and service level of your record . . . . . . . . . . . . . . 60
product . . . . . . . . . . . . . . . . 3 Interpreting an SQL structure in the
DB2 server process model . . . . . . . . . . 4 db2diag.log file . . . . . . . . . . . 61
Proactive monitoring tools . . . . . . . . . . 7 Dump files . . . . . . . . . . . . . 61
Snapshot and event monitors . . . . . . . . 8 Trap files . . . . . . . . . . . . . . 62
Setting up snapshot monitoring . . . . . . 9 Formatting trap files (Windows) . . . . . 63
Creating an event monitor . . . . . . . . 9 Analyzing trap files . . . . . . . . . 64
Activating an event monitor . . . . . . . 9 Common signals and exceptions that cause
Formatting an event monitor . . . . . . 10 trap file generation . . . . . . . . . . 64
Basic monitoring commands . . . . . . . 10 Analyzing the stack trace back . . . . . . 65
Configuring health indicators for health monitors 11 Platform specific error logs . . . . . . . . 66
Health monitor output. . . . . . . . . . 12 Operating system errors . . . . . . . . 67
Interpreting event monitor and snapshot output 13 Setting up the system error log (UNIX) . . . 68
Diagnosing the source of the problem . . . . . 13 System core files (UNIX) . . . . . . . . 69
Diagnostic tools . . . . . . . . . . . . 13 Accessing system core file information (UNIX) 69
7 db2diag - Analyzing db2diag.log files . . . 13 Example of the dbx Command . . . . . 70
db2greg - Displaying and altering the Global Accessing event logs (Windows) . . . . . 70
Registry (UNIX) . . . . . . . . . . . 14 Exporting event logs (Windows) . . . . . 70
db2look - Mimicking databases . . . . . . 14 Accessing the Dr. Watson log file (Windows) 71
db2nstck and db2_call_stack - Generating 7 Combining DB2 and OS Diagnostics . . . . . 71
EDU call stacks . . . . . . . . . . . 18
9 db2pd - Monitoring and troubleshooting DB2 19 Chapter 2. Specific troubleshooting
db2support - Collecting environment techniques . . . . . . . . . . . . . 75
information . . . . . . . . . . . . 35 Installation issues . . . . . . . . . . . . 75
Platform specific tools . . . . . . . . . . 38 Location of installation error logs . . . . . . 75
Diagnostic tools (Windows) . . . . . . . 38 Installation methods for DB2 UDB (Windows and
Diagnostic tools (UNIX) . . . . . . . . 38 UNIX) . . . . . . . . . . . . . . . 76
Troubleshooting commands (AIX) . . . . 39 Interpreting Windows installation error logs . . 78
Troubleshooting commands (UNIX) . . . 39 Interpreting UNIX installation error logs. . . . 82
Commands for DB2 in a partitioned Tracing installation problems . . . . . . . 86
database environment (UNIX) . . . . . 40 Troubleshooting a DB2 Information Integrator
Determining active process status . . . . . 41 installation . . . . . . . . . . . . . 86
Trace files . . . . . . . . . . . . . . 43 Instance creation and update issues . . . . . . 86
Basic trace diagnostics . . . . . . . . . 43 Determining the cause of instance creation
DB2 trace files . . . . . . . . . . . 44 problems . . . . . . . . . . . . . . 86
DB2 trace memory buffers . . . . . . 46 Identifying instance update issues (UNIX) . . . 87
Dumping a trace file . . . . . . . . 46 Avoiding fixpak upgrade problems . . . . . 90
Formatting a DB2 trace file . . . . . . 47 License issues . . . . . . . . . . . . . 90
DRDA trace files. . . . . . . . . . . 48 Troubleshooting licensing problems . . . . . 91
JDBC trace files . . . . . . . . . . . 50 Migration issues . . . . . . . . . . . . . 92
Enabling JDBC traces . . . . . . . . 50 Migration recommendations . . . . . . . . 92
Enabling DB2 Universal JDBC traces . . . 51 Migration restrictions . . . . . . . . . . 94
Obtaining traces of applications that use 7 Reverse FixPak upgrade restrictions . . . . . 95
CLI-based Legacy Type 2 JDBC Driver . . 52 Migrating databases . . . . . . . . . . 95
Obtaining traces of applications that use Application Development issues . . . . . . . 96
the DB2 Universal JDBC Driver. . . . . 53 Debugging and Optimizing an Application . . . 97
First failure data capture . . . . . . . . . 53 Proper application error handling . . . . . . 97
First failure data capture locations . . . . . 54 Displaying the contents of a bind file using the
Setting the error capture level for the db2bfd tool . . . . . . . . . . . . . 99
administration notification log file . . . . . 55 Resolving compilation errors . . . . . . . 100
Interpreting administration notification log file Avoiding linker errors . . . . . . . . . 101
entries . . . . . . . . . . . . . . 55 Troubleshooting suspended or looping
Setting the diagnostic log file error capture applications . . . . . . . . . . . . . 102
level . . . . . . . . . . . . . . . 58
Contents v
vi DB2 Troubleshooting Guide
Chapter 1. Troubleshooting overview
7 Introduction to problem determination
7 The first step in good problem analysis is to describe the problem completely.
7 Without a problem description, you will not know where to start investigating the
7 cause of the problem. This step includes asking yourself such basic questions as:
7 v What are the symptoms?
7 v Where is the problem happening?
7 v When does the problem happen?
7 v Under which conditions does the problem happen?
7 v Is the problem reproducible?
7 Answering these and other questions will lead to a good description to most
7 problems, and is the best way to start down the path of problem resolution.
7 When starting to describe a problem, the most obvious question is ″What is the
7 problem?″ This may seem like a straightforward question; however it can be
7 broken down into several other questions to create a more descriptive picture of
7 the problem. These questions can include:
7 v Who or what is reporting the problem?
7 v What are the error codes and error messages?
7 v What are the symptoms?
7 v How does it fail? For example: loop, hang, crash, performance degradation,
7 incorrect result.
7 v Can the problem be reproduced?
7 v What is the business impact?
7 The following problem scenario demonstrates how and when you might ask these
7 questions.
7 Determining where the problem originates is not always easy, but is one of the
7 most important steps in resolving a problem. Many layers of technology almost
7 always exist between the reporting and failing components. Networks, disks, and
7 drivers are only a few components to be considered when you are investigating
7 problems.
7 v Is the problem platform specific, or common to multiple platforms?
7 v Is the current enviroment and configuration supported?
7 v Is the application running local on the database server or on a remote server?
7 v Is there a gateway involved?
7 v Does the database reside on individual disks, or on a RAID array?
7 Responding to questions like this will help you create a detailed time line of
7 events, and will provide you with a frame of reference in which to investigate.
7 Knowing what else is running at the time of a problem is important for any
7 complete problem description. If a problem occurs in a certain environment or
7 under certain conditions, that can be a key indicator of the problem cause.
7 v Does the problem always occur when performing the same task?
7 v Does a certain sequence of events need to occur for the problem to surface?
7 v Do other applications fail at the same time?
7 Answering these types of questions will help you explain the environment in
7 which the problem occurs, and correlate any dependencies. Remember that just
7 because multiple problems may have occurred around the same time, it does not
7 necessarily mean that they are always related.
7 Conclusion:
7 Describing a problem accurately and completely may be easy for some problems,
7 but very difficult for others. (The difficulty usually increases as the environmental
7 complexity increases). However, the questions that you need to ask are usually the
7 same: who, what, where, when, and how.
7 The db2support tool poses subsets of the questions described above when you
7 specify the ″-q″ option. This information is then used by DB2 Support to
7 understand the context in which you are encountering your problem. For example:
7 db2support . -q
7 Once have a good understanding of the problem situation, you can research
7 similar problems, and learn about workarounds, and fixes in the available DB2
7 troubleshooting resources.
7 Related concepts:
7 v on page 0
A typical result of running the db2level command on a Windows system would be:
C:\>db2level
DB21085I Instance "DB2" uses "32" bits and DB2 code release "SQL08020"
with level identifier "03010106".
Informational tokens are "DB2 v8.1.7.664", "s040914", "WR21342", and FixPak "7".
Product is installed at "D:\IBM\SQLLIB".
The combination of the four informational tokens uniquely identify the precise
service level of your DB2 instance. This information is essntial when contacting
For JDBC or SQLJ application, if you are using the Universal Driver for SQLJ and
JDBC, you can determine the level of the driver by running the db2jcc utility:
db2jcc -version
The process model used by all DB2 servers facilitates the communication that
occurs between database servers and clients and local applications. It also ensures
that database applications are isolated from resources such as database control
blocks and critical database files.
For each database being accessed, various processes are started to deal with the
various database tasks such as prefetching, communication, and logging.
Each process of a client application has a single coordinator agent that operates on
a database. A coordinator agent works on behalf of an application, and
communicates to other agents, using interprocess communication (IPC) or remote
communication protocols.
F I R EW A L L
Per Database db2pfchr db2pclnr db2loggr db2loggw db2logts db2dlock Per Database
The following list provides additional details on the processes shown in the figure:
Client Programs:
Client programs run remotely or on the same machine as the database server. They
make their first contact with the database through a listener. A coordinator agent
(db2agent) is then assigned to them.
Listeners:
Client programs make initial contact with communication listeners, which are
started when DB2 is started. There is a listener for each configured communication
protocol, and an interprocess communications (IPC) listener (db2ipccm) for local
client programs. Listeners include:
v db2ipccm, for local client connections
v db2tcpcm, for TCP/IP connections
v db2snacm, for APPC connections
v db2tcpdm, for TCP/IP discovery tool requests
Agents:
All connection requests from client applications, whether they are local or remote,
are allocated a corresponding coordinator agent (db2agent). When the coordinator
agent is created, it performs all database requests on behalf of the application.
Idle agents reside in an agent pool. These agents are available for requests from
coordinator agents operating on behalf of client programs, or from subagents
operating on behalf of existing coordinator agents. The number of available agents
is dependent on the database manager configuration parameters maxagents and
num_poolagents.
db2fmp:
The fenced mode process. It is responsible for executing fenced stored procedures
and user-defined functions outside the firewall. db2fmp is always a separate
process but may be multithreaded depending on the types of routines it executes.
Database Threads/Processes:
The following list includes some of the important threads/processes used by each
database:
v db2pfchr, for buffer pool prefetchers
v db2pclnr, for buffer pool page cleaners
v db2loggr, for manipulating log files to handle transaction processing and
recovery
v db2loggw, for writing log records to the log files.
v db2logts, for collecting historical information about which logs are active when
a tablespace is modified. This information is ultimately recorded in the
DB2TSCHG.HIS file in the database directory. It is used to speed up tablespace
rollforward recovery.
v db2dlock, for deadlock detection. In a multi-partitioned database environment,
an additional process called db2glock is used to coordinate the information
gathered from the db2dlock process on each partition. db2glock runs only on the
catalog partition.
The system controller (db2sysc) must exist in order for the database server to
function. Also, the following threads and processes may be started to carry out
various tasks:
v db2resyn, the resync agent that scans the global resync list
DB2 for Windows differs from UNIX-based environments in that the database
engine is multi-threaded, not multi-processed. In Windows systems, each of the
dispatchable units on the agent side of the firewall is a thread under the process
db2sysc. This allows the database engine to let the operating system perform
task-switching at the thread level instead of the process level. For each database
being accessed, threads are started to deal with database tasks (for example,
prefetching).
Related concepts:
v on page 0
v “Determining active process status” on page 41
Monitoring does involve overhead and this should be taken into account when
developing the monitoring plan. The frequency and volume of monitoring needs to
be controlled.
In order to allow for effective memory usage, it is possible to configure how much
memory is used for database monitoring. The database system monitor heap size
cofiguration parameter MON_HEAP_SZ, which is a database manager
configuration parameter, specifies the amount of memory allocated on a
DB2START and is used when monitoring takes place. Setting this parameter to 0
(zero) will not allow any monitoring to take place.
Levels of monitoring:
The monitoring utilities collect information at different levels within the system:
v Database Manager - the monitor gathers details from the time the instance is
started till the time it is stopped.
v Database - this level of monitoring begins on the first connection or activation,
and will continue until deactivation or the last connection is terminated.
v Application - this level of monitoring begins when an application connects to the
database and continues until it disconnects from the database.
You can control the type of data to collect. The type of information is classified as
follows:
BUFFERPOOL ACTIVITY
LOCKS
SORTS
SQL STATEMENTS
TABLE ACTIVITY
TIMESTAMPS
UNIT OF WORK
So, for example, if you notice long lock waits, it would be logical to monitor the
LOCK group in an attempt to isolate the problem.
As an example, try using the sample database to take a snapshot. From a CLP
session, issue the following commands:
DB2 CONNECT TO sample
DB2 RESET MONITOR ALL
DB2 GET SNAPSHOT FOR DATABASE ON sample
DB2 "SELECT * FROM syscat.bufferpools"
DB2 GET SNAPSHOT FOR DATABASE ON sample
The above command will create an event monitor called evmonex1 to capture all
statement events. A maximum of 3 files of 4MB each will be created. The file
directory (in this example ″c:\temp\testfile″) does not have to exist at CREATE
EVENT MONITOR time. However, if it does not occur by the time an event
monitor is activated, an error will occur (i.e. SQL1614N An I/O error occurred
when activating an event monitor. Reason code = ″2″. SQLSTATE=58030).
A returned value of 0 indicates that the specified event monitor is inactive, and 1
indicates that it is active.
For more example commands, including how to disable and drop event monitors,
see Collecting information about database system events.
As an exercise, try generating and then formatting the output of the evmonex1
event monitor created earlier.
db2evmon -db sample -evm evmonex1
Try running that command again after generating a statement event, for example
by issuing
’DB2 "SELECT * FROM EMPLOYEE"’
. There will now be much more information, since an event has been triggered.
To obtain the current state of the functional groups listed earlier, issue the
following command:
DB2 GET MONITOR SWITCHES
If you see that a particular group’s ″switch″ is ″on″, you know that this group will
be monitored.
Note: Event monitors are only affected by the time and timestamp information
switch. All other switch settings effect snapshot monitors only and have no
effect on the data collected by event monitors.
For partitioned database systems, you can set monitor switches specifically for a
certain partition, or globally for all partitions. To set a monitor switch for a specific
partition, issue the following command:
db2 update monitor switches using <switch name> ON|OFF at dbpartitionnum <partition number>
To reset monitor elements to zero, thereby allowing you to start with fresh system
monitor information, use the following command (which can also be qualified to
occur only on particular partitions):
DB2 RESET MONITOR ALL | FOR DATABASE <database alias>
Related reference:
v Snapshot monitor
v Snapshot monitor CLP commands
v Event monitors
v Creating an event monitor
The scenario is that you have decided that you want to be alerted when a
particular database is in a non-normal state. This will involve monitoring the
health indicator ″db.db_op_status″, the database operational state health indicator.
To determine the current settings for this health indicator on the SAMPLE
database, use the following command:
DB2 GET ALERT CFG FOR DATABASE ON SAMPLE
The following is the default output resulting from this request for configuration
information:
Alert Configuration
Thus the state checking is enabled for this health indicator. If you wanted to alter
any of these fields, you could do so using the command UPDATE ALERT CFG, for
example:
DB2 UPDATE ALERT CFG FOR DATABASE ON SAMPLE using db.db_op_status SET THRESHOLDSCHECKED NO
To return to the default values, use the RESET ALERT CFG command, for example:
DB2 RESET ALERT CFG FOR DATABASE ON SAMPLE USING db.db_op_status
Note: The table space has to be in the non-normal state when the health indicator
evaluates in order to generate the alert. So, if the state doesn’t persist long
enough, then it’s possible that an alert will not be generated.
In DB2 version 8.2 FixPak 7, the refresh interval for this particular health indicator
is 5 minutes. Therefore if you want to test this alert situation, perform an action
that will put the database in a non-normal state (for example by quiescing it) and
then wait 5 minutes. Unfortunately, there is no method for you to determine the
refresh intervals. Most of them range between 5 and 60 minutes.
Health Indicators:
Indicator Name = db.db_op_status
Value = 2
Evaluation timestamp = 01/14/2005 15:00:27.296000
Alert state = Attention
If you were unaware that the database was quiesced, you could use the GET
RECOMMENDATIONS command in order to obtain the recommended actions for
this particular alert situation:
DB2 GET RECOMMENDATIONS FOR HEALTH INDICATOR db.db_op_status FOR DATABASE ON sample
Problem:
Indicator Name = db.db_op_status
Value = 2
Evaluation timestamp = 01/14/2005 15:05:27
Alert state = Attention
Partition = 0
Additional information =
Recommendations:
If you have quiesced your database to perform this test, unquiesce it now using
any one of the methods described in the GET RECOMMENDATIONS output. For
example:
DB2 UNQUIESCE DATABASE
DB2 CONNECT RESET
Related reference:
v Introduction to the health monitor
v Health monitor interfaces
v Health indicator configuration
v Health monitor sample output
monitor will generate an alert for the health indicator. Other attributes (action
flag, actions) define what the health monitor does upon generating the alert.
For more information about these attributes, see Health indicator configuration.
Two examples of health snapshot output and their meaning are provided here:
Health monitor sample output.
Diagnostic tools
7 db2diag - Analyzing db2diag.log files
7 In DB2 version 8, the primary log file intended for use by database and system
7 administrators is the Administration Notification log. The db2diag.log file, on the
7 other hand, is intended for use by DB2 customer support for troubleshooting
7 purposes.
7 The db2diag tool serves to filter and format the volume of information available in
7 the db2diag.log.
7 If there are several databases in the instance, and you wish to only see those
7 messages which pertain to the database ″SAMPLE″, you can filter the db2diag.log
7 as follows:
7 db2diag -g db=SAMPLE
7 Thus you would only see db2diag.log records which contained ″DB: SAMPLE″,
7 such as:
7 2005-01-14-15.16.52.984000-480 E105657825H410 LEVEL: Error
7 PID : 2200 TID : 2148 PROC : db2syscs.exe
7 INSTANCE: DB2 NODE : 000 DB : SAMPLE
7 APPHDL : 0-254 APPID: *LOCAL.DB2.050114231611
7 FUNCTION: DB2 UDB, base sys utilities, sqleDatabaseUnquiesce, probe:2
7 MESSAGE : ADM7509W Database unquiesce request has completed successfully.
7 The following command can be used to display all severe error messages produced
7 by processes running on partitions 0,1,2, or 3 with the process ID (PID) 2200:
7 db2diag -g level=Severe,pid=2200 -n 0,1,2,3
7 Note that this command could have been written a couple of different ways,
7 including ″db2diag -l severe -pid 2200 -n 0,1,2,3″. These commands would
7 successfully retrieve db2diag.log records which meet these requirements, such as:
7 The following command filters all records occurring after January 1, 2005
7 containing non-severe and severe errors logged on partitions 0,1 or 2. It outputs
7 the matched records such that the time stamp, partition number and level appear
7 on the first line, pid, tid and instance name on the second line, and the error
7 message follows thereafter:
7 db2diag -time 2005-01-01 -node "0,1,2" -level "Severe, Error"
7 Partition: %node Message Level: %{level} \nPid: %{pid} Tid: %{tid} Instance: %{instance}\nMessage: @
7 Related reference:
7 v db2diag - db2diag.log analysis tool Command
7 v Administration logs, error logs and first failure data capture
One can view (and manipulate with root access) the Global Registry with the
″db2greg″ tool. This tool is located in sqllib/bin, and in the install directory under
bin as well (for use when logged in as root). You should only use this tool if
requested to do so by DB2 Customer Support.
create a test system that is similar in structure and data, and to then do the tests
against it instead. This way, the production system will not be affected by the
adverse performance impact of the tests or by the accidental destruction of data by
an errant application. Also, when you are investigating a problem (such as invalid
results, performance issues, and so on), it may be easier to debug the problem on a
test system that is identical to the production system.
You can use the db2look tool to extract the required DDL statements needed to
reproduce the database objects of one database in another database. The tool can
also generate the required SQL statements needed to replicate the statistics from
the one database to the other, as well as the statements needed to replicate the
database configuration, database manager configuration, and registry variables.
This is important because the new database may not contain the exact same set of
data as the original database but you may still want the same access plans chosen
for the two systems.
The db2look tool is described in detail in the DB2 Command Reference but you can
view the list of options by executing the tool without any parameters. A more
detailed usage can be displayed using the -h option.
To extract the DDL for the tables in the database, use the -e option. For example,
create a copy of the SAMPLE database called SAMPLE2 such that all of the objects
in the first database are created in the new database:
C:\>db2 create database sample2
DB20000I The CREATE DATABASE command completed successfully.
C:\>db2look -d sample -e > sample.ddl
-- USER is:
-- Creating DDL for table(s)
-- Binding package automatically ...
-- Bind is successful
-- Binding package automatically ...
-- Bind is successful
Note: If you want the DDL for the user-defined spaces, database partition groups
and buffer pools to be produced as well, add the ″-l″ flag after ″-e″ in the
command above. The default node groups, buffer pools, and table spaces
will not be extracted. This is because they already exist in every database by
default. If you wish to mimic these, you must alter them yourself manually.
Bring up the file sample.ddl in a text editor. Because you want to execute the DDL
in this file against the new database, you must change the CONNECT TO
SAMPLE statement to CONNECT TO SAMPLE2. If you used the ″-l″ option, you
may need to alter the path associated with the tablespace commands, such that
they point to appropriate paths as well. While you are at it, take a look at the rest
of the contents of the file. You should see CREATE TABLE, ALTER TABLE, and
CREATE INDEX statements for all of the user tables in the sample database:
...
------------------------------------------------
-- DDL Statements for table "DB2"."ORG"
------------------------------------------------
"DIVISION" VARCHAR(10) ,
"LOCATION" VARCHAR(13) )
IN "USERSPACE1" ;
...
Once you have changed the connect statement, execute the statements, as follows:
C:\>db2 -tvf sample.ddl > sample2.out
Take a look at the sample2.out output file -- everything should have been executed
successfully. If errors have occurred, the error messages should state what the
problem is. Fix those problems and execute the statements again.
As you can see in the output, DDL for all of the user tables are exported. This is
the default behavior but there are other options available to be more specific about
the tables included. For example, to only include the STAFF and ORG tables, use
the -t option:
C:\>db2look -d sample -e -t staff org > staff_org.ddl
To only include tables with the schema DB2, use the -z option:
C:\>db2look -d sample -e -z db2 > db2.ddl
If both databases have the exact same data loaded into them and runstats is
performed on both, the statistics should be identical. However, if the databases
contain different data or if only a subset of data is being used in the test database
then the statistics will likely be very different. In such a case, you can use db2look
to gather the statistics from the production database and place them into the test
database. This is done by creating UPDATE statements against the SYSSTAT set of
updatable catalog tables as well as RUNSTATS commands against all of the tables.
The option for creating the statistic statements is -m. Going back to the
SAMPLE/SAMPLE2 example, gather the statistics from SAMPLE and add them
into SAMPLE2:
C:\>db2look -d sample -m > stats.dml
-- USER is:
-- Running db2look in mimic mode
As before, the output file must be edited such that the CONNECT TO SAMPLE
statement is changed to CONNECT TO SAMPLE2. Again, take a look at the rest of
the file to see what some of the runstats and update statements look like:
...
-- Mimic table ORG
RUNSTATS ON TABLE "DB2"."ORG" ;
UPDATE SYSSTAT.INDEXES
SET NLEAF=-1,
NLEVELS=-1,
FIRSTKEYCARD=-1,
FIRST2KEYCARD=-1,
FIRST3KEYCARD=-1,
FIRST4KEYCARD=-1,
FULLKEYCARD=-1,
CLUSTERFACTOR=-1,
CLUSTERRATIO=-1,
SEQUENTIAL_PAGES=-1,
PAGE_FETCH_PAIRS=’’,
DENSITY=-1,
AVERAGE_SEQUENCE_GAP=-1,
AVERAGE_SEQUENCE_FETCH_GAP=-1,
AVERAGE_SEQUENCE_PAGES=-1,
AVERAGE_SEQUENCE_FETCH_PAGES=-1,
AVERAGE_RANDOM_PAGES=-1,
AVERAGE_RANDOM_FETCH_PAGES=-1,
NUMRIDS=-1,
NUMRIDS_DELETED=-1,
NUM_EMPTY_LEAFS=-1
WHERE TABNAME = ’ORG’ AND TABSCHEMA = ’DB2 ’;
...
As with the -e option that extracts the DDL, the -t and -z options can be used to
specify a set of tables.
-- USER is:
-- This CLP file was created using DB2LOOK Version 8.2
-- Timestamp: 2/16/2005 1:26:50 AM
-- Database Name: SAMPLE
-- Database Manager Version: DB2/NT Version 8.2.1
-- Database Codepage: 1252
-- Database Collating Sequence is: UNIQUE
CONNECT TO SAMPLE;
--------------------------------------------------------
-- Database and Database Manager configuration parameters
--------------------------------------------------------
---------------------------------
-- Environment Variables settings
---------------------------------
COMMIT WORK;
CONNECT RESET;
TERMINATE;
Note: Only those parameters and variables that affect access plan generation will
be included.
Related reference:
v db2look - DB2 Statistics and DDL Extraction Tool Command
These commands are mainly used when it appears that the DB2 engine has
become ″hung″. (In most cases, problems that appear to be with DB2 are in reality
caused by application problems. For example, a long-running transaction may be
holding locks that all other applications are waiting on. All of the applications will
appear to be hung but they are really just waiting for one or more locks to be
released. Situations like this can usually be identified using DB2’s snapshot and
event monitor tools.
In UNIX, the db2_call_stack command generates call stacks for both single and
multi-node instances. The call stacks are placed in files in the diagnostic directory
(sqllib/db2dump by default). Prior v8.2.2 each EDU has its own file which is called
tprocessID.nodenumber. For v8.2.2 Each EUD has its own file which is called
t<processID>.<nodenumber>.xml The files are textbased and can be viewed using
any editor.
This file is in a binary format. To convert it to readable text, you need the db2xprt
tool and the DB2 for Windows .pdb files (i.e. symbol files). See Formatting and
interpreting trap files for information about where to find this tool and how to
use it.
Related reference:
v Trap files
7 The tool collects this information without acquiring any latches or using any
7 engine resources. It is therefore possible (and expected) to retrieve information that
7 is changing while db2pd is collecting information; hence the data may not be
7 completely accurate. If null pointers are encountered, a signal handler is used to
7 prevent db2pd from aborting abnormally. This can result in messages such as
7 ″Changing data structure forced command termination″ to appear in the output.
7 Nonetheless, the tool can be helpful for problem determination. Two benefits to
7 collecting information without latching include faster retrieval and no competition
7 for engine resources.
7 What follow are some examples of problem scenarios in which db2pd can be used
7 to expedite problem determination.
7 The purpose of db2pd -catch is to allow the user to catch any sqlcode (and reason
7 code), zrc code, or ecf code and capture the information needed to solve the error
7 code.
7 The primary reaction is to execute the db2cos (callout script) that can dynamically
7 be altered to run any db2pd command, os command, or any other command
7 needed to solve the problem. The template db2cos file is located in sqllib/cfg and
7 must be moved to sqllib in order to be called.
7 Usage:
7
7 -catch clear | status | <errorCode> [<action>] [count=<count>]
7 Sets catchFlag to catch error or warning.
7
7
7 Error Codes:
7 <sqlCode>[,<reasonCode>] / sqlcode=<sqlCode>[,<reasonCode>]
7 ZRC (hex or integer)
7 ZRC #define (such as SQLP_LTIMEOUT)
7 ECF (hex or integer)
7 "deadlock" or "locktimeout"
7
7 Actions:
7 [db2cos] (default) Run sqllib/db2cos callout script
7 [stopdb2trc] Stop db2trc
7 [dumpcomponent] Dump component flag
7 [component=<componentID>] Component ID
7 [lockname=<lockname>] Lockname for catching specific lock
7 (lockname=000200030000001F0000000052)
7 [locktype=<locktype>] Locktype for catching specific lock
7 (locktype=R or locktype=52)
7 Related reference:
7 v db2pd - Monitor and Troubleshoot DB2 Command
7 There are several types of locks reported with db2pd -locks that can cause an
7 application to wait. Common ones are table, pool, and row where other
7 possibilities are Internal V (dynamic sql cache), Internal P (package cache), and
7 CatCache (catalog cache). Prior to db2pd, there was no way to identify the Internal
7 V, Internal P, or CatCache lock.
7 Starting with Saturn, db2pd -applications reports the Current and Last Anchor ID
7 and Statement Unique ID for dynamic SQL statements. This allows direct mapping
7 from an application to a dynamic sql statements.
7 db2pd -app -dyn
7
7 Applications:
7 Address AppHandl [nod-index] NumAgents CoorPid Status
7 0x00000002006D2120 780 [000-00780] 1 10615 UOW-Executing
7
7 C-AnchID C-StmtUID L-AnchID L-StmtUID Appid
7 163 1 110 1 *LOCAL.jmcmahon.050202200412
7
7 Dynamic SQL Statements:
7 Address AnchID StmtUID NumEnv NumVar NumRef NumExe Text
7 0x0000000220A02760 163 1 2 2 2 1 CREATE VIEW MYVIEW
7 0x0000000220A0B460 110 1 2 2 2 1 CREATE VIEW YOURVIEW
7 The db2pd -memsets and -mempools options report statistics about DB2 Memory
7 Sets and Memory Pools which can be very useful when trying to understand
7 memory usage.
7 Memory Sets:
7 Name Address Id Size Key DBP Type Ov OvSize
7 SAMPLE 0x0000000220000000 290831 46055424 0x0 0 1 Y 8978432
7 App780 0xFFFFFFFF77F00000 1487884 131072 0x0 0 3 N 0
7
7 Memory Pools:
7 Address MemSet PoolName Id Overhead LogSz LogUpBnd LogHWM
7 0x0000000220000CB0 SAMPLE utilh 5 0 304 20496384 304
7 0x0000000220000BB0 SAMPLE undefh 59 0 0 12345678 0
7 0x0000000220000AB0 SAMPLE pckcacheh 7 30592 768781 Unlimited 768781
7 0x00000002200009B0 SAMPLE catcacheh 8 0 194696 Unlimited 194696
7 0x00000002200008B0 SAMPLE bph 16 12064 4265856 Unlimited 4265856
7 0x00000002200007B0 SAMPLE bph 16 32 528832 Unlimited 528832
7 0x00000002200006B0 SAMPLE bph 16 32 266688 Unlimited 266688
7 0x00000002200005B0 SAMPLE bph 16 32 135616 Unlimited 135616
7 0x00000002200004B0 SAMPLE bph 16 32 70080 Unlimited 70080
7 0x00000002200003B0 SAMPLE lockh 4 0 492160 524288 492160
7 0x00000002200002B0 SAMPLE dbh 2 59168 3800760 8683520 3800760
7
7 PhySz PhyUpBnd PhyHWM Bnd BlkCnt CfgParm
7 16384 20496384 16384 Ovf 0 UTIL_HEAP_SZ
7 0 12353536 0 Ovf 0 n/a
7 819200 Unlimited 819200 Ovf 0 PCKCACHESZ
7 262144 Unlimited 262144 Ovf 0 CATALOGCACHE_SZ
7 4292608 Unlimited 4292608 Ovf 0 n/a
7 540672 Unlimited 540672 Ovf 0 n/a
7 278528 Unlimited 278528 Ovf 0 n/a
7 147456 Unlimited 147456 Ovf 0 n/a
7 81920 Unlimited 81920 Ovf 0 n/a
7 524288 524288 524288 Ovf 0 LOCKLIST
7 3932160 8683520 3932160 Ovf 0 DBHEAP
7 Scnenario 5: Memory block usage using FFDC feature. (This is undocumented, yet
7 enabled on customer systems). You must set DB2MEMDBG=FFDC to enable this feature.
7 Usage
7 -memblock [dbms, fcm, fmp, appctl <id>, private (windows)] [scrape (unix)]
7 This option will report extended memory blocks from the following
7 sets/pools/heaps:
7 v DBMS
7 v FCM
7 v FMP
7 v AppCtl (shared memory set id must be supplied and database must be
7 supplied)
7 v Database
7 v Private (windows only)
7 v The ″scrape″ option on Unix does not use OSS calls to search for blocks. Instead,
7 it starts at the beginning of the memory set and walks it to the end, 4 bytes at a
7 time. This can be useful if there is suspicion that a memory block has been
7 ″orphaned″ by the OSS layer.
7 db2pd -memb OR
7 db2pd -memb dbms
7 Printing all blocks in DBMS set.
7 Address PoolID PoolName BlockID Size I P N LOC File
7 0x30944048 62 resynch 2 92 1 0 0 2314 1219138542
7 0x3092AF98 62 resynch 1 102444 1 0 0 124 4075170607
7 0x30109748 57 ostrack 6 4860032 1 0 0 2987 4279232714
7 0x300E5CC8 57 ostrack 5 140032 1 0 0 2974 4279232714
7 0x300E0048 57 ostrack 1 64 1 0 0 2910 4279232714
7 0x300E00A8 57 ostrack 2 208 1 0 0 2923 4279232714
7 0x300E0198 57 ostrack 3 80 1 0 0 2939 4279232714
7 0x300E0208 57 ostrack 4 80 1 0 0 2949 4279232714
7 0x30924048 70 apmh 5 16016 1 0 0 141 2389885231
7 0x30927EF8 70 apmh 6 124 1 0 0 2760 1219138542
7 You can then use the db2fntohash tool to map the File hash value to a filename.
7 If engn/pd/db2filenames.lst does NOT exist, you can create it. This should be
7 built with each nightly build. If engn/pd/db2filenames.lst DOES exist,
7 db2fntohash -l <hashvalue> will provide the filename.
7 db2fntohash db2filenames.in db2filenames.lst
7
7 db2fntohash -l 1219138542 db2filenames.lst
7 db2fntohash: hash value "1219138542" => file name "sqlesysc.C"
7
7 db2fntohash -l 4075170607 db2filenames.lst
7 db2fntohash: hash value "4075170607" => file name "sqlerlst.C"
7
7 db2fntohash -l 4279232714 db2filenames.lst
7 db2fntohash: hash value "4279232714" => file name "startdbm.C"
7 Example for all instance and database scope sets (DBMS, FCM, FMP, DB, AppCtl):
7 db2pd -memb all -db sample
7 Printing all blocks in DBMS set.
7 Address PoolID PoolName BlockID Size I P N LOC File
7 0x30980048 74 fcm 4 16400 1 0 0 1224 2927312349
7 0x3091FFB8 74 fcm 2 393232 1 0 0 1009 2927312349
7 0x30914048 74 fcm 1 4112 1 0 0 818 1272798017
7 0x30915078 74 fcm 3 4112 1 0 0 1042 2927312349
7 0x309D6F88 11 monh 80 69699 1 0 0 772 3881733182
7 0x309C2F88 11 monh 79 69699 1 0 0 772 3881733182
7 0x309BC048 11 monh 70 184 1 0 0 130 88219158
7 <snip>
7
7
7 Printing all blocks in FCM set.
7 Address PoolID PoolName BlockID Size I P N LOC File
7 0x813C4048 79 fcmrqb 19 16400 1 0 0 2547 1272798017
7 0x813B8048 79 fcmrqb 18 47120 1 0 0 2375 1272798017
7 0x813AC048 79 fcmrqb 17 47120 1 0 0 2375 1272798017
7 <snip>
7
7
7 Printing all blocks in FMP set.
7 Address PoolID PoolName BlockID Size I P N LOC File
7 0x90009FA8 59 undefh 1 122916 1 0 0 357 4133190529
7
7
7 Printing all blocks in Appctl set id 566624315.
7 Address PoolID PoolName BlockID Size I P N LOC File
7 0xA370C048 3 appctlh 1 64 1 0 0 150 3032704123
7 0xA370C0A8 3 appctlh 2 2992 1 0 0 1413 2658538710
7 <snip>
7
7
7 Printing all blocks in Database SAMPLE set.
7 Address PoolID PoolName BlockID Size I P N LOC File
7 0x4093C048 5 utilh 1 64 1 0 0 150 3032704123
7 Usage
7 -bindump [-db <database>] [-inst]
7 v DBMS, FCM, FMP sets dumped with -bindump.
7 v DBMS, DB, AppCtl sets dumped with -db <database>.
7 v DBMS, FCM, FMP, DB, AppCtl sets dumped with -db <database> and -inst.
7 Example -bindump:
7 db2pd -bind
7 Sending -bindump output to /home/jmcmahon/db2pd.bin
7 Dumping DBMS set starting at 0x30000000 with size 52690944
7 Dumping FCM set starting at 0x80000000 with size 43270144
7 Dumping FMP set starting at 0x90000000 with size 257654784
7 Usage
7 -binload <shared memory dump> | <corefile> [any db2pd option]
7 This is very useful when you have a shared memory dump from the -bindump
7 option. You can run ANY db2pd option just like it is from a live system.
7 Note that the default name is ″db2pd.bin″ which is the default when the -bindump
7 option is used without a filename.
7 Starting with Saturn code (FP9), the -binload option will look for the string ″core″
7 and treat the file as a core dump if the filename starts with ″core.″ This
7 functionality has only had limited testing. Please report any issues to
7 db2raspdcore@ca.ibm.com.
7 Note: Run db2pd in interactive mode and then run each desired option. That will
7 prevent having to load the shared memory dump each time you run db2pd
7 with the -binload option.
7 Example -binload:
7 db2pd -binl -memp
7 Reading memory dump from file db2pd.bin.
7 Allocated segment at address 0x30000000 with shmid 524307.
7 Allocated segment at address 0x40000000 with shmid 393245.
7 Allocated segment at address 0xa0000000 with shmid 524306.
7 Allocated segment at address 0x80000000 with shmid 917519.
7 Allocated segment at address 0x90000000 with shmid 1572876.
7
7
7 Database Partition 0 -- Active -- Up 0 days 02:55:14
7
7
7 Memory Pools:
7 Address MemSet PoolName Id Overhead LogSz LogUpBnd
7 0x30000840 DBMS fcm 74 16240 417792 450560
7 0x300007A0 DBMS monh 11 24192 142032 368640
7 0x30000700 DBMS resynch 62 12112 102504 3244032
7 0x30000660 DBMS ostrack 57 13184 5000400 5046272
7 0x300005C0 DBMS apmh 70 0 38730 2129920
7 0x30000520 DBMS kerh 52 32 31488 376832
7 0x30000480 DBMS bsuh 71 3360 3598864 17137664
7 0x300003E0 DBMS sqlch 50 0 762400 786432
7 0x30000340 DBMS pmth 80 0 72 216540
7 0x300002A0 DBMS krcbh 69 0 19228 32768
7 0x30000200 DBMS debug 87 16240 12353536 12353552
7 0x80000700 FCM fcmrqb 79 16240 835632 1548336
7 0x80000660 FCM fcmce 78 16240 225328 696368
7 0x800005C0 FCM fcma 75 16240 237616 712752
7 0x80000520 FCM fcmrqb 79 16240 835632 1548336
7 0x80000480 FCM fcmce 78 16240 225328 696368
7 0x800003E0 FCM fcma 75 16240 237616 712752
7 0x80000340 FCM fcmbp 13 404848 17011260 17980332
7 0x800002A0 FCM debug 87 16240 12353536 12517392
7 0x80000200 FCM eduah 72 5984 256024 419888
7 0x900002A0 FMP undefh 59 8032 122900 245163840
7 0x90000200 FMP debug 87 16240 12353536 12517392
7
7 LogHWM PhySz PhyUpBnd PhyHWM Bnd BlkCnt CfgParm
7 417792 458752 458752 458752 Ovf 4 n/a
7 142116 180224 376832 180224 Ovf 13 MON_HEAP_SZ
7 102504 131072 3244032 131072 Ovf 2 n/a
7 5000400 5029888 5046272 5029888 Ovf 6 n/a
7 39010 49152 2129920 49152 Ovf 21 n/a
7 32396 49152 376832 49152 Ovf 11 n/a
7 3605820 3620864 17137664 3620864 Ovf 55 n/a
7 762400 786432 786432 786432 Ovf 163 n/a
7 252 16384 229376 16384 Ovf 2 n/a
7 19228 32768 32768 32768 Ovf 3 n/a
7 Using db2pd -tcbstats, the number of Inserts can be identified for a table. Here is
7 temp table TEMP1.
7 TCB Table Stats:
7 Address TbspaceID TableID TableName SchemaNm Scans ObjClass UDI
7 0x000000022094AA58 4 2 TEMP1 SESSION 0 Temp 0
7
7 DataSize IndexSize PgReorgs NoChgUpdts Reads FscrUpdates
7 1 0 0 0 0 0
7
7 Inserts Updates Deletes OvFlReads OvFlCrtes LfSize LobSize
7 21586 0 0 0 0 0 0
7 (The UsablePgs vs. TotalPages is where they would notice the space filling)
7 Once this is known, we can identify the dynamic sql statement using a table called
7 ″TEMP1.″
7 db2pd -db sample -dyn
7
7 Database Partition 0 -- Database SAMPLE -- Active -- Up 0 days 00:13:06
7
7 Dynamic Cache:
7 Current Memory Used 1022197
7 Total Heap Size 1271398
7 Cache Overflow Flag 0
7 Number of References 237
7 Number of Statement Inserts 32
7 Number of Statement Deletes 13
7 Number of Variation Inserts 21
7 Number of Statements 19
7
7 Dynamic SQL Statements:
7 Address AnchID StmtUID NumEnv NumVar NumRef NumExe Text
7 0x0000000220A08C40 78 1 2 2 3 2 declare global temporary
7 table temp1 (c1 char(6)) not logged
7 0x0000000220A8D960 253 1 1 1 24 24 insert into session.temp1
7 values(’TEST’)
7
7 State ClientPid Userid ClientNm Rowsread Rowswrtn LkTmOt
7 Inst-Active 26377 jmcmahon db2bp 22 9588 NotSet
7 Scenario 10: Monitoring log usage. db2pd -logs is useful to monitor log usage for
7 a database. Watching the Pages Written output tells whether log usage is
7 progressing or not.
7 Logs:
7 Current Log Number 4
7 Pages Written 464
7
7 Address StartLSN State Size Pages Filename
7 0x000000022022FEB8 0x000000FA0000 0x00000000 1000 597 S0000000.LOG
7 0x000000022022FF78 0x000001388000 0x00000000 1000 5 S0000001.LOG
7 0x0000000220008E78 0x000001770000 0x00000000 1000 3 S0000002.LOG
7 0x0000000220A57F58 0x000001B58000 0x00000000 1000 1000 S0000003.LOG
7 0x0000000220A32598 0x000001F40000 0x00000000 1000 1000 S0000004.LOG
7 Scenario 11: Sysplex list. Without db2pd -sysplex, the only way to report the
7 sysplex list is with db2trc.
7 Sysplex List:
7 Alias: LAKETCP
7 Location Name: LAKEERIE
7 Count: 1
7
7 IP Address Port Priority Connections Status PRDID
7 9.26.89.87 448 1 0 0
The db2support utility is designed to automatically collect all DB2 and system
diagnostic information available. It also has an optional interactive ″Question and
Answer″ session, which poses questions about the circumstances of your problem.
Using db2support avoids possible user errors, as you don’t need to manually type
commands such as ″GET DATABASE CONFIGURATION FOR <database name>″ or ″LIST
TABLESPACES SHOW DETAIL″. Also, you don’t require instructions on which
commands to run or what files to collect, therefore information-gathering for
problem determination is quicker.
Note: The db2support utility should be run by a user with SYSADM authority,
such as an instance owner, so that the utility can collect all of the necessary
information without an error. If a user without SYSADM authority runs
db2support, SQL errors (SQL1092) might result when the utility runs
commands such as ″query client″ or ″list active databases″.
Executing db2support -h brings up the complete list of possible options you can
run the utility with. The following basic invocation is usually sufficient for
collecting most of the information required to debug a problem (note that if the -c
option is used the utility will establish a connection to the database):
db2support <output path> -d <database name> -c
The db2support tool adds the output of the various commands that it runs to the
archive as files without encapsulating them in a directory (as of DB2 v.7, FixPak 7).
Previously, generated command output was stored in either db2support.html or
detailed_system_info.html. db2support no longer store all it’s output files under
one output directory. Rather, db2support creates multiple subdirectories, and
organizes each output file under an appropriate subdirectory. This avoids a mass
of files existing under a single directory, and having to search through the list of
files to find the one of interest. The subdirectory names help organize and
categorize the type of data that is captured. For example, the database manager
configuration, which has the output filename of dbm.supp_cfg, is stored under the
subdirectory named DB2CONFIG. The diagnostic files and contents that exist under
DIAGPATH (e.g., db2diag.log) is stored under the subdirectory named DB2DUMP.
The type of information that db2support captures depends on the way the
command is invoked, whether or not the database manager has been started, and
whether it’s possible to connect to the database.
The db2support utility collects the following information under all conditions:
v db2diag.log
v All trap files
v Lock list files
v Dump files
v Buffer pool and table space (SQLSPCS.1 and SQLSPCS.2) control files (with -d)
v Various system related files
v Output from various system commands
v db config (with -d)
v dbm config files
v Log File Header file (with -d)
v Recovery History File (with -d)
v db2cli.ini
The HTML report db2support.html will always include the following information:
v PMR number, if one exists (if -n was specified)
v Operating system and level (for example, AIX 4.5)
v DB2 release information
v Engine library header information
v 32- vs 64-bit environment
36 DB2 Troubleshooting Guide
db2support - Problem Analysis and Environment Collection Tool
The db2support.html file contains the following information if DB2 has been
started:
v Client connection state
v db/dbm config (db cfg require -d option)
v CLI config
v Memory pool info (size and consumed). Complete data if -d option used
v The result of the LIST ACTIVE DATABASES command
v The result of the LIST DATALINKS MANAGERS command
v The result of the LIST DCS APPLICATIONS command
The db2support.html file contains the following information if -c has been specified
and a connection to the database can be made
v Number of user tables
v Approximate size of DB data
v Database snapshot
v Application snapshot
v Buffer pool information
v The result of the LIST APPLICATIONS command
v The result of the LIST COMMAND OPTIONS command
v The result of the LIST DATABASE DIRECTORY command
v The result of the LIST INDOUBT TRANSACTIONS command
v The result of the LIST NODEGROUPS command
v The result of the LIST NODES command
Related reference:
v db2support - Problem Analysis and Environment Collection Tool Command
Related concepts:
v on page 0
v “Diagnostic tools (UNIX)” on page 38
errpt
The errpt command reports system errors such as hardware errors and network
failures.
v For an overview that shows one line per error, use errpt
v For a more detailed view that shows one page for each error, use errpt -a
v For errors with an error number of ″1581762B″, use errpt -a -j 1581762B
v To find out if you ran out of paging space in the past, use errpt | grep SYSVMM
v To find out if there are token ring card or disk problems, check the errpt output
for the phrases ″disk″ and ″tr0″
lsps
The lsps -a command monitors and displays how paging space is being used.
lsattr
This command displays various operating system parameters. For example, use the
following command to find out the amount of real memory on the node:
lsattr -l sys0 -E
This example lets you see the maximum number of processes per user.
xmperf
For AIX systems using Motif, this command starts a graphical monitor that collects
and displays system-related performance data. The monitor displays 3-dimensional
diagrams for each node in a single window, and is good for high-level monitoring.
However, if activity is low, the output from this monitor is of limited value.
df
truss
pstack
The following tools are available for monitoring the performance of your
UNIX-based system.
vmstat
This command is ideal for monitoring paging rate, which can be found under the
page in (pi) and page out (po) columns. Other important columns are the amount
of allocated virtual storage (avm) and free virtual storage (fre).
iostat
This command is useful for monitoring I/O activities. You can use the read and
write rate to estimate the amount of time required for certain SQL operations (if
they are the only activity on the system).
netstat
This command lets you know the network traffic on each node, and the number of
error packets encountered. It is useful for isolating network problems.
system file
db2_all
Provides information for all logical nodes. The following example shows active
applications for all logical nodes:
db2_all ";db2 LIST APPLICATIONS"
rah
Provides information for all physical nodes. This command is useful for filtering
out multiple entries that might occur using db2_all when there are multiple logical
nodes on machines. The following example lists the first three lines of the
hardware error log for each physical node:
rah ";errpt | head -3"
spmon
If using multiple nodes on RS/6000 SP systems, you may need to check if the high
performance switch (HPS) is running on all workstations.
To view the status of all nodes, use one of the following commands from the
control workstation:
v spmon -d for ASCII output
v spmon -g for a graphical user interface
Alternatively, use the command netstat -i from a node workstation to see if the
switch is down. If the switch is down, there is an asterisk (*) beside the node
name. For example:
css0* 65520 <Link>0.0.0.0.0.0
Related reference:
v Diagnostic tools for Windows operating systems
v Administration logs, error logs and first failure data capture
On Linux/UNIX platforms, all of the DB2 processes running under an instance can
be displayed using the db2_local_ps command:
/home/db2v8> db2_local_ps
(/home/db2v8) $ db2_local_ps
Node 1
UID PID PPID C STIME TTY TIME CMD
db2v8 41292 40012 0 Jan 19 - 0:00 db2sysc 1
db2v8 28270 41292 0 Jan 19 - 6:34 db2fcmdm 1
db2v8 37768 41292 0 Jan 19 - 0:00 db2gds 1
db2v8 38928 41292 0 Jan 19 - 0:00 db2panic (idle) 1
db2v8 39578 41292 0 Jan 19 - 0:00 db2tcpcm 1
db2v8 40284 41292 0 Jan 19 - 0:00 db2resync 1
db2v8 40910 41292 0 Jan 19 - 0:00 db2ipccm 1
root 41030 41292 0 Jan 19 - 0:00 db2ckpwd 1
db2v8 42058 41292 0 Jan 19 - 0:00 db2pdbc 1
root 43348 41292 0 Jan 19 - 0:00 db2ckpwd 1
root 43864 41292 0 Jan 19 - 0:00 db2ckpwd 1
db2v8 44380 41292 0 Jan 19 - 0:00 db2spmrsy 1
db2v8 33514 37768 0 Jan 19 - 0:00 db2srvlst 1
db2v8 44896 37768 0 Jan 19 - 0:00 db2spmlw 1
db2v8 45532 37768 0 10:12:05 - 0:03 db2cart 1
db2v8 45738 40910 0 10:12:04 - 0:00 db2agent (instance) 1
db2v8 48518 40910 0 10:13:50 - 1:20 db2agent (idle) 1
Node 2 ...
Note that no processes will be shown if the instance is stopped. Run the db2start
command if no processes are listed.
On Windows platforms, all of the DB2 processes running under an instance can be
displayed using the db2stat command:
C:\>db2stat
Environment Strings
--> DB2INSTANCE=DB2
--> DB2TEMPDIR=D:\IBM\SQLLIB\
DB2 Processes
DB2JDS 960 x3C0
DB2LICD 1004 x3EC
DB2SEC 1020 x3FC
DB2RCMD 1036 x40C
DB2SYSTRAY 1508 x5E4
DB2SYSCS 1780 x6F4
DB2FMP 1424 x590
DB2STAT 1988 x7C4
One thing to note in the Windows case is that because DB2 is thread-based (not
process-based), you will only see one process (DB2SYSCS) for all of an instance’s
EDUs. It is obvious that the same degree of information is not returned in
Windows as is returned in UNIX, but it is still useful at times to know the process
ID for a running instance. For example, you can use the Task Manager utility to
determine the CPU and memory usage for a given process ID.
Flags control the types of information displayed for each active process, and may
be applied simultaneously to give a cumulative effect. You can access information
on the command syntax and flag options by using the man ps command on a
system command prompt.
Example: To show all processes of the instance ID ″svtdbm″ use: ps -fu svtdbm
The following sample shows typical output from this command. Additional
processes would appear on multi-partitioned systems.
Legend:
1. The instance ID “(return to example)”
2. The process identifier (pid) “(return to example)”
3. The parent process identifier “(return to example)”
4. The timestamp “(return to example)”
5. The name of the process. The related links for more information.
“(return to example)”
6. The communication listeners (in this sample, APPC and TCP/IP listeners and
the TCP/IP interrupt manager) are up “(return to example)”
7. The system controller process
On UNIX-based systems other than AIX® and SCO OpenServer, the db2sysc
process is the only process shown for all server-side processes (for example,
agents, loggers, page cleaners, and prefetchers). On Solaris systems, you can see
these side processes with the command /usr/ucb/ps axw. “(return to example)”
Related reference:
v Understanding the DB2 process model
Trace files
Basic trace diagnostics
If you experience a recurring and reproducible problem with DB2, tracing
sometimes allows you to capture additional information about it. Under normal
circumstances, you should only use a trace if asked to by DB2 Customer Support.
The process of taking a trace entails setting up the trace facility, reproducing the
error and collecting the data.
The amount of information gathered by a trace grows rapidly. When you take the
trace, capture only the error situation and avoid any other activities whenever
possible. When taking a trace, use the smallest scenario possible to reproduce a
problem.
The process of performing traces often has a global effect on the behavior of a DB2
instance. The degree of performance degradation is dependent on the type of
problem and on how many resources are being used to gather the trace
information.
DB2 Customer Support should provide the following information when traces are
requested:
v Simple, step by step procedures
v An explanation of where each trace is to be taken
v An explanation of what should be traced
v An explanation of why the trace is requested
v Backout procedures (i.e. how to disable all traces)
Trace information is not always helpful in diagnosing an error. For example, it may
not capture the error condition in the following situations:
v The trace buffer size you specified was not large enough to hold a complete set
of trace events, and useful information was lost when the trace stopped writing
to the file or wrapped.
v The traced scenario did not re-create the error situation.
v The error situation was re-created, but the assumption as to where the problem
occurred was incorrect. For example, the trace was collected at a client
workstation while the actual error occurred on a server.
Please keep in mind that there is added overhead when a trace is running so
enabling the trace facility may impact your system’s performance.
In general, DB2 Support and development teams use DB2 traces to debug
customer problems. You might run a trace to gain further information about a
problem that you are investigating, but its use is rather limited without knowledge
of the DB2 source code.
Note: You will need one of SYSADM, SYSCTRL or SYSMAINT authority to use
db2trc
Command syntax:
To get a general idea of the options available, execute the db2trc command without
any parameters:
C:\>db2trc Usage: db2trc (chg|clr|dmp|flw|fmt|inf|off|on) options
Command parameters:
chg|change
Change the trace mask, maxSysErrors or maxRecordSize
clr|clear
Clear the trace
dmp|dump
Dump the trace to a binary trace file
flw|flow
Show control flow of the trace
fmt|format
Format the trace
inf|info|information
Get information on the trace off Turn the trace off on Turn the trace on
For more information about a specific db2trc command parameter, use the -u
option. For example, to see more information about turning the trace on, execute
the following command:
db2trc on -u
This will provide information about all of the additional options (labeled as
″facilities″) that can be specified when turning on a DB2 trace.
The most important option that you need to be aware for turning on trace is -L.
This specifies the size of the memory buffer that will be used to store the
information being traced. The buffer size can be specified in either bytes or
megabytes. (To specify megabytes append either ″M″ or ″m″ after the value). The
trace buffer size must be a power of two megabytes. If you specify a size that does
not meet this requirement, the buffer size will automatically be rounded down to
the nearest power of two.
If the buffer is too small, information might be lost. By default only the most
recent trace information is kept if the buffer becomes full. If the buffer is too large,
it might be difficult to send the file to the DB2 support team.
However, if you are tracing a larger operation or if a lot of work is going on at the
same time, a larger trace buffer may be required.
On most platforms, tracing can be turned on at any time and works as described
above. However, there are certain situations to be aware of:
1. On multiple database partition systems, you must run a trace for each physical
(as opposed to logical) database partition.
2. On Solaris platforms, if the trace is turned off after the instance has been
started, a very small buffer will be used regardless of the size specified. To
effectively run a trace on Solaris, turn the trace on before starting the instance
and ″clear″ it as necessary afterwards.
DB2 trace memory buffers: The most important option that you need to be aware
for turning on trace is -l. This specifies the size of the memory buffer that will be
used to store the information being traced. The buffer size can be specified in
either bytes or megabytes. (To specify megabytes append either ″M″ or ″m″ after
the value). The trace buffer size must be a power of two megabytes. If you specify
a size that does not meet this requirement, the buffer size will automatically be
rounded down to the nearest power of two.
If the buffer is too small, information might be lost. By default only the most
recent trace information is kept if the buffer becomes full. If the buffer is too large,
it might be difficult to send the file to the DB2 support team.
However, if you are tracing a larger operation or if a lot of work is going on at the
same time, a larger trace buffer may be required.
On most platforms, tracing can be turned on at any time and works as described
above. However, there are certain situations to be aware of:
1. On multiple database partition systems, you must run a trace for each physical
(as opposed to logical) database partition.
2. On Solaris platforms, if the trace is turned on after the instance has been
started, a very small buffer will be used regardless of the size specified. To
effectively run a trace on Solaris, turn the trace on before starting the instance
and ″clear″ it as necessary afterwards.
Dumping a trace file: Once the trace facility has been enabled using the on
option, all subsequent work done by the instance will be traced.
While the trace is running, you can use the clr option to clear out the trace buffer.
All existing information in the trace buffer will be removed.
C:\>db2trc clr
Trace has been cleared
Once the operation being traced has finished, use the dmp option followed by a
trace file name to dump the memory buffer to disk. For example:
The trace facility will continue to run after dumping the trace buffer to disk. To
turn tracing off, use the off option:
C:\>db2trc off
Trace is turned off
Formatting a DB2 trace file: The dump file created above is in a binary format
that is not readable.
To verify that a trace file can be read, format the binary trace file to show the flow
control and send the formatted output to a null device. The following example
shows the command to perform this task:
db2trc flw example.trc nul
The output for this command will explicitly tell you if there is a problem reading
the file, and whether or not the trace was wrapped.
At this point, the dump file could be sent to DB2 Support. They would then format
it based on your DB2 service level. However, you may sometimes be asked to
format the dump file into ASCII format before sending it. This is accomplished via
the flw and fmt options. You must provide the binary dump file along with the
name of the ASCII file that you want to create:
C:\>db2trc flw trace.dmp trace.flw
C:\Temp>db2trc flw trace.dmp trace.flw
Total number of trace records : 18854
Trace truncated : NO
Trace wrapped : NO
Number of trace records formatted : 1513 (pid: 2196 tid 2148 node: -1)
Number of trace records formatted : 100 (pid: 1568 tid 1304 node: 0)
...
If this output indicates ″Trace wrapped″ is ″YES″, then this means that the trace
buffer was not large enough to contain all of the information collected during the
trace period. A wrapped trace might be okay depending on the situation. If you
are interested in the most recent information (this is the default information that is
maintained, unless the -L option was used to specify otherwise), then what is in
the trace file might be sufficient. However, if you are interested in what happened
at the beginning of the trace period or if you are interested in everything that
occurred, you might want to redo the operation with a larger trace buffer.
db2trc on -l 8M
db2trc clr
<execute command>
db2trc dump db2trc.dmp
db2trc off
db2trc flw db2trc.dmp <filename>.flw
db2trc fmt db2trc.dmp <filename>.fmt
db2trc fmt -c db2trc.dmp .fmtc
The db2drdat utility records the data interchanged between the DB2 Connect
server (on behalf of the database client) and the host or iSeries™ database server.
Command syntax:
To get a general idea of the options available, issue the following command:
db2drdat -help
Command parameters:
on Turns the DRDA trace on
off Turns the DRDA trace off
-i Include timestamps
-c Trace SQLCAs
-r Trace DRDA receive buffers
-s Trace DRDA send buffers
-l=LENGTH
Sets the size of the trace buffer (in bytes). The default value is one
megabyte.
-t=TRACEFILE
TRACEFILE is the file name where the captured trace will be stored. The
default file name is db2drdat.dmp.
-p=PROCESSID
PROCESSID is the ID of a process to be traced. If PROCESSID is not
specified, all process IDs for the DB2 instance are traced.
Usage:
Output from db2drdat lists the data streams exchanged between the DB2 Connect
workstation and the host or iSeries database server management system. Data sent
to the host or iSeries database server is labeled SEND BUFFER and data received
from the host or iSeries database server is labeled RECEIVE BUFFER.
The remaining data in send and receive buffers is divided into five columns,
consisting of:
v A byte count.
v Columns 2 and 3 represent the DRDA(R) data stream exchanged between the
two systems, in ASCII or EBCDIC.
v An ASCII representation of columns 2 and 3.
v An EBCDIC representation of columns 2 and 3.
SEND BUFFER(AR):
For more information, see the DB2 for OS/390 Reference for Remote DRDA Requesters
and Servers, the Distributed Relational Database Reference, and the Distributed Data
Management Architecture Level 3: Reference.
Related reference:
v db2drdat - DRDA Trace Command
Enabling JDBC traces: The JDBC trace is enabled by adding specific entries to the
db2cli.ini file.
Note: There are lots of keywords that can be added to the db2cli.ini file that can
affect application behavior. These keywords can resolve or be the cause of
application problems. There are also some keywords that are not covered in
the CLI documentation. Those are only available from DB2 Service and
Support. If you have keywords in your db2cli.ini file that are not
documented, it is likely that they were a recommendation from the DB2
support team.
c. Save the file with at least one blank line at the end of the file. (This
prevents some parsing errors.)
Option B: Using UPDATE CLI CFG commands to update the db2cli.ini
file. Issue the following commands:
db2 UPDATE CLI CFG FOR SECTION COMMON USING JDBCTrace 1
db2 UPDATE CLI CFG FOR SECTION COMMON USING JDBCTracePathName <path>
where <path> is, for example, C:\temp\trace on Windows, or /tmp/trace
on UNIX platforms.
db2 UPDATE CLI CFG FOR SECTION COMMON USING JDBCTraceFlush 1
Step 3. Confirm the db2cli.ini configuration
Issue the following command to verify that the correct keywords are set
and being picked up:
db2 GET CLI CFG FOR SECTION COMMON
Step 4. Restart the application
The db2cli.ini file is only read when the application starts, therefore, for
any changes to take effect, the application must be restarted.
If tracing a JDBC stored procedure, this means restarting the DB2 instance.
Step 5. Capture the error
Run the application until the error is generated, then terminate the
application. If it is possible, reduce the situation, such that the only JDBC
applications that are running at the time of trace are those related to the
problem recreation. This makes for much clearer trace files.
Step 6. Disable the JDBC trace
Set the JDBCTrace=0 keyword in the [COMMON] section of the db2cli.ini
manually, or issue:
db2 UPDATE CLI CFG FOR SECTION COMMON USING Trace 0
db2 UPDATE CLI CFG FOR SECTION COMMON USING JDBCTrace 0
Restart any applications that are running and tracing.
Step 7. Collect the trace files
The JDBC trace files will be written to the path specified in the
JDBCTracePathName keyword. The filenames generated will all end with
a .trc extension. All files generated in the trace path at the time of the
problem recreation are required.
When you use the trace facility to diagnose application issues, keep in mind that it
does have an impact on application performance and that it affects all applications,
not only your test application. This is why it is important to remember to turn it
off after the problem has been identified.
If you use the DataSource interface to connect to a data source, then use the
DataSource.setTraceLevel() and DataSource.setTraceFile() method to enable tracing.
Option B:
If you use the DriverManager interface to connect to a data source, the easiest way
to enable tracing will be to set the logWriter on DriverManager before obtaining a
connection.
For example:
DriverManager.setLogWriter(new PrintWriter(new FileOutputStream("trace.txt")));
Option C:
If you are using the DriverManager interface, you can alternatively specify the
traceFile and traceLevel properties as part of the URL when you load the driver.
For example:
String databaseURL = "jdbc:db2://hal:50000/sample:traceFile=c:/temp/foobar.txt;" ;
More details on each of these options are provided in JDBC and SQLJ problem
diagnosis with the DB2 Universal JDBC Driver.
The CLI trace offers very little information about the internal workings of the DB2
CLI driver.
This type of trace is applicable for situations where a problem is encountered in:
v a JDBC application which uses the CLI-based Legacy Type 2 JDBC driver
v DB2 JDBC stored procedures1
Note: Internally, the CLI-based Legacy Type 2 JDBC Driver makes use of the DB2
CLI driver for database access. For example, the Java getConnection()
method is internally mapped by the CLI-based Legacy Type 2 JDBC Driver
to the DB2 CLI SQLConnect() function. As a result, Java developers might
find a DB2 CLI trace to be a useful complement to the DB2 JDBC trace. See
CLI Traces.
Related reference:
v CLI/ODBC/JDBC trace facility
v CLI and JDBC trace files
1. Most of the DB2 CLI trace information and instructions which follow are generic and apply to both applications and stored
procedures equally. However, unlike applications which are clients of a database server (and typically execute on a machine
separate from the database server), stored procedures execute at the database server. Therefore, the following additional steps
must be taken when tracing DB2 CLI stored procedures:
– Ensure the trace keyword options are specified in the db2cli.ini file located at the DB2 server.
– Ensure all keywords are configured correctly prior to database startup time (that is, when the db2start command is issued).
Changing trace settings while the database server is running may have unpredictable results.
Obtaining traces of applications that use the DB2 Universal JDBC Driver: To
obtain data for diagnosing SQLJ or JDBC problems with the DB2 Universal JDBC
Driver, collect trace data and run utilities that format the trace data. You should
run the trace and diagnostic utilities only under the direction of IBM(R) software
support.
Related reference:
v JDBC and SQLJ problem diagnosis with the DB2 Universal JDBC Driver
v Example of tracing under the DB2 Universal JDBC Driver
db2diag.log:
Diagnostic information about errors is recorded in this text log file. This
information is used for problem determination and is intended for DB2 customer
support. The level of detail of the information is determined by the DIAGLEVEL
configuration parameter.
db2dasdiag.log:
Dump files:
For some error conditions, extra information is logged in external binary files
named after the failing process ID. These files are intended for use by DB2
customer support.
Trap files:
The database manager generates a trap file if it cannot continue processing because
of a trap, segmentation violation, or exception.
When DB2 terminates abnormally, the operating system generates a core file. The
core file is a binary file that contains information similar to the DB2 trap files. Core
files may also contain the entire memory image of the terminated process.
Related reference:
v Interpreting the administration and error logs
v Dump files
v Trap files
v Interpreting platform specific error logs
v notifylevel - Notify level configuration parameter
v diaglevel - Diagnostic error capture level configuration parameter
The default value for DIAGPATH is a null string. It is recommended that you keep
this default value. If you choose to change the value, it is recommended that you
use a centralized location, especially if there are multiple database instances.
The default value of NULL means that the first failure data capture (FFDC)
information is placed in the following locations:
v For Windows® systems:
– If the DB2INSTPROF environment variable is not set: db2path\db2instance
(where db2path is the path referenced in the DB2PATH environment variable,
and db2instance is the environment variable containing the ID of the instance
owner).
– If the DB2INSTPROF environment variable is set: x:\db2instprof\db2instance,
where x is the drive referenced in the DB2PATH environment variable,
db2instprof is the instance profile directory, and db2instance is the environment
variable containing the ID of the instance owner.
Note: On Windows NT®, Windows 2000 and Windows XP systems, the DB2
administration notification log is found in the event log and can be
reviewed through the Windows Event Viewer. On other operating
systems, the administration notification log for the instance is called
instance_name.nfy. The diagnostics log (db2diag.log) is still located in the
DIAGPATH path.
v For UNIX® operating systems:
– $HOME/sqllib/db2dump, where $HOME is the home directory of the instance
owner.
We recommend that you clean out the DIAGPATH directory periodically to keep it
from becoming too large.
Related reference:
v diagpath - Diagnostic data directory path configuration parameter
If the database is behaving normally, this type of information is not important and
can be ignored.
v The Administration logs grow continuously . When they get too large, back
them up and then erase the file. A new set of files is generated automatically the
next time they are required by the system.
The following example shows the header information for a sample log entry, with
all the parts of the log identified.
Note: Not every log entry will contain all of these parts.
2002-02-05-03.14.39.020766 ▌1▐ Instance:db2inst1 ▌2▐ Node:000 ▌3▐
PID:89198(db2agent (MYDB )) ▌4▐ Appid:*LOCAL.db2inst1.020205091435 ▌5▐
recovery manager ▌6▐ sqlpresr ▌7▐ Probe:1 ▌8▐ Database:MYDB ▌9▐
ADM1530E ▌10▐ Crash recovery has been initiated. ▌11▐
Legend:
1. A timestamp for the message.
2. The name of the instance generating the message.
3. For multi–partition systems, the partition generating the message. (In a
non-partitioned database, the value is ″000″.)>
4. The DB2 component that is writing the message. For messages written by user
applications using the db2AdminMsgWrite API, the component will read “User
Application”.
Example 1
A power outage causes your DB2 server machine to reboot. While rebooting, some
of the file systems do not remount properly.
You want to check on your database’s integrity after the outage, so you start the
instance and connect to the database. The connection is successful. In the
administration notification log, you see the following entries:
*
2002-02-05-03.14.39.020766 Instance:db2inst1 Node:000
PID:89198(db2agent (MYDB )) Appid:*LOCAL.db2inst1.020205091435
recovery manager sqlpresr Probe:1 Database:MYDB ▌2▐
ADM1530E Crash recovery has been initiated. ▌3▐
*
2002-02-05-03.14.44.524546 Instance:db2inst1 Node:000
PID:89198(db2agent (MYDB )) Appid:*LOCAL.db2inst1.020205091435
recovery manager sqlpresr Probe:350 Database:MYDB
ADM1533W Database has recovered. However, one or more tablespaces are
offline. ▌4▐
*
2002-02-05-03.14.44.956773 Instance:db2inst1 Node:000
PID:89198(db2agent (MYDB )) Appid:*LOCAL.db2inst1.020205091435
recovery manager sqlpresr Probe:370 Database:MYDB
ADM1531E Crash recovery has completed successfully. ▌5▐
Legend:
1. Table space ″TS1″ has been put offline and is marked roll-forward pending.
This has probably happened because TS1 was located on one of the file systems
that did not get remounted during the machine’s reboot.
2. The name of the database being recovered was MYDB.
3. A notification that database crash recovery has initialized.
4. Crash recovery indicates that the database was recovered but one or more table
spaces were not recovered because they were offline. The table space that was
offline is indicated in an earlier message (1).
5. A notification that the database crash recovery was successful.
From here, the db2 list tablespace containers command can identify the file
systems associated with table space TS1. Your system administrator can put the
table space back online by remounting the file systems. You can then roll forward
the tablespace.
Example 2
The message indicates the container on which the file system error occurred. Using
this information, ensure that there is enough file space on the container. If the file
space is sufficient, then ask your system administrator to investigate any system
resource limits. For example, on UNIX®, the ulimit command can restrict the
maximum file size that a user can access.
Related reference:
v Administration logs, error logs and first failure data capture
v Location of logs and files
v notifylevel - Notify level configuration parameter.
Note: The Administration logs grow continuously. When they get too large, back
them up and then erase the file. A new set of files is generated automatically
the next time they are required by the system.
The following example shows the header information for a sample log entry, with
all the parts of the log identified.
Note: Not every log entry will contain all of these parts. Only the first several
fields (timestamp to TID) and FUNCTION will be present in all the
db2diag.log records.
2005-01-20-00.28.11.406000-480 1 I2841H435 2 LEVEL: Error 3
PID : 740 4 TID : 2640 5 PROC : db2syscs.exe 6
INSTANCE: DB2 7 NODE : 000 8 DB : SAMPLE 9
APPHDL : 0-7 10 APPID: *LOCAL.DB2.050120082811 11
FUNCTION: 12 DB2 UDB, data protection, sqlpsize, probe:20
RETCODE : 13 ZRC=0x860F000A=-2045837302=SQLO_FNEX "File not found."
DIA8411C A file "" could not be found.
Legend:
1. A timestamp and timezone for the message.
2. The record ID field. The db2diag.log’s recordID specifies the file offset at
which the current message is being logged (e.g. ″2841″) and the message
length (e.g. ″435″) for the platform where the DB2 diagnostic log was
created.
3. The diagnostic level associated with an error message. e.g. Info, Warning,
Error, Severe, or Event
4. The process ID
5. The thread ID
6. The process name
7. The name of the instance generating the message.
8. For multi-partition systems, the partition generating the message. (In a
non-partitioned database, the value is ″000″.)
9. The database name.
10. The application handle. This value aligns with that used in db2pd output
and lock dump files. It consists of the coordinator partition number
followed by the coordinator index number, separated by a dash.
11. Identification of the application for which the process is working. In this
example, the process generating the message is working on behalf of an
application with the ID *LOCAL.db2inst1.020205091435.
A TCP/IP-generated application ID is composed of three sections
1. IP address: It is represented as a 32-bit number displayed as a
maximum of 8 hexadecimal characters.
2. Port number: It is represented as 4 hexadecimal characters.
3. A unique identifier for the instance of this application.
13. The return code (if any) returned by a called function. This field consists of
a type (″ZRC″), the return code value, and the corresponding error
description.
Note: Timestamps in the db2diag.log contain a time zone in DB2 version 8.2. For
example: 2005-01-20-00.28.11.406000-480, where ″-480″ is the difference
between UTC (Coordinated Universal Time, formerly known as GMT) and
local time at the application server in minutes. Thus -480 represents
UTC - 8 hours, i.e. PST (Pacific Standard Time).
Now that you have seen a sample db2diag.log entry, here is a list of all of the
possible fields:
<timestamp><timezone> <recordID> LEVEL: <level> (<source>)
PID : <pid> TID : <tid> PROC : <procName>
INSTANCE: <instance> NODE : <node> DB : <database>
APPHDL : <appHandle> APPID: <appID>
FUNCTION: <prodName>, <compName>, <funcName>, probe:<probeNum>
MESSAGE : <messageID> <msgText>
CALLED : <prodName>, <compName>, <funcName> OSERR: <errorName> (<errno>)
RETCODE : <type>=<retCode> <errorDesc>
ARG #N : <typeTitle>, <typeName>, <size> bytes
... argument ...
DATA #N : <typeTitle>, <typeName>, <size> bytes
... data ...
The only exception is the case when the first message in a log file is produced by a
component using ossLog API calls (e.g. the DAS, genreg, etc) in which case there
will not be an informational record output.
Information in this record is only valid at the time when this file
was created (refer to this record’s time stamp for that information).
The Informational record is output for ″db2start″ on every logical partition. This
results in multiple informational records: one per logical partition. Since the
informational record contains memory values which are different on every
partition, this information may be useful.
Legend:
1. Beginning of the SQLCA entry.
2. The SQL state (when negative, an error has occurred).
3. Any reason codes associated with the SQL error code.
4. Sometimes there are several errors leading to the final SQL error code.
These errors are shown in sequence in the sqlerrd area and may be
described by calling db2diag -rc error_code if they are ZRC or ECF errors
(i.e. start with 0x8 or 0x9).
Related reference:
v Administration logs, error logs and first failure data capture
v Location of logs and files
v SQLCA (SQL communications area)
v db2diag - Analyzing db2diag.log files
v diaglevel - Diagnostic error capture level configuration parameter
Dump files
Dump files are created when an error occurs for which there is additional
information that would be useful in diagnosing a problem (such as internal control
blocks). Every data item written to the dump files has a timestamp associated with
it to help with problem determination. Dump files are in binary format and are
intended for DB2® customer support representatives.
Legend:
▌1▐ In this UNIX® example, SECTION STMT data is stored in a file named
56772.000 located in the /home/db2/sqllib/db2dump directory.
Notes:
v For partitioned database systems, the file extension identifies the partition
number. For example, the following entry indicates that the dump file was
created by a DB2 process running on partition 10:
Dump File: /home/db2/sqllib/db2dump/56772.010 Data : SECTION STMT
Related concepts:
v on page 0
v on page 0
v on page 0
v on page 0
v “System core files (UNIX)” on page 69
Trap files
DB2® generates a trap file if it cannot continue processing because of a trap,
segmentation violation, or exception.
All signals or exceptions received by DB2 are recorded in the trap file. The trap file
also contains the function sequence that was running when the error occurred. This
sequence is sometimes referred to as ″function call stack″ or ″stack traceback.″ The
trap file also contains additional information about the state of the process when
the signal or exception was caught.
DB2 customer support may require trap files for problem analysis. They are
located in the directory specified by the DIAGPATH database manager
configuration parameter.
On Windows® systems, each trap file is named Pxxxxx.yyy where xxxxx is the PID
and yyy is the database partition number (or 000 on single partition databases). If
the trap file is generated because of an exception, it will have the extension .TRP.
Examples:
v t56772.000 is a trap file for the process with pid 56772.
v t56772.010 is a trap file for the process with pid 56772. It was created by a DB2
process running on partition 10.
DB2 can generate a trap files on demand, but you should only do this if requested
by DB2 Customer Support.
Refer to db2nstck and db2_call_stack - Generating EDU call stacks if you are
required to generate trap files.
Related reference:
v db2nstck and db2_call_stack - Generating EDU call stacks
v Administration logs, error logs and first failure data capture
v System core files - UNIX only
v Dr Watson log and Windows event logs
Authorization
Command syntax
>>-db2xprt--+----------+--+----+--+----+-- infile --+---------+><
+-/p-- path -+ ’-/m-’ ’-/n-’ ’- outfile -’
’-/v-------’
Command parameters
/p path
A semicolon (;) separated path that points to the location or locations
where the binary files and PDB files are located.
/v Displays version information.
/m Formats a memory dump along with the rest of the trap file.
/n Format data without regard to line number information.
infile Specifies the input file.
outfile
Specifies the output file.
For example, if a trap file called ″DB30882416.TRP″ had been produced in your
DIAGPATH, you could format it as follows:
db2xprt DB30882416.TRP DB30882416.FMT
In a trap file on a Windows platform, this can be seen in the trap file as follows:
The following information is for pid <3088> tid <2416>
Exception C0000005 Occurred
Exception Address = 6C843B8C
Other Unknown access fault
Resource Limits
Data seg top [sbrk(0)] = 0x20736010
Cur data size (bytes) = 0x000000000EFFFE00
These exception and signal numbers can be looked up in operating system header
files. For example, ″signal #11 (sigsegv)″ is defined on AIX in
/usr/include/sys/signal.h as follows:
#define SIGSEGV 11 /* (*) segmentation violation */
6. SIGABRT. These are triggered by calling abort(). Most SIGABRT (Signal #6)
traps on UNIX platforms need not be investigated. There are scenarios where
the DB2 instance will intentionally be brought down with an abort() call (Signal
#6) if the situation is sufficiently severe. The abort() itself and the resulting trap
files and error entries are not a direct symptom of the problem and should not
be analyzed. In these cases, DB2 has not really trapped in the true sense. On
AIX, errpt -a will indicate a Signal #6, i.e. SIGABRT, which should also produce
a core file, i.e. a dump of the process image receiving the signal. In these cases,
the root problem may not be a DB2 problem. Certain types of data corruption
and other severe errors may cause us to bring ourselves down (aka ″panic″).
Note: You will often see several of these traps files when a SIGSEGV or SIGILL
has been encountered on another process. The parent of a trapping process
will call abort() to bring the instance down in it’s ″SIGCHLD″ signal
handler, which essentially means it sends itself a SIGABRT. Thus you will
typically see one process performing the illegal operation receiving a
SIGSEGV or SIGILL followed by it’s parent receiving a SIGABRT.
Without access to DB2 source code, you cannot go much further in your analysis of
this information. To determine whether or not you are encountering a known
Chapter 1. Troubleshooting overview 65
db2support - Problem Analysis and Environment Collection Tool
problem, however, you should identify the top two of three functions in the stack
traceback and search for existing APARs that address traps on one or all of these
functions.
APARs which address problems which had caused DB2 instances to trap should
contain information about the stack traceback which typifies the trap. Thus you are
able to ascertain whether or not the trap you are encountering is a known problem
by searching on those top stack functions. See How to effectively search for
known problems for more information. In this case, you would find that APAR
JR19727 is a very good match for this stack traceback.
If you discover that there are no existing APARs or work-arounds available which
match your situation, then at that point you will require assistance from DB2
Customer Support.
Related reference:
v Trap files
v Administration logs, error logs and first failure data capture
v System core files - UNIX only
v Dr Watson log and Windows event logs - Windows only
Based on your operating environment, there may be more places outside of what
has been described here, so be aware of all of the potential areas you ma y need to
investigate when debugging problems in your system.
Operating systems:
Every operating system has its own set of diagnostic files to keep track of activity
and failures. The most common (and usually most useful) is an error report or
event log. Here is a list of how this information can be collected:
v AIX: the /usr/bin/errpt -a command
v Solaris: /var/adm/messages* files or the /usr/bin/dmesg command
v Linux: the /var/log/messages* files or the /bin/dmesg command
v HP-UX: the /var/adm/syslog/syslog.log file or the /usr/bin/dmesg command
v Windows : the system, security, and application event log files and the
windir\drwtsn32.log file (where windir is the Windows install directory)
There are always more tracing and debug utilities for each operating system. Refer
to your operating system documentation and support material to determine what
further information is available.
Each application should have its own logging and diagnostic files. These files will
complement the DB2 set of information to provide you with a more accurate
picture of potential problem areas.
Hardware:
Hardware devices usually log informatio n into operating system error logs.
However, sometimes additional information is required. In those cases, you need to
identify what hardware diagnostic files and utilities may be available for piece of
hardware in your environment. An example of such a case is when a bad page, or
a corruption of some type is reported by DB2. Usually this is reported due to a
disk problem, in which case the hardware diagnostics would need to be
investigated. Please refer to your hardware documentation and support material to
determine what further information is available.
In situations where the meaning of the operating system error is not as clearly
defined, or when you wish to see more information about the meaning of that
error, you must refer to the error definition file on your server.
On Windows, system error header files are installed on the system with a compiler
or the Windows SDK. Here are a few constants:
#define ERROR_FILE_NOT_FOUND 2L
#define ERROR_ACCESS_DENIED 5L
#define ERROR_INVALID_ACCESS 12L
You can also invoke the net helpmsg command on Windows, which may provide
information about the error., For example,
C:\>net helpmsg 5
Access is denied.
For both UNIX and Windows platforms, besides searching any problem databases
you may have access to, you can use resources on the Web to research errors.
Searching the following locations using the error constant as a search keyword (for
example ″ENOSPC″, instead of 28), along with the operating system API being
called (if known), will often provide a few hints about the meaning or cause of the
error:
v AIX library: http://www-1.ibm.com/servers/aix/library/index.html
v HP-UX: http://docs.hp.com/
v Solaris: http://docs.sun.com/
v Windows: http://support.microsoft.com/
v And, of course, don’t forget the DB2 online support site:
http://www.ibm.com/software/data/db2/udb/support
Procedure:
To route alerts to the system error log, perform the following the steps:
1. Add the following line to the /etc/syslog.conf file.
user.warn fully_qualified_file_name
where:
v user is the facility to log. This includes DB2 and any other applications
logging messages with the same facility name.
v warn is the priority over which messages are logged. Available choices are:
alert Only alert messages are logged
err Error and alert messages are logged
warn Warning, error, and alert messages are logged
info Information, warning, error, and alert messages are logged
v fully_qualified_file_name is the file (along with its fully qualified path) where
the messages will be logged and the SQLCA will be dumped. This file will
not be created by the system; you must create it in the specified path.
2. Restart the syslog daemon so that it will know about the new configuration in
the syslog.conf file:
a. (AIX systems only) Use the refresh -s syslogd command.
b. Use the kill -1 pid_of_syslogd where pid_of_syslogd is the process ID of the
syslogd process. You can obtain this process ID by issuing the ps -fu syslogd
command.
3. Check to see if information is being logged into the syslog file by issuing:
ps -fu db2sysc
kill -36 db2sysc.process.id
4. Check the file at fully_qualified_file_name (as defined in the /etc/syslog.conf
file). If there is information in the file, then the system error log has been
enabled to capture the information.
The log file may grow quickly, and you will have to reduce its size periodically.
You must use kill -1 pid_of_syslog after you issue the following commands:
mv logfile logfile.old
touch logfile
On AIX, you can include the following line in the crontab that you run as part of
your regular system maintenance instead of using the kill command:
refresh -s syslogd
Related concepts:
v on page 0
The core file is named ″core″, and is placed in the directory where the application
was running. Note that system core files are distinct from DB2® core files.
Related concepts:
v “Determining active process status” on page 41
Prerequisites:
Procedure:
Example of the dbx Command: The following example shows how to use the
dbx command to read the core file for a program called ″main″.
1. At a command prompt, enter:
dbx main
2. Output similar to the following appears on your display:
dbx version 3.1 for AIX.
Type ’help’ for help.
reading symbolic information ...
[using memory image in core]
segmentation.violation in freeSegments at line 136
136 (void) shmdt((void *) pcAdress[i]);
3. The name of the function that caused the core dump is ″freeSegments″. If the
function name begins with ″db2″, ″sql″, or ″ddcs″, it may indicate an error in
the database manager or DB2 Connect products. Enter where at the dbx
prompt to display the program path to the point of failure.
(dbx) where
freeSegments(numSegs = 2, iSetId = 0x2ff7f730, pcAddress = 0x2ff7f758, line
136
in "main.c"
main (0x1, 2ff7f7d4), line 96 in "main.c"
In this example, the error occurred at line 136 of freeSegments, which was
called from line 96 in main.c.
4. To end the dbx command, type quit at the dbx prompt.
The method used to launch the Windows Event Viewer will differ, depending on
whether you are using Windows XP, Windows 2003, Windows 2000 or Windows
NT.
For example, to open the Event Viewer on Windows XP, click Start, click Control
Panel, click Performance and Maintenance, click Administrative Tools, and then
double-click Event Viewer.
v in text format.
Event viewer format is easy to work with since you can use the GUI to switch the
chronology order, filter for certain events, and advance forwards or backwards.
Text files provide one significant advantage - you can trust the timestamps! When
you export event logs in .evt format, the timestamps are in Coordinated Universal
Time and get converted to the local time of the machine in the viewer. If you are
not careful, you can miss key events because of time zone differences. Text files are
also easier to search, but once you load an event log from another machine into the
event viewer, it is easy enough to export it again in text format.
7 Diagnosing some problems related to memory, swap files, CPU, disk storage, and
7 other resources requires a thorough understanding of how a given operating
7 system manages these resources. At a minimum, defining resource-related
7 problems requires knowing how much of that resource exists, and what resource
7 limits may exist per user. (The relevant limits are typically for the user ID of the
7 DB2 instance owner.)
7 Here is some of the important configuration information that you need to obtain:
7 v Operating system patch level, installed software, and upgrade history
7 v Number of CPUs
7 v Amount of RAM
7 v Swap and file cache settings
7 v User data and file resource limits and per user process limit
7 v IPC resource limits (message queues, shared memory segments, semaphores)
7 v Type of disk storage (for example EMC, Shark, Network Access Storage solution)
7 v What else is the machine used for? Does DB2 compete for resources?
7 v Where does authentication occur?
7 The following exercises are intended to help you discover system configuration
7 and user environment information in various DB2 diagnostic files. The first tutorial
7 familiarizes you with the steps involved in running the db2support utility.
7 Subsequent exercises cover trap files, which provide more DB2-generated data that
7 can be useful in understanding the user environment and resource limits.
7 v Data seg top (this is the maximum private address space that has been
7 required)
7 v Cur data size (this is the maximum private address space limit)
7 v Cur core size (this is the maximum core file limit)
7 v Signal Handlers (this information may not appear in all trap files)
7 v Environment variables (this information may not appear in all trap files)
7 v map output (shows loaded libraries)
7 System messages and error logs are too often ignored. You can save hours, days,
7 and even weeks on the time it takes to solve a problem if you take the time to
7 perform one simple task at the initial stage of problem definition and investigation.
7 That task is to compare entries in different logs and take note of any that appear to
7 be related both in time and in terms of what resource the entries are referring to.
7 While not always relevant to problem diagnosis, in many cases the best clue is
7 readily available in the system logs. If we can correlate a reported system problem
7 with DB2 errors we will have often identified what is directly causing the DB2
7 symptom. Obvious examples are disk errors, network errors, and hardware errors.
7 Not-so obvious are problems reported on different machines, for example domain
7 controllers or NIS servers, which may affect connection time or authentication.
7 System logs can help to rule out crash entries in the db2diag.log as causes for
7 concern. One consistent DB2 crash recovery investigation was resolved by
7 discovering that the system was rebooting - it turned out that the cleaning staff
7 was unplugging the computer every morning at the same time!
7 This principle of correlating information extends to logs from any source and to
7 any identifiable user symptoms. For example, it can be very useful to identify and
7 document correlating entries from another application’s log even if you can’t fully
7 interpret them.
7 Related concepts:
7 v on page 0
Note: The first thing you need to do is confirm whether the installation
prerequisites are met
Before installing DB2, you should check to make sure that your environment meets
the minimum hardware and software requirements as described in the Quick
Beginnings documentation. Links to such documentation is included in the Related
reference below.
If your system does not meet the minimum requirements, then the DB2 installer
could fail. For example, a failure could occur for a simple reason such as not
having enough disk space, not having the prerequisite software installed, or kernel
parameters not being set according to minimum requirements.
Once you have eliminated the environment or non-DB2 factors, you can focus on
the techniques described in subsequent sections.
Related reference:
v Disk and memory requirements for non-partitioned DB2 UDB Enterprise Server
Edition (Windows and UNIX)
v Disk and memory requirements for partitioned DB2 UDB Enterprise Server
Edition (Windows and UNIX)
v Disk and memory requirements for DB2 UDB clients (Windows and UNIX)
v Installation requirements for non-partitioned DB2 servers (AIX)
v Installation requirements for partitioned DB2 servers (Windows)
v DB2 Information Integrator installation worksheet
v Installation requirements for Query Patroller server (UNIX)
v DB2 PDF and printed documentation
db2setup wizard:
db2_install script:
This UNIX installation method generates an error log file in /tmp called
db2_install_log.<pid>, where <pid> is the process ID which performed the
installation.
If you are installing via a response file on UNIX, you will be using the ″db2setup″
command, and the same installation error logs will be produced as described
above for the db2setup wizard.
If you are installing via a response file on Windows, you can specify the name and
location of the error log using the ″/L″ flag on the ″setup.exe″ command. If you do
not specify the log file’s name, DB2 names it db2.log. The db2.log file is located in
the My Documents\db2log folder.
Installation error logs may be produced, but the type and location of the file will
depend on the tool used. For example, if smit is used, the error log file can usually
be found in /smit.log.
Related reference:
v Installation methods for DB2 UDB (Windows and UNIX)
v Administration logs, error logs and first failure data capture
v Interpreting installation error logs
Note: Your installation history log file may not be named ″db2.log″ if you
specified a different file name and location using the -l parameter on the
setup.exe command.
The db2wi.log file contains the log of the current (or most recent) installation.
Information is written to it as the installation events occur, unlike the history log
file where the log is not actually written until the end of the installation. At the
end of the installation, the only difference between what is written to the
db2wi.log and what is appended to the history log file is that the former also
contains a list of Windows Installer properties with current values. This list of
properties is very long and is typically only looked at by DB2 Support.
Depending on the problem you are trying to solve, all of the information in the log
files may be useful, despite the complexity and amount of information contained
in the files. The difficult part is narrowing down the problem and finding the parts
of the log files that are most relevant to the problem.
Note: When you run the installation with tracing turned on, the logging is done in
verbose mode, thereby creating a log with much more information. Do not
confuse the trace file with the log file. They are different files. However, by
turning trace on, you increase the logging level of the installation. If you are
familiar with Windows Installer you will recognize that the log created
when enabling trace is the verbose log that you would typically get by
adding the /l*v parameter to windows installer based installations.
Ensuring that the log you are reading is the correct log:
In many cases you may find yourself debugging an installation that you did not
initiate. If you are unsure whether the log you are viewing is the correct log, there
are some hints that you can use to verify that it is the correct log. The best way to
determine this is to look at the time of the installation, as well as information
about the product being installed. The product shown can be the product code or
the path to the installation database used to install the product. If it is the path to
the installation database, notice that the file name contains the name of the
product. However, if it lists a globally unique identifier (GUID) for example,
{D8F53726-C7AD-11D4-9155-00203586D551}, then it is a bit more difficult. Here is a
list of the product codes for the DB2 UDB products that you can use to
cross-reference information found in the product field.
Product ID code
DB2 UDB Enterprise Server {D8F53726-C7AD-11D4-9155-
Edition 00203586D551}
DB2 UDB Workgroup Server {7A28F948-4945-4BD1-ACC2-
Edition ADC081C24830}
DB2 UDB Personal Edition {C0AA883A-72AE-495F-9601-
49F2EB154E93}
For example, consider the following excerpt of a log file. The date on which the
installation took place is February 2, 2005. The GUID is {D8F53726-C7AD-11D4-
9155-00203586D551} which matches the DB2 UDB Enterprise Server Edition:
=== Verbose logging started: 2/14/2005 15:40:03 Build type: SHIP UNICODE 2.00.2600.1183
Calling process: C:\WINNT\system32\msiexec.exe ===
MSI (c) (8C:88): Resetting cached policy values
MSI (c) (8C:88): Machine policy value ’Debug’ is 0
MSI (c) (8C:88): ******* RunEngine:
******* Product: {D8F53726-C7AD-11D4-9155-00203586D551}
******* Action:
******* CommandLine: **********
In some cases all you may be interested in is whether the installation was
successful. To determine the success or failure of an installation look at the end of
the db2wi.log file for a line that looks like the following:
MSI (s) (98:8C): Product: DB2 Enterprise Server Edition
-- Installation operation completed successfully.
If you received a failure the next step is to determine the cause of the failure. A
general tip that allows you to find the error quickly is to search for Return value 3
in the log file. Once you find this in the log file you will usually see further text
detailing what the problem is.
For example, if you had logged into the Windows server using a user ID that does
not belong to the Administrators group, and then tried to install DB2, the
db2wi.log file would contain an error as follows:
...
MSI (s) (40:10): Doing action: VerifyPrereqsCA
Action start 15:47:17: VerifyPrereqsCA.
MSI (s) (40:10): Creating MSIHANDLE (20) of type 790542 for thread 572
1: In order to install the product "DB2 Enterprise Server Edition", the user running the
installation must have at minimum the authority of a member of the user group "Administrators".
Action ended 15:47:59: VerifyPrereqsCA. Return value 3.
MSI (c) (BC:3C): Doing action: SetupCompleteError
Action start 15:47:59: SetupCompleteError.
...
In some cases the error comes directly from Windows Installer. In these cases the
error can be difficult to understand, but there are methods to get more information
about the error. In some cases you may only be presented with an error number
along with some strings separated by commas. You can look up these error types
directly from the Microsoft Web site at http://www.msdn.microsoft.com
In some cases the installation may complete successfully but with the occurrence of
a minor configuration error. When these types of errors occur it means that the
installation completed, however an error occurred during the configuration stage
of the installation. When this occurs the installation exit code will be set to 1. The
most common place to look for these types of errors is during the execution of the
action that performs most of the up and running operations. The output from this
task can be found by searching for a line that looks like the following:
The up and running portion of the installation which runs during the Custom
Action DeferredCallURE_CA is organized into tasks. The success status of each is
reported to the log which can be used to determine if the task was successful, or if
a problem occurred. A successful task will output a line in the log file that looks
like the following:
Alternatively, if the task failed you would see a line that looks like the following:
If you need to find more information about a particular task that failed, or for
further details about what the task did, you can look at the lines immediately
before the overall result of the task. The following example shows that an instance
″DB2″ was created successfully, and that some DBM Config variables were set. For
example:
1: The value ″SVCENAME=db2c_DB2″ was set in the DBM CFG file for the ″DB2″
instance.
1: The value ″DB2COMM=TCPIP″ was set in the Profile Registry for the ″DB2″
instance.
If you have installed DB2 using a response file, there are some common problems
which you may encounter. The most common response file problem is that the
installation cannot find the response file that was specified by the -u option of
setup.exe because the location was specified incorrectly. In a case like this you
would see lines in the log file that look like the following:
Action start 0:23:55: DetectAndSetInstallPathCA.
Action ended 0:23:55: DetectAndSetInstallPathCA. Return value 1.
Action start 0:23:55: InitSilentInstallCA.
1: Failed to access the response file: "c:\db2ese.rsp".
Action ended 0:23:55: InitSilentInstallCA. Return value 3.
Action ended 0:23:55: INSTALL.
Return value 3.
Right before the Return Value 3, which shows that the action InitSilentInstallCA
failed, you can see some information about the error. In this case the response file
c:\db2ese.rsp cannot be accessed because the path does not exist. This problem
can be corrected by simply correcting the response file path given in the -u
parameter to setup.exe. Another possible cause of response file installation failure
can be that the user running the installation does not have permission to access the
file.
Keyword errors:
One type of error that can occur is caused by an invalid keyword in the response
file installation. The response file that is passed into the installation is validated for
two main types of problems before the installation begins. The first type of
validation that occurs is for syntax. Certain keywords have length limits, or accept
only certain values. If an invalid value is specified for a keyword, or if a keyword
is entered that is not recognized, the installation will exit. The second type of
validation is semantic. At this stage values are checked to make sure they are
compatible with the system and with each other. This stage is only performed if
the syntax checking does not find any errors.
1: ERROR:A Response file error occurred. Unknown keyword "THIS_IS_AN_INVALID_KEYWORD" at line "116".
1: ERROR:One or more errors occurred while checking the syntax of the response file "c:\db2ese.rsp".
Please correct the errors and run the install again.
1: ERROR:Unable to set the response file "c:\db2ese.rsp" in the up and running engine.
1: Failed to initialize silent install. Action ended 0:28:05: InitSilentInstallCA.
Return value 3.
In this example, the log file indicates that the TCP/IP entries specified in the
response file are not valid. The combination of service name and port number
conflicted with values that were already on the system.
Related reference:
v Location of installation error logs
v Installation methods for DB2 UDB (Windows and UNIX)
v Tracing installation problems
The db2setup.log file contains the log of the current (or most recent) installation.
The information from the db2setup.log is appended to the db2setup.his (sometimes
referred to as an ″installation history log file″) once the installation has ended.
The db2setup.err file captures any error output that is returned by Java (for
example, exceptions and trap information).
Depending on the problem you are trying to solve, all of the information in the log
files may be useful, despite the complexity and amount of information contained
The appearance of the subsequent section of the db2setup.log will depend on the
platform, since DB2 will use the operating system’s native installation utility. Once
all of the filesets have been processed, the following messages in the db2setup.log
will indicate whether the installation has completed successfully:
Installing DB2 file sets:.......Success
Registering DB2 licenses:.......Success
Setting default global profile registry variables:.......Success
Creating the DB2 Administration Server:.......Success
Initializing instance list:.......Success
Creating DB2 instances:.......Success
Updating existing DB2 instances:.......Success
Configuring the DB2 Administration Server:.......Success
Updating global profile registry:.......Success
DB2 Setup log file finished at: Fri Feb 18 16:36:52 2005 EST
============================================================
db2_install_log.<pid>:
SUCCESSES
---------
Filesets listed in this section passed pre-installation
verification and will be installed.
Selected Filesets
-----------------
db2_08_01.db2.rte 8.1.1.64 # Run-time Environment
...
+----------------------------------------------------------------------+
Installing Software...
+----------------------------------------------------------------------+
. . .
+----------------------------------------------------------------------+
Summaries:
+----------------------------------------------------------------------+
Installation Summary
--------------------
Name Level Part Event Result
------------------------------------------------------------------------
db2_08_01.db2.rte 8.1.1.64 USR APPLY SUCCESS
+----------------------------------------------------------------------+
To determine the success or failure of the installation, look at the end of the file for
a line that looks like the following:
The installation logfile can be found in /tmp/db2_install_log.91190.
db2_install program completed successfully.
If you have installed DB2 using a response file, there are some common problems
which you may encounter. The most common response file problem is that the
installation cannot find the response file that was specified by the -r option of
db2setup because the location was specified incorrectly. In a case like this, the
installation would fail and you would see lines in the db2setup.log file that look
like the following:
DB2 Setup log file started at: Fri Feb 18 17:36:56 2005 EST
============================================================
DB2 Setup log file finished at: Fri Feb 18 17:36:57 2005 EST
============================================================
Keyword errors:
One type of error that can occur is caused by an invalid keyword in the response
file installation. The response file that is passed into the installation is validated for
The following example illustrates one of the error types that might be displayed is
an error is encountered during the response file syntax validation:
The response file specified "/home/lcawley/db2ese.rsp" is not valid.
For more information please see the DB2 installation log at "/tmp/db2setup.log".
ERROR:One or more errors occurred while checking the syntax of the response
file "/home/lcawley/db2ese.rsp". Please correct the errors and run the install
again.
DB2 Setup log file finished at: Fri Feb 18 18:56:18 2005 EST
============================================================
The following example illustrates one of the error types that might be displayed is
an error is encountered during the response file syntax validation:
DBI1702E The specified service name or port number conflicts
with existing values in the TCP/IP services file.
...
The response file specified "/home/lcawley/db2ese.rsp" is not valid.
For more information please see the DB2 installation log at "/tmp/db2setup.log".
Explanation:
The service name or port number entered by the user conflicts with
existing values in the TCP/IP services file. The service name may
already be used with a different port number, or the port number
may already be used with a different service name.
Specify a service name and port number that does not conflict
with existing entries in the services file.
DB2 Setup log file finished at: Fri Feb 18 19:06:19 2005 EST
============================================================
After reading the errors that are in the log file it should be apparent what needs to
be corrected. In this example, the log file indicates that the TCP/IP entries
specified in the response file are not valid. The combination of service name and
port number conflicted with values that were already defined on the system.
Related reference:
v Location of installation error logs
v Installation methods for DB2 UDB (Windows and UNIX)
v Tracing installation problems
In this situation, you need to verify whether the sqllib directory (e.g.
/home/db2inst1/sqllib does indeed exist. It is possible in this situation that
removing the sqllib directory will not be sufficient to resolve the problem, since if
you did not drop the instances prior to uninstalling DB2, they may still appear in
the DB2 UDB Instance Profile Registry. Such a situation would result in errors in
the installation error log and a failure to create the instance. An example of such
errors from db2setup.log on AIX is as follows:
Installing DB2 file sets:.......Success
Registering DB2 licenses:.......Success
Setting default global profile registry variables:.......Success
Creating the DB2 Administration Server:.......Success
ERROR:Could not switch current DB2INSTANCE to "db2inst1". The return code is
"-2029059916".
Explanation:
User Response:
Ensure that you are using the correct version of the ″db2iupdt″ command. Also
ensure that there are no db2 processes running at the instance. Retry the command.
In this case you may need to manually remove the old instance from the instance
profile registry and then re-attempt the installation. In this example, that would
mean removing ″db2inst1″ from the list of instances in the
/var/db2/V8.1/profiles.reg file. This problem can be avoided of course if you
ensure that you follow the instructions when uninstalling DB2 and drop the
instances prior to uninstalling the DB2 product.
Additional trace information can be obtained when using db2icrt and db2isetup
on UNIX-based systems.
Example 1:
DB2DIR/instance/db2icrt -d -u db2fenc1 db2inst1
where DB2DIR is the DB2 installation directory, will produce additional trace points
in the /tmp/db2icrt.log file.
Example 2:
DB2DIR/instance/db2isetup -t /home/db2inst1/isetup.trc
where DB2DIR is the DB2 installation directory, will produce a trace file as well as a
default /tmp/db2icrt.log file.
Related reference:
v Location of installation error logs
v Creating an instance using db2icrt
v db2isetup - Start Instance Creation Interface Command
v Setting environment variables on UNIX systems
To identify an instance update issue, you should first check the diagnostic log file
/tmp/db2iupdt.log.pid. For example, if you attempt to update an instance called
db2inst1 as follows:
Explanation:
All processed and failed operations have been saved into this log file.
User Response:
Do not modify this file in any way. This file is for IBM Technical Support reference.
Explanation:
Explanation:
There are applications that are still running that are using the specified instance.
All applications using this instance must be terminated before the command can be
completed successfully. You can get a list of the applications that are currently
using the instance by issuing the command:
db2 list applications
User Response:
You can either wait for the applications to end by themselves, or you can explicitly
force the applications to end. You can logon as the instance owner and run the
command
...
...
Explanation:
All processed and failed operations have been saved into this log file.
If the actions necessary are not this clear, you can debug this further by running
db2iupdt with the -d debug option. In order to redirect the debug information to a
file, you may use shell redirection.
For example:
db2iupdt -d db2inst1 2>&1 | tee db2iupdt.debug.out
+ /usr/bin/ipcs -a
+ /usr/bin/grep db2inst1
q 8126477 0xffffffff --rw------- db2inst1 usr db2inst1 usr 0 0
4194304 0 0 no-entry no-
...
+ display_msg /usr/opt/db2_08_01/msg/en_US.iso88591/db2install.cat 250
DBI1250E Applications are still using instance %s.\n db2inst1
+
From the above output, the terminate_instance function returnsa value of 13. If
you look at the scripts in the DB2DIR/instance directory, where DB2DIR represents
/usr/opt/db2_08_01 on AIX, and /opt/IBM/db2/V8.1 on all other UNIX-based
systems, you will see that terminate_instance is defined in the db2iutil script.
Note: If you have a FixPak or modification level installed in an alternate path, the
DB2DIR directory is usr/opt/db2_08_FPn on AIX and opt/IBM/db2/V8.FPn on
all other UNIX-based systems, where n represents the number of the FixPak
or modification level.
Within db2iutil you can see that terminate_instance stops all applications, CLP
backend processes and the database manager for a specified instance.
The return code (13) is obtained from the db2istop command here:
Other db2iupdt errors on UNIX can be investigated using the log file and debug
traces in the same manner.
Related reference:
v Updating instance configuration on UNIX
v Updating instance configuration on Windows
As a general rule, you need to do the following things before installing a FixPak:
v Verify that there is enough disk space on your system.
v Verify that the required prerequisites are installed (as listed in the FixPak
readme).
v Stop all database processes (i.e. stop all instances as well as the DB2
Administration Server, the Fault Monitor and the License Daemon).
v For AIX only, unload the DB2 libraries with /usr/sbin/slibclean as root.
If you are downloading the FixPak image from the official IBM FTP site, make sure
that the size of the downloaded image is the same as the one on the FTP site.
Note: The installFixpak script does not provide a trace option. installAltFixPak
simply checks for the necessary pre-requisites and then calls the operating
system’s native install tool with certain customized options
Related reference:
v Applying the latest FixPak (Windows and UNIX)
License issues
Before you start debugging the license problem, you should have a better
understanding of it, so you should ask yourself these questions:
1. What is the SQL error code? Check the Message Reference guide for further
explanation and take the corrective action.
2. Is the license for a new installation? If this is a new installation, then you will
need to verify that the DB2 license key matches with the version and product
of DB2.
3. If this is not a new installation, has something else changed in the system? For
example, perhaps there has been a change to the operating system (OS) or to
file permissions, or perhaps a DB2 FixPak upgrade was installed.
For example, let’s say you receive the following SQL code
SQL8007W There are "90" day(s) left in the evaluation period for the product "DB2
Enterprise Server Edition". For evaluation license terms and conditions, refer to the
IBM Evaluation Agreement in the EVALUATE.AGR file, located in the following
directory: "C:\PROGRA~1\SQLLIB".
In this example, you would first make sure that you have installed the license key
for ″DB2 Enterprise Server Edition.″ You could use the license management tool to
do so. (The license management tool is discussed next.) If the license key is not
installed, then you need to install it. Second, find out if there is any change made
to the operating system.
Note: Finding out what has changed will give you a better idea as to what could
have caused the DB2 licensing error.
Run ″db2licm -l″ on your test system to list all the DB2 products with license
information. If this command does not return the appropriate license information,
then this could mean either a valid DB2 license key is not installed or there is a
potential permission problem with the nodelock file.
To confirm whether a valid DB2 license is installed, compare the license key inside
the nodelock file with the license key file (for example, db2ese.lic is the license key
file for DB2 UDB Enterprise Service Edition). Here are the different locations for
the nodelock file based on the platforms:
v AIX - /var/ifor
v HP-UX, Linux and Solaris - /var/lum
v Windows - \Program Files\SQLLIB\license
Inside the nodelock file, comments line start with ’#’, and the license key is usually
proceeded and followed by a comment line. For example,
#
<You will see the actual license key here.>
#[admin_comment] "IBM Toronto Lab" "DB2 Enterprise Edition" ...
If the license key is not yet installed, use db2licm to install it. If the license key
does match the one on the product CD, check whether there is a permission
problem with the nodelock file.
In UNIX, you should verify the file permission for the nodelock is set to rw-r--r--
and owned by root.
Migration issues
This section will help you identify the source of common migration problems
encountered when migrating DB2 Universal Database (UDB) Version 7 to DB2
UDB Version 8.
If you are migrating to DB2 UDB Version 8 from another database product, you
should visit the DB2 UDB Migrate Now! Web site:
www.ibm.com/software/data/db2/migration/
Related reference:
v Installation issues
v Migrating to DB2 UDB Version 8.2
v Overview of migrating to DB2 Information Integrator
Migration recommendations
Consider the following recommendations when planning your database migration:
Back up log files before migration when DB2® UDB uses replication
7 If you use replication for your DataJoiner® and DB2 UDB data, you must
7 archive all of the DB2 log files before migration.
7 For complete information on migrating your DB2 replication environment,
7 see the IBM® DB2 Information Integrator Migration Guide: Migrating to
7 SQL Replication Version 8 at
7 http://www.ibm.com/software/data/integration/db2ii/support.html.
DataJoiner instance migration
If you want to migrate an instance of DataJoiner or DB2 UDB on which
you are running the Capture or Apply programs for DB2 replication, you
must prepare to migrate your replication environment before you
migrating the instance.
7 For complete information on migrating your DB2 replication environment,
7 see the IBM DB2 Information Integrator Migration Guide: Migrating to
7 SQL Replication Version 8 at
7 http://www.ibm.com/software/data/integration/db2ii/support.html.
Perform hardware and operating system upgrades separately from DB2 UDB
migration
Performing hardware and operating system upgrades separately from DB2
migration simplifies problem determination if you encounter migration
difficulties. If you upgrade your software or hardware prior to migrating to
DB2, ensure that your system is operating acceptably before attempting
DB2 migration.
7 Dropping the detailed deadlocks event monitor
7 At the same time a database is created, a detailed deadlocks event monitor
7 is also created. As with any monitor, there is some overhead associated
7 with this event monitor. If you do not want the detailed deadlocks event
7 monitor, then the event monitor can be dropped using the command:
7 DROP EVENT MONITOR db2detaildeadlock
Related concepts:
v Benchmark testing
Related tasks:
v Migrating DB2 UDB (Windows)
v Migrating DB2 UDB (UNIX
Related reference:
v DB2 Universal Database planned incompatibilities
v Version 8 incompatibilities with previous releases
v Version 7 incompatibilities with previous releases
Migration restrictions
You should be aware of the following restrictions before you migrate to DB2 UDB
Version 8:
v Migration is supported only from:
– DB2 UDB Version 6.x or Version 7.x. (All platforms supported in Version 6.x
and Version 7.x; Linux must be at Version 6 FixPak 2.)
– DB2 DataJoiner V2.1.1 32-bit (AIX, Windows NT, and Solaris Operating
Environment).
v Issuing the migrate database command from a DB2 UDB Version 8 client to
migrate a database to a DB2 Version 8 server is supported; however, issuing the
migration command from an DB2 UDB Version 6 or Version 7 client to migrate a
database to a DB2 UDB Version 8 server is not supported.
v When migrating from DB2 DataJoiner V2.1.1, DB2 Information Integrator is
required to support non-IBM data sources.
v Migration between platforms is not supported. For example, you cannot migrate
a database from a DB2 server on Windows to a DB2 server on UNIX.
v Migrating a partitioned database system that has multiple computers requires
that database migration be performed after DB2 UDB Version 8 is installed on all
participating computers. Any DB2 migration commands need to be run on each
of the participating computers.
v Windows allows only one version of DB2 UDB to be installed on a computer.
For example, if you have DB2 UDB Version 7 installed and install DB2 UDB
Version 8, DB2 UDB Version 7 is removed during the installation. All instances
are migrated during DB2 installation on Windows operating systems.
v User objects within your database cannot have DB2 UDB Version 8 reserved
schema names as object qualifiers. These reserved schema names include:
SYSCAT, SYSSTAT, and SYSFUN.
v User-defined distinct types using the names BIGINT, REAL, DATALINK, or
REFERENCE must be renamed before migrating the database.
v You cannot migrate a database that is in one of the following states:
– Backup pending
– Roll-forward pending
7 – One or more table spaces in an abnormal state
– Transaction inconsistent
v Restoration of back-level (DB2 Version 6.x or Version 7.x) database backups is
supported, but rolling forward of back-level logs is not supported.
v Database transactions executed between database backup time and the time DB2
UDB Version 8 migration is completed are not recoverable.
7 For the most part, you should be able to move your database from DB2 UDB
7 Version 8 to DB2 UDB Version 8 FixPak 1 without noticing a change or having to
7 do anything special to use the new tablespace limit.
7 Note the following restrictions related to moving a database from DB2 UDB
7 Version 8 FixPak 1 (or a later DB2 UDB Version 8 FixPak) back to the DB2 Version
7 8 level:
7 v If you want to move from DB2 Version 8.2 back to DB2 Version 8.1, you will
7 need to run the db2demigdbd command before going back to DB2 Version 8.1.
7 The db2demigdbd is a reverse database directory files tool that restores your
7 database directory to its Version 8.1 format.
7 v Moving a database that contains a tablespace ID higher than 4096 to DB2
7 Version 8 from DB2 Version 8 FixPak 1 or later is unsupported. Attempting to do
7 so will result in anomalous behavior and improper operation.
7 v Restoring a database image that contains a tablespace ID higher than 4096 on
7 DB2 Version 8 is unsupported. Attempting to do so results in anomalous
7 behavior and improper operation.
7 v When moving from DB2 UDB Version 8 FixPak 1 (or a later DB2 UDB Version 8
7 FixPak) back to DB2 UDB Version 8, the log-skipping functionality is disabled
7 until such time as the DB2TSCHG.HIS file is removed.
Migrating databases
Prerequisites:
Restrictions:
Procedure:
where:
DATABASE database-alias
Specifies the alias of the database to be migrated to the currently
installed version of the database manager.
USER username
Identifies the user name under which the database is to be migrated.
USING password
The password used to authenticate the user name. If the password is
omitted, but a user name was specified, the user is prompted to enter
it.
7 2. Optional: Update statistics for local tables within the database. When database
migration is complete, old statistics that are used to optimize query
performance are retained in the catalogs. However, DB2 Version 8 has statistics
that are modified or do not exist in DB2 Version 6 or DB2 Version 7. To take
advantage of these statistics, you may want to execute the runstats command
on tables, particularly those tables that are critical to the performance of your
SQL queries.
3. Optional: Rebind packages. During database migration, all existing packages
are invalidated. After the migration process, each package is rebuilt when it is
used for the first time by the DB2 Version 8 database manager. You can run the
db2rbind command to rebuild all packages stored in the database.
4. Optional: Revoke EXECUTE privileges on external stored procedures that
contain SQL data access from PUBLIC. During database migration, EXECUTE
privileges are granted to PUBLIC for all existing functions, methods, and
external stored procedures. This will cause a security exposure for external
stored procedures that contain SQL data access which allow users to access
SQL objects for which they would not otherwise have privileges. Revoke the
privileges by entering the db2undgp - r command.
5. Optional: Migrate DB2 Explain tables.
6. Optional: If you recorded configuration settings before migration, you might
want to compare pre-migration configuration settings to current configuration
settings to verify successful migration. Verify:
v database configuration parameter settings
v database manger configuration parameter settings
v tablespaces records
v packages records
Figure 2.
Related references:
v DB2 Supported Programming Interfaces
v DB2 supported development software
Procedure:
When the application is run, it uses the current user ID and password to connect
with a database named SAMPLE. It allocates the appropriate environment and
database handles, then connects to the database.
The first step in diagnosing this problem is to examine the code, in order to find
where this error is generated. In this case, you would find that the SQLFetch call
must have returned an SQL_ERROR. Since the application didn’t request the error
details, it is difficult to determine the cause. You could obtain a CLI trace (see
″Enabling CLI traces″)and look for the line which includes the SQLFetch call. It
would be similar to the following:
SQLFetch( hStmt=1:1 )
---> Time elapsed - +2.200000E-004 seconds
SQLFetch( )
<--- SQL_ERROR Time elapsed - +1.238000E-003
seconds
This shows the error being returned, but no error details. In many cases, detailed
diagnostic information is returned only when an application requests it. Taking a
CLI trace may reveal more information than the application returns.
If you were to rewrite this sample program to gather proper error information, you
would need to add calls to the function SQLGetDiagRec. For example, you could
create a simple procedure called GetCLIErrorInfo which calls SQLGetDiagRec and
which is in turn called after the fetch.
...
void GetCLIErrorInfo( SQLSMALLINT htype, /* handle type identifier */
SQLHANDLE hndl /* handle */ )
{
...
while ( SQLGetDiagRec( htype,
hndl,
i,
sqlstate,
&sqlcode,
message,
SQL_MAX_MESSAGE_LENGTH + 1,
&length
) == SQL_SUCCESS ) {
printf( "\n SQLSTATE = %s\n", sqlstate ) ;
printf( " Native Error Code = %ld\n", sqlcode ) ;
printf( "%s\n", message ) ;
int main()
...
sqlrc = SQLFetch( hstmt ) ;
if ( sqlrc != SQL_SUCCESS )
{
printf("/n Error Fetching./n");
GetCLIErrorInfo( SQL_HANDLE_STMT, hstmt );
}
...
Once such error handling has been added, the sample program would return
output as follows:
Error Fetching.
SQLSTATE = HY010
Native Error Code = -99999
[IBM][CLI Driver] CLI0125E Function sequence error.SQLSTATE=HY010
-------------------------
Application Complete.
By checking the ODBC Standard or DB2 CLI documentation, you will learn that a
function sequence error is returned from an SQLFetch call if you do not call
SQLExecute first. The statement needs to be executed before you can fetch any data
it may return. This is a simple example of a situation that can be resolved only
after appropriate error handling has been added to the application.
Related Reference:
v Diagnostics in CLI applications overview
v Error-Handling Considerations in Partitioned Database Environments
v Error Message Retrieval in an Application
v Handling an SQLException under the DB2 JDBC Type 2 Driver
v Handling an SQLException under the DB2 Universal JDBC Driver
v Handling SQL errors in an SQLJ application
v Returning error messages from SQL procedures
The db2bfd tool can be used to display these kinds of thing as well as some other
information.
On UNIX®:
db2bfd -s $HOME/sqllib/bnd/db2sampl.bnd
Next, use the -v option to see the corresponding host variables that would have
been defined in the source code for db2sampl:
On UNIX®:
db2bfd -v $HOME/sqllib/bnd/db2sampl.bnd
Related reference:
v db2bfd - Bind File Description Tool Command
v Package Creation Using the BIND Command
Here are some basic steps to ensure that your environment is setup correctly:
v Ensure makefiles contain the correct compiler information
v Set all compiler-related variables for include files and libraries
v Ensure any command line arguments point to the correct DB2 directories
Here are some of the common mistakes that can lead to linker errors:
v Improper API/function calls
v Multiple versions of linked libraries in the LIBPATH
v API/function definitions not matching the code contained in the library files
Refer to the samples included with DB2, as they include scripts and instructions to
compile and link the sample applications.
The first step in problem determination is to check the line of code that the
compiler objects to. In this case, it is as follows:
sqlrc = SQLAllocHandle( SQL_HANDLE_ENV, &henv ) ;
if ( sqlrc != SQL_SUCCESS )
{
printf("/n Error allocating environment handle./n");
return -1;
}
Since the error indicated that there were too few parameters, you would then
check the CLI documentation for SQLAllocHandle. You would see that the call is
indeed incorrect. It is missing one input handle. You can find the SQLAllocHandle
call documented at
http://publib.boulder.ibm.com/infocenter/db2help/topic/com.ibm.db2.udb.doc/ad/r0000556.htm
This is a simple error common to all types of programming. Errors such as this,
received at compile time, can usually be resolved by checking the related
documentation and correcting the code as necessary.
Related reference:
v DB2 supported development software
Ensure your environment is correctly installed and you are using the proper DB2
static and shared libraries (e.g. those contained in sqllib/lib32 or sqllib/lib). This is
the best way to avoid compilation/linking problems. You should check the DB2
Application Development guides relating to your programming interface and your
compiler specific documentation. They will guide you to set up the correct
environment.
Here are some of the common items that relate to having your environment setup
correctly:
v Ensure makefiles contain the correct compiler information
v Set all compiler-related variables for include files and libraries
v Ensure any command line arguments point to the correct DB2 directories
Here are some of the common mistakes that can lead to linker errors:
You can look at the samples included with DB2 as they also include scripts and
instructions to compile and link them.
One of the functions of the database system monitor that is useful for debugging
applications is to display the status of all active agents. To obtain the greatest use
from a snapshot, ensure that statement collection is being done before you run the
application (preferably immediately after you run DB2START) as follows:
db2_all "db2 UPDATE MONITOR SWITCHES USING STATEMENT ON"
When you suspect that your application or query is either stalled or looping, issue
the following command:
db2_all "db2 GET SNAPSHOT FOR AGENTS ON database
When using a wizard, the Next push button is not available after you type text in
the text fields.
Possible cause:
The text that you enter in each fieldmust conform to the rules for that field. The
Next pushbutton is not available until the text that you enter conforms to the
rules.If you did not receive notification that your text entries do not follow
therules, turn on the constraint checking option.
Action:
v Close the wizard.
v Open the Environment Settings notebook.
v On the User-assistance features page, select all check boxes in the
Constraintchecking group to turn on the constraint checking options.
The user ID or password that you typed to connect to the database server is
incorrect.
Possible causes:
The authentication configuration of the database server is set to SERVER, and your
user ID and password are not valid on the server. This is the default configuration
for DB2 Universal Database.
The authentication configuration of the database server is set to CLIENT, and your
user ID and password are not valid on the client workstation.
Action:
Check the authentication configuration of the database to which you are trying to
connect. If the configuration is set to SERVER, your user ID and password must be
Chapter 2. Specific troubleshooting techniques 103
valid values on the server. If the configuration is set to CLIENT, your user ID and
password must be valid values on the client workstation.
Possible causes:
Building the routine to another database could have failed because of the following
reasons:
v The routine contained references to objects (such as schemas and tables) that do
not exist on the target database.
v The SPECIFIC NAME of the object being pasted already exists in the target
database.
Actions:
A null value is passed to a Java stored procedure input parameter that was
declared with a Java primitive type (for example, an int). DB2 generates an SQL
error message without calling the stored procedure.
Possible cause:
Action:
Change the primitive type to the corresponding Java class in the Development
Center source code editor to allow the stored procedure to support null input
values. For example, the Java primitive type int becomes Integer.
Possible cause:
Action:
To test SQL user-defined functions that accept NULL values, call them from a DB2
Command Processor session: db2 ==> values(<udfname>(<parameter
values,including NULL,separated by commas>))
Building an SQL routine results in the error message ″Build not successful: -1.″ No
other error messages are shown.
On Windows, the user may get an error messages such as: ’nmake’ is not
recognized as an internal or external command, operable program or batch
file.
Possible causes:
With DB2 versions prior to 8.2, a C compiler is required to build SQL stored
procedures, so possible causes include:
v A C compiler is not installed on the database server.
v A C compiler is installed on the database server but is not properly configured.
For example, environment variables required by the C compiler may be
incorrect.
Actions:
You cannot read the text in the editor because the text and background are the
same or nearly the same color.
Actions:
v If you did not close the Environment Settings notebook or apply the color
changes, you can apply the previous color selection by clicking Reset on the
Editor page of the Environment Settings notebook.
v If you closed the Environment Settings notebook or applied the color changes,
on the Editor page of the Environment Settings notebook, choose a different
color scheme by clicking Change. The Change Colors window opens.
When you try to build an SQL object to an OS/390 database server, the build fails
and returns the following error message:
DSNTPSMP - returned nnn
Rolling back...successful
procedure-name - Build failed.
Where procedure-name is the name of the routine. nnn is a numeric error code. See
the Message Reference for your operating system for an explanation of error codes.
Possible cause:
Actions:
1. Review the diagnostic information to determine why the build failed. The
DSNTPSMP build utility might return a result set of messages that describe
where and why the SQL object build failed.
2. Correct the problem that is described by the diagnostic information.
3. Rebuild the SQL object.
4. If additional information is needed for diagnosing the problem look at the
SYSLOG for the WLM procedure where DSNTPSMP executes. Often, a dataset
may fill up and be the cause for the build failure. This can be determined by
looking directly at the WLM procedure output
When you try to build an SQL object to an OS/390 database server, the build fails
and returns the following error message:
DSNTJSPP - returned nnn
Rolling back...sucessful
procedure-name - Build failed
Possible cause:
Actions:
1. Review the diagnostic information to determine why the build failed. Obtain
available diagnostic information by selecting the Verbose build option when
using the wizard, or from the Stored Procedure Properties notebook. Selecting
this option causes DSNTJSPP to return a result set of messages to Development
Center that describe where and why the SQL object build failed.
2. Correct the problem that is described by the diagnostic information.
3. Rebuild the Java object.
4. If additional information is needed for diagnosing the problem, look at the
SYSLOG for the WLM procedure where DSNTJSPP and DSNTBIND execute.
When you try to build an SQL or Java object to an OS/390 or z/OS database
server, the build fails and you receive the following error message:
Create object returns -471
[IBM][CLI Driver][DB2] SQL0969N
There is no message text corresponding to SQL error "-471" in the message file on this workstation
The error was returned from module "DSNX9WCA" with original tokens "DSNTPSMP 00E79002 ".
SQLSTATE=55023
Possible causes:
Actions:
1. Ensure that the SQL objects build utility DSNTPSMP is properly installed on
your DB2 for OS/390 or z/OS server.
2. Ensure that the Java objects build utility DSNTJSPP and DSNTBIND are
properly installed on your DB2 for OS/390 or z/OS server.
Contact your system administrator for information about obtaining the build
utility.
In the Development Center wizards and notebooks, the pop-up information that
explains the fields and controls does not display.
Possible causes:
Actions:
v Ensure that the pop-up information windows are not turned off:
1. Open the Environment Settings notebook.
2. On the User-assistance features page, ensure that the Show pop-up
information for interface controls check box is selected.
3. In the Delay pop-up information in milliseconds field, type the time delay in
milliseconds. The value milliseconds is an integer. For example, entering 1000
as the value results in a 1000 millisecond (1 second) delay before pop-up
information appears.
v Press the F1 key on your keyboard when the field or control is in highlighted. To
move the highlight from one field or control to another, press the Tab key. If no
field or control is highlighted, the browser help displays.
You have trouble viewing objects in the Server View and experience system
connection exceptions such as:
COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] SQL1224N
A database agent could not be started to service a request, or was terminated
as a result of a database system shutdown or a force command.
SQLSTATE=55032
Possible cause:
Action:
To resolve this issue if you are using AIX version 4.3.1 or newer, set set the
environment variable EXTSHM to ON to increase the number of shared memory
segments to which a single process can be attached. EXTSHM must be exported
both in the shell where the client application is started and also in the shell where
db2start is run. To configure the EXTSHM environment variable for multiple JDBC
connections:
1. In client sessions, before starting the client application, type the following
command: export EXTSHM=ON
2. Before starting the DB2 server, type the following commands:
export EXTSHM=ON
db2set DB2ENVLIST=EXTSHM
db2set -all
On iSeries, the source code of a stored procedure body loses all its formatting and
appears on a single line.
Possible cause:
Stored procedures created using one of these methods will lose the formatting of
their bodies in Development Center.
Action:
If you want to make the stored procedure appear formatted correctly, you must
recreate the procedure using:
v Development Center
v the Run SQL Scripts interface in the iSeries Navigator
v the New External Procedure or New SQL Procedure interface in the iSeries
Navigator
The above error indicates that the backup image cannot be found. It is possible
that the image exists in that specified location but may be corrupted. To verify that
the backup image is good, run db2ckbkp with the -a option to dump as much
information as possible.
If there is no problem with the backup image the following message will be
returned:
Image Verification Complete - successful.
Related reference:
v db2ckbkp - Check Backup
The database history file is invaluable in a recovery scenario. The history file is
individually restorable from any backup image. If the current database is unusable
or not available, and the associated recovery history file is damaged or deleted, an
option on the RESTORE command allows only the recovery history file to be
restored. The recovery history file can then be reviewed to provide information on
which backup to use to restore the database. For example, you can restore the
history file for the sample database with this command:
db2 restore database sample history file
Related reference:
v Understanding the recovery history file
1 These programs are provided with your DB2 Data Links Manager installation
1 software and are located under the /sqllib/samples/dlfm directory. The online.sh
1 script, which calls the quiesce.c program, performs the following actions:
1 v Temporarily deactivates all the tables in databases that are registered with the
1 DB2 Data Links Manager. This stops any new Data Links Manager activity.
1 v Unmounts and remounts the file system as a read-only file system.
1 v Performs a file system backup.
1 v Unmounts and remounts the file system as a read-write file system.
1 v Resets and reactivates the database tables.
1 Prerequisites:
1 To use the online.sh script, you must have a catalog entry on the DB2 Data Links
1 Manager node for each database that is registered with the DB2 Data Links
1 Manager. You must also have the complete entry for the Data Links File System
1 (DLFS) on the /etc/filesystems file.
1 Procedure:
1 The dlfm_dump utility enables you to obtain a ″snapshot″ of significant data that
1 is stored in the Data Links File Manager’s own database (called DLFM_DB by default
1 at installation time). With this data, you can examine various DLFM system
1 configuration details, plus other DLFM-related data on a Data Links server. By
1 default, the output is stored in a file in the directory where the dlfm_dump utility
1 is invoked. The data that gets placed into the output file includes:
1 v The version of the current DLFM_DB.
1 v The keys currently in use for access-token generation.
1 v Security control information.
1 v Registered databases and prefixes.
1 v Data Links File System (DLFS) directory tree structures.
1 v DATALINK columns that reference this Data Links server.
1 v DB2 backups involving linked files on this Data Links server.
1 v Lists of all linked and unlinked files on this Data Links server.
1 Important:
1 v If the DLFM is managing a large number of files, both those that are currently
1 linked as well as those that were previously linked, the output file could be very
1 large. Ensure that you have sufficient space in the file system where the output
1 file is to be written. You can use the amount of space that the DLFM_DB occupies,
1 or that a backup of the DLFM_DB occupies, to estimate the space that is required
1 for the dlfm_dump output file.
1 v Because the output of the dlfm_dump utility contains sensitive security
1 information, ensure that you place the output file in a secure directory.
1 Requirement: You must execute this command from the Data Links server using
1 the Data Links Manager Administrator user ID.
1 The dlfm_dump utility output does not include temporary data that the DLFM_DB
1 might be maintaining, such as data that is stored during transaction processing.
1 The Data Links server contains its own DB2 database, which is used as a logging
1 manager to track all linked files. Therefore, you can take a DB2 trace on both the
1 DB2 host and Data Links server machines where a problem was encountered, if
1 necessary. In certain situations, you might need to run a concurrent DB2 trace on
1 several machines. For example, you might encounter a communication problem
1 between a DB2 host and a Data Links server machine.
1 During the process of performing a DB2 trace, all actions and any relevant
1 parameter values get logged. Traces should be taken when there is minimum
1 activity on the machine to prevent the capture of unnecessary information.
1 The process of performing a trace has a global effect on the behavior of a DB2
1 instance. The degree of performance degradation is dependent on the type of
1 problem and on how many resources are being used to gather the trace
1 information.
After restoring the file system, the directory structure must be brought up to the
point-in-time of the crash by applying the directory changes that occurred after the
file system backup was taken. After this step, the DB2® RECONCILE command
must be run on all tables referencing files on the damaged disk. The db2_recon_aid
utility is provided to simplify this task.
| Use the Data Links Manager fsysadm.log file to help you determine directories
| that you need to recreate. Data always gets appended to the fsysadm.log.
| On AIX® and Solaris™ Operating Environments, the directory changes are logged
| in the INSTHOME/sqllib/fsysadm.log file, where INSTHOME is the home directory
| of the Data Links Manager Administrator. There is one entry for each event.
| Setting the attributes of a file is also logged. The format of the entries for the
| fsysadm.log file is as follows.
| Time = <timestamp> EUID = <integer> UID = <integer> GID = <integer> Mode = <octal>
| Action = <CREATE/REMOVE/SETATTR/RENAME> Object type = <DIR/FILE> Path = <fully qualified
| source name, destination name>
| where:
| v Time is the time of the activity in local time
| v EUID is the effective user ID of the user performing the action
| v UID is the user ID attribute of the file or directory that was created, or whose
| attributes were modified
| v GID is the group ID attribute of the file or directory that was created, or whose
| attributes were modified
| v Mode is the octal representation of the mode of the file or directory
| and where Path is the fully qualified path of the file or directory. If the action was
| RENAME, the destination name is displayed after the path information.
| The format of any additional entries associated with the first entry is as follows:
| ACE User = <string> Access = <Hex integer> ACE Type = <Hex integer>
| ACE Flags =<Hex integer>
| and where Path is the fully qualified path of the file or directory. If the action was
| RENAME, the destination name is displayed after the path information.
| ( * ) For the definitions of these hexadecimal values, refer to the Access Control
| Entry structures in the Microsoft® SDK documentation for Windows NT® and
| Windows 2000.
Like the RECONCILE utility, the db2_recon_aid utility must be run on a DB2
server containing tables with DATALINK columns to be reconciled.
►► db2_recon_aid ►
database_name
A required value, which specifies the name of the database containing the
tables with DATALINK columns that need to be reconciled.
-check A parameter that instructs the utility to list the tables that might need
reconciliation. If you use this parameter, no reconcile operations will be
performed. This parameter is required when the -reportdir parameter is
not specified.
-reportdir directory_name
Required when the -check parameter is not specified. Specifies the
directory where the utility is to place a report for each of the reconcile
operations. For each table on which reconcile was performed, files of the
format <tbschema>.<tbname>.<ext> will be created where:
v <tbschema> is the schema of the table.
v <tbname> is the table name.
v <ext> is .ulk or .exp. The .ulk file contains a list of files that were
unlinked on the Data Links server, and the .exp file contains a list of
files that were in exception on the Data Links server.
-selective
An optional parameter that instructs the utility to process only those tables
with DATALINK columns containing file references that match the
specified -server and -prefixes criteria.
v If you use this parameter, you must also both the -server and -prefixes
parameters.
v If you do not use this parameter, then all Data Links servers and their
prefixes that are registered with the specified DB2 database will either be
reconciled, or will be flagged as needing reconciliation.
-server data_links_server_name
Required when the -selective parameter is used. Specifies the name of the
Data Links server for which the reconcile operation is to be performed. The
name value must be an IP hostname that is identical to the Data Links
server hostname registered with the specified DB2 database.
If this parameter is not used, all Data Links servers that are registered with
the specified DB2 database will be reconciled.
-prefixes prefix_list
Required when the -selective parameter is used. Specifies the name of one
or more Data Links File System (DLFS) prefixes. Prefix values must start
with a slash, and must be registered with the specified Data Links file
server. Separate multiple prefix names with a colon ( : ), but do not include
any embedded spaces. For example: /dlfsdir1/smith/:/dlfsdir2/smith/.
The path in a DATALINK column value is considered to match the
prefix_list if any of the prefixes in the list are a left-most substring of the
path.
If this parameter is not used, all prefixes for all Data Links servers that are
registered with the specified DB2 database will be reconciled.
The DLFM_DB database is 1. On the Data Links server enter the following commands:
lost, but the backup and db2 "restore database dlfm_db"
all log files for the db2 "rollforward database dlfm_db to end of logs and stop"
DLFM_DB database are 2. On the DB2 host, enter the following command to run the
available. db2_recon_aid utility. This utility automatically runs
RECONCILE for each table with URL file references to the
affected Data Links server:
db2_recon_aid -db CROWN -reportdir <dirpath>
-selective -server <dlm_hostname> -prefixes <dlfs_prefix>
v dlm_hostname is the registered IP hostname of the
affected Data Links Manager
v dlfs_prefix is the registered prefix corresponding to the
affected Data Links File System (DLFS)
The DLFM_DB database is 1. On the Data Links server enter the following commands:
lost, a backup of the db2 "restore database dlfm_db"
DLFM_DB database is db2 "rollforward database dlfm_db to end of logs and stop"
available, but not all of 2. On the DB2 host, enter the following commands. As a
the log files are available. result, all of the affected tables will be put into the
Datalink_Reconcile_Pending (DRP) state.
db2 "restore database CROWN"
db2 "rollforward database CROWN to end of logs and stop"
db2 "connect to CROWN"
3. Place all tables with data link values into DRP state by
entering the following commands:
db2 set integrity for <table> to datalink reconcile pending
db2 set integrity for <table> datalink reconcile pending immediate unchecked
db2 reconcile <table> dlreport <filename>
Recommendation: Set the log record count to a size that holds 3 to 4 days worth
of records.
Procedure:
Procedure:
To view build-time (table import, object creation, and step promotion) errors:
1. Open the Work in Progress window.
2. Click Work in Progress -> Show Log to open the Log Viewer window and
display the build-time errors for the Data Warehouse Center.
Procedure:
Procedure:
Procedure:
After completing this procedure, turn the trace level back to 0 to prevent
performance degradation.
You can run an agent trace independently for individual steps by setting the trace
level in the step’s Properties notebook on the Processing options page.
For example, to indicate a log table named MyLogTable that contains log
entries at log level 3 or less, specify MyLogTable:3. In the output log tables,
the message type is one of the following values:
E Error
W Warning
Q SQL code
You can include a table space name after the log table name by appending
the log level to the table space name.
For example, to indicate a log table named MyLogTable that is located in
the MyTableSpace table space and contains entries at log level 3 or less,
specify MyLogTable,MyTableSpace:3.
The output log table in the warehouse control database contains detailed error
messages, warning messages, and SQL codes. In the output log tables, the message
type is one of the following values:
E Error
W Warning
Q SQL code
Procedure:
To enable tracing for the Apply program, set the Agent Trace value = 4 in the
Warehouse Properties page. The Agent turns on full tracing for Apply when Agent
Trace = 4.
If you do not see any data in the CD table, then the Capture program is not
started, or you did not create changed data by updating the source table.
Steps:
If a system failure occurs, perform the following steps after the database server’s
hard disk is restored and before your users access the information catalog:
1. Recover your database management system and reinstall the Information
Catalog Center, as necessary.
2. Restore the information catalog databases by using your backup files.
The following table shows how the OLAP Center behaves when the versions of
DB2 Cube Views and the metadata tables in the DB2 catalog are mismatched.
If, after completing the steps above, the performance of your queries still do not
improve, consider the following issues:
v Make sure that all applicable constraints are defined.
v Make sure that the DB2_MAXIMAL_PUSHDOWN setting is set to yes as
described in Defining remote data sources.
v Consider collocating the dimension tables that are involved in the queries on
your federated server. Collocating the dimensions, so that a replicated copy of
the dimension table exists on the federated server, might improve performance.
Connectivity issues
Before beginning to analyze a connectivity problem, it is imperative that you
understand your environment. You should know three pieces of information (as a
minimum):
1. Operating systems
2. DB2 products, versions and FixPak levels
3. Communication protocols used between each tier
If you are working in a multi- tier model (i.e. the client tier is supplemented by
one or connectivity servers) then it often helps to draw a diagram of your
environment. For an example of a connectivity server diagram, see DB2 Connect
Enterprise Edition as a connectivity server.
Two terms which you will come across when investigating connectivity issues are:
DRDA Application Requestor (AR) and DB2 UDB DRDA Application Server (AS).
These terms come from DRDA (Distributed Relational Database Architecture),
which is a set of protocols used by DB2 to coordinate communication. The
application requester is the code that handles the application side of a distributed
connection; it is the machine that you are connecting ″from″. The application server
is the code that handles the database side of the connection; it is the machine that
you are connecting ″to″.
If you are connecting to a host system, the term ″database″ may be unclear, since
that term is used differently on some mainframes. Refer to Host databases for
clarification of the term.
Click on this link for more information on Supported and non-supported client
configurations.
Some of these questions are particularly important, and will be expanded on.
There are tools specific to each protocol that can be used to verify that
communication between the participating machines is possible external to DB2.
Here are some examples:
TCP/IP:
ping <hostname or ip address>
Try it out! Your successful result should look something like this:
Pinging myserver [1.23.45.678] with 32 bytes of data:
Reply from 1.23.45.678: bytes=32 time=921ms TTL=253
Reply from 1.23.45.678: bytes=32 time=721ms TTL=253
Reply from 1.23.45.678: bytes=32 time=942ms TTL=253
Reply from 1.23.45.678: bytes=32 time=80ms TTL=253
Each different APPC communication product will have its own method of
verifying that a successful LU to LU session can be established. For example, on
AIX, you could start the SNA subsystem, start the node, start the link station, and
then test a session, all via the smit utility. Please refer to your specific APPC
communication product’s documentation for more details.
Named Pipes:
Try issuing a net use command from the client to a shared folder on the server.
To assist in debugging the communication setup between the client and the server,
DB2 provides a tool called the Protocol Communications Tester. The tool is
launched by means of the pct command, which is found in the sqllib/bin directory.
It is a standalone tool designed to verify that a given LAN protocol is functional,
and that two endpoints can communicate with each other via that LAN protocol.
The tool can help solve protocol configuration-type problems because it effectively
removes DB2 from the picture until communication has been proven successful. If
you cannot pass these communication tests that are external to DB2, this indicates
that either your error is in the network layer or else you have not used correct
protocol-specific values in the tool. DB2 will not be able to connect across this
network until the network problems are corrected and the proper protocolspecific
values are identified.
For usage information related to this tool, please refer to the readme.pct file
located in the same directory as the executable file. The PCT tool can test the
following protocols:
v NetBIOS
v TCP/IP
These types of questions will help you to pinpoint what network changes or fix
pack level upgrades, application changes or system outages may have taken place
between the point in time when it last worked, and now. Identifying what changed
and where (i.e. on the client, gateway, or server) helps you to determine where you
should focus your energy during investigation.
Depending on how frequently the errors are occurring, traces may be hard to
obtain. It is understandable that you may not want to have traces running for
extended periods of time just to capture the error -- particularly if the problem is
occurring on a production system. Thus you frequently need to rely on the
information in the db2diag.log file for these types of problems. Intermittent errors,
idle threads, connection pooling and connection concentrator describes additional
items to take into consideration when investigating intermittent connectivity errors.
If a local connection is indeed successful, then the next step is to simulate a remote
connection directly on the server. This is done to reduce the layers of complexity
by recreating the entire problem on one machine. This is often referred to as a
loopback. The loopback is just a method of cataloging the local database as if it
were on a remote machine, as described here. Example: Creating a loopback
connection
If the connection works via this loopback connection test, but fails from a remote
client, then you might want to investigate these areas:
1. Is there a firewall between the client and the server?
2. Are the node and database catalogs on the client similar to those used in the
loopback node. Note that the service name (if used) could be different in the
client’s node catalog, but that the port number that it maps to on each machine
should nonetheless match.
If the connection fails via the local loopback test, then you can ignore the client
entirely from this point on. If the error is persistent, it is likely a configuration
issue, and the server is not correctly set up to listen for incoming requests. You
would thus need to focus on confirming the server configuration values. Refer to
Confirming connection configuration.
If you can only recreate the problem from remote clients, then you should
determine whether all clients or one client experiences the problem.
v If the problem occurs only for a subset of the clients connecting to this server,
then you should identify the commonalties and differences between these
clients, and compare their configurations (DB2 and network).
v If the problem is occurring across all of your clients, then a simple comparison is
not an option for you.
As you determine the answers to these questions, you should find that you are
successfully narrowing the problem description and thus increase the chances of
determining where the root cause of the problem lies.
All of the pct files can be found in INSTHOME/sqllib/bin, where INSTHOME is the
home directory of the instance owner. On Windows systems, the files are located in
the sqllib\bin subdirectory.
D:\sqllib\bin>pctt -r
TCPIP Resources...
+--------------------------------------------+
| HostName : myserver |
| HostAddress: myserver.ibm.com |
| IPAddress : 123.456.7.890 |
+--------------------------------------------+
2. Generate a pct.ini file: pctt /gt The resultant pct.ini file will appear as follows:
#--------------------------------------------------------
# PCT.INI
# Protocol Communication Tester INI File
# This file contains the Protocol Specific Configuration
# Parameters & values to be used in conjunction with
# the Protocol Communication Tester (PCTx).
#
# Defaults will be used if the parameter is not listed.
#--------------------------------------------------------
[TCPIP]
ServerHostName =
Note:
If you have set up PCT to use the same values as the DB2 instance uses, you
must stop the instance while testing PCT, since PCT will return an error in
situations where there is contention for ports that are already in use.
You only need to enter a value for either the ServerHostName or the
ServerIPAddress. The same holds true for the ServiceName, ServerPort pair.
Either one alone will suffice.
To make the PCT tool start listening for incoming requests, issue the command:
pctt s
When PCT starts successfully on the server, you see output like this:
- Reading configuration parameters
==> pct.ini file was found... using file specified protocol values!
Protocol Tester values...
Client/Server : Server
Connections : 1
Buffer Size : 500
Transaction Iterations : 1
Trace : OFF
Service : Send/Recv/Verify
Keep Connections : NO
Delayed Send (secs) : 0
Local TCPIP specific values...
Hostname : myserver
HostAddress : myserver.ibm.com
IPAddress : 123.456.7.890
At this point the server side of the PCT tool is waiting to receive a communication
from the client.
[(The results of a failed connection attempt are shown later.) The information in the
above output shows the PCT tool’s default settings as well as the protocol-specific
information about your client machine.]
[The information above was picked up from your client’s pct.ini file and shows the
values that will be used to identify the server.]
- Initializing the Protocol Date: 02/09/05 Time: 19:59:17: 78
- Connecting to Remote System Date: 02/09/05 Time: 19:59:17: 93
| retcode = < 0> ----[ TCPIP.socket ]-----[ SUCCESS ]------------
| retcode = < 0> ----[ TCPIP.connect ]-----[ SUCCESS ]------------
- Connection established! 1 Date: 02/09/05 Time: 19:59:19: 15
At this point, the connection step of the test has been completed.
- Sending Service Request Date: 02/09/05 Time: 19:59:19: 15
| retcode = < 0> ----[ TCPIP.send ]---[ Bytes= 316 ]------------
- Receiving Date: 02/09/05 Time: 19:59:19: 15
| retcode = < 0> ----[ TCPIP.receive ]---[ Bytes= 4 ]------------
| retcode = < 0> ----[ TCPIP.receive ]---[ Bytes= 316 ]------------
- Server info:
Computer Name :
Operating System:
Version :
Hostname :
- Send/Receive/Verify Data Loop Date: 02/09/05 Time: 19:59:19: 78
- Sending Data Date: 02/09/05 Time: 19:59:19: 78
| retcode = < 0> ----[ TCPIP.send ]---[ Bytes= 500 ]------------
- Receiving Date: 02/09/05 Time: 19:59:19: 78
| retcode = < 0> ----[ TCPIP.receive ]---[ Bytes= 4 ]------------
| retcode = < 0> ----[ TCPIP.receive ]---[ Bytes= 496 ]------------
[By default, the PCT tool passes some data from the server to the client, to verify
the connection. Then the connection is closed (see below).]
- Terminating the Connection Date: 02/09/05 Time: 19:59:19:156
| retcode = < 0> ----[ TCPIP.sock_close ]-----[ SUCCESS ]------------
+------------------------------------------------+
| Protocol Connection Test Completed - SUCCESS |
+------------------------------------------------+
An example of an error message which can occur if PCT fails to complete the test
successfully is as follows:
- Reading configuration parameters
==> pct.ini file was found... using file specified protocol values!
Protocol Tester values...
Client/Server : Client
Connections : 1
Buffer Size : 500
Transaction Iterations : 1
Trace : OFF
Service : Send/Recv/Verify
Keep Connections : NO
Delayed Send (secs) : 0
Local TCPIP specific values...
Hostname : myclient
HostAddress : myclient.ibm.com
IPAddress : 99.999.9.999
Server TCPIP specific Values...
Server Hostname : myserver
The return code given here is a TCP/IP return code 10061 which maps to
CONNECTION REFUSED. The cause of the error in this example was an incorrect
ServerPort value in the client’s pct.ini file. It did not match the ServerPort value
defined in the server’s pct.ini file.
If you receive errors such as this via the PCT tool, do not go any further with
problem determination within DB2 until you have rectified these network
problems, since these problems are occurring external to DB2.
Node X entry:
Node name = LOOPNODE
Comment =
Directory entry type = LOCAL
Protocol = TCPIP
Hostname = myhostname
Service name = db2cDB2
...
b. Catalog the loopback database, using the following command:
db2 catalog db <database name> as <loop back db alias> at node <loop back node name, per ab
For example:
db2 catalog db sample as loopsamp at node loopnode
db2 terminate
db2 list db directory
Database X entry:
Database Y entry:
[e] DB2PATH=D:\IBM\SQLLIB
[i] DB2INSTOWNER=DB2INST1
[i] DB2PORTRANGE=60000:60003
[i] DB2INSTPROF=D:\IBM\SQLLIB
[i] DB2COMM=TCPIP
[g] DB2_EXTSECURITY=YES
[g] DB2SYSTEM=LISAC02
[g] DB2PATH=D:\IBM\SQLLIB
[g] DB2INSTDEF=DB2
[g] DB2ADMINSERVER=DB2DAS00
3. Verify that the appropriate protocol-specific parameters are set in the database
manager configuration settings, so that DB2 knows what values to listen on.
For example, issue db2 get dbm cfg and look in the following section:
...
NetBIOS Workstation name (NNAME) =
TCP/IP Service name (SVCENAME) = db2cDB2
...
4. If the previous step resulted in a service name instead of a port number for the
SVCENAME field in your environment, then confirm that the value listed there
is mapped to a unique port number in the operating system’s /etc/services file.
For example:
DB2_DB2 60000/tcp #These ports are reserved for the DB2 Fast Communications Manager
DB2_DB2_1 60001/tcp
DB2_DB2_2 60002/tcp
DB2_DB2_END 60003/tcp
db2c_DB2 50000/tcp #This is the connection port for instance DB2
Note: You must refer to the db2diag.log instead of the notification log in this
situation, because the notification log does not contain this level of detail
even when using notification level 4.
2. Verify that the db2diag.log shows that the listeners for the specific protocol
which we are interested have been started successfully.
2005-02-11-15.59.58.828000-480 I2036155H322 LEVEL: Info
PID : 2536 TID : 2632 PROC : db2syscs.exe
INSTANCE: DB2 NODE : 000
FUNCTION: DB2 UDB, common communication, sqlcctcp_start_listen, probe:80
MESSAGE : DIA3000I "TCPIP" protocol support was successfully started.
3. If you had not performed one of the necessary setup steps, you would receive
the following error when you performed the db2start command:
SQL5043N Support for one or more communications protocols
failed to start successfully. However, core database manager
functionality started successfully.
4. This would be accompanied by specific error messages in the db2diag.log file if
DIAGLEVEL was set to 4 at the time. For example, if you I had not set the
SVCENAME parameter in the database manager configuration settings, you
would receive the following error in the db2diag.log:
2005-02-11-16.14.05.843000-480 E2206H457 LEVEL: Error
PID : 2516 TID : 2204 PROC : db2syscs.exe
INSTANCE: DB2 NODE : 000
FUNCTION: DB2 UDB, common communication, sqlcctcpconnmgr, probe:50
At this point you have confirmed that the configuration of both the client and the
server are correct from the DB2 point of view. If you continue to receive a
communication error, these are situations where you should pursue obtaining
diagnostics like db2 traces.
Related reference:
v Configuring TCP/IP communications for a DB2 instance
v Verifying port range availability on participating computers (Windows)
v Enabling communications between database partition servers (UNIX)
[e] DB2PATH=D:\IBM\SQLLIB
[i] DB2INSTOWNER=DB2INST1
[i] DB2PORTRANGE=60000:60003
[i] DB2INSTPROF=D:\IBM\SQLLIB
[i] DB2COMM=NETBIOS
[g] DB2_EXTSECURITY=YES
[g] DB2SYSTEM=LISAC02
[g] DB2PATH=D:\IBM\SQLLIB
[g] DB2INSTDEF=DB2
[g] DB2ADMINSERVER=DB2DAS00
Note: The NNAME must be unique among all NetBIOS nodes in the network. The
maximum length of the nname is 8 characters.
Note: You must refer to the db2diag.log instead of the notification log in this
situation, because the notification log does not contain this level of detail
even when using notification level 4.
2. Verify that the db2diag.log shows that the listeners for the specific protocol
which we are interested have been started successfully.
2005-02-11-16.51.44.640000-480 I2987H328 LEVEL: Info
PID : 2624 TID : 2464 PROC : db2syscs.exe
INSTANCE: DB2 NODE : 000
FUNCTION: DB2 UDB, common communication, sqlccnb_start_listen, probe:62
MESSAGE : DIA3001E "NETBIOS" protocol support was successfully started.
3. If you had not performed one of the necessary setup steps, you would receive
the following error when you performed the db2start command:
SQL5043N Support for one or more communications protocols
failed to start successfully. However, core database manager
functionality started successfully.
4. This would be accompanied by specific error messages in the db2diag.log file if
DIAGLEVEL was set to 4 at the time. For example, if you had not set the SVCENAME
parameter in the database manager configuration settings, you would receive
the following error in the db2diag.log:
2005-02-11-17.04.18.750000-480 I1906H457 LEVEL: Error
PID : 2488 TID : 2628 PROC : db2syscs.exe
INSTANCE: DB2 NODE : 000
FUNCTION: DB2 UDB, common communication, sqlccnbconnmgr_child, probe:34
MESSAGE : DIA3426C "NETBIOS" protocol support: Workstation name (nname) for
this server is NOT valid. Enter a valid Workstation name (nname) in
the Database Manager Configuration.
5. Once you have confirmed that the DB2 protocol-specific listeners are started
successfully for the instance, don’t forget to downgrade the diagnostic level, so
that you do not suffer performance problems. Returning it to the default
diagnostic level of 3 is done as follows:
db2 update dbm cfg using diaglevel 3
Node 3 entry:
The ″Adapter number″ entry should indicate the client’s logical adapter number (as
determined in step 2). The ″Server NNAME″ entry should indicate the server’s
Workstation name (nname, as specified in the server’s database manager
configuration file).
At this point you have confirmed that the configuration of both the client and the
server are correct from the DB2 point of view. If you continue to receive a
communication error, these are situations where you should pursue obtaining
diagnostics like db2 traces.
Related reference:
v Configuring NetBIOS communications on the client using the CLP
v NetBIOS parameter values worksheet
v nname - NetBIOS workstation name configuration parameter
Database crashes
In order to investigate these issues, you need to understand and distinguish the
difference between a database crash and an application crash.
This is the first indication that the database has indeed crashed due to a
segmentation violation and the database signal handler has caught the signal. The
The trap file contains a stack traceback of all the functions on the stack for the
process that crashed. For more information about how to interpret the stack trace,
and how to search for appropriate APARs, refer to Analyzing the stack trace back
Related reference:
v Location of logs and files
v Trap files
v Common signals and exceptions that cause trap file generation
To display all of the possible options, simply execute the db2dart utility without
any parameters. Some options that require parameters, such as the table space ID,
are prompted for if they are not explicitly specified on the command line.
By default, db2dart will create a report file with the name databaseName.RPT. For
single-partition database environments, the file is created in the current directory.
For multiple-partition database environments, the file is created under a
subdirectory in the diagnostic directory. The subdirectory is called DART####, where
#### is the partition number.
db2dart accesses the data and metadata in a database by reading them directly
from disk. Because of that, db2dart should never be run against a database that
still has active connections. If there are connections, db2dart will not know about
pages in the buffer pool, control structures in memory, etc. and may report false
errors as a result. Similarly, if you run db2dart against a database that requires
crash recovery or that has not completed roll-forward recovery, similar
inconsistencies might result due to the inconsistent nature of the data on disk.
As the output states, the full db2dart report can be found in the file SAMPLE.RPT.
You will also notice that in this case db2dart did not find any problems with the
database.
If a database is very large and you are only interested in one table space, you can
use the /TS option. When using this option, you must either provide the table
space ID on the command line (by specifying the /TSI parameter) or you can let
db2dart prompt you for it. If you do not know the table space ID, you can obtain
it via the command ″DB2 LIST TABLESPACES″ command. For example, to inspect the
USERSPACE1 table space (which has a table space ID of 2 in the sample database),
either of these commands will work:
db2dart sample /ts /tsi 2
db2dart sample /ts <= When prompted for the table space ID, enter "2".
Similarly, a single table and its associated objects (LOBs, indexes, etc.) can be
inspected using the /T option. When using this option, you must provide either the
table name or object ID and the ID of the table space in which the table resides. To
determine the object ID and table space ID for a table, you can query the FID and
TID columns of the SYSIBM.SYSTABLES catalog table. For example, determine the
object ID and table space ID for the EMP_PHOTO table in the sample database by
executing the following query:
C:\>db2 connect to sample
Database server = DB2/NT 8.2.0
SQL authorization ID = LISAC
Local database alias = SAMPLE
As mentioned above, the table name can be specified instead of the object ID:
db2dart sample /t /tsi 2 /tn EMP_PHOTO
db2dart sample /t <= When prompted for the table name and table space ID,enter "EMP_PHOTO 2".
If a table space or table becomes corrupt for any reason (for example due to a bad
disk or disk controller), attempts to access the table through SQL may not work.
(The SQL statement may fail with an error or the database may be marked bad
If you see such entries, you should run db2dart against the database (or table
space) to determine the extent of the damage.
If this happens, it may be necessary to extract all of the data possible so that the
table space and table can be rebuilt. In such a situation, the /DDEL option of
db2dart can be used to extract the table data and place it into a delimited ASCII
file. Note that due to the nature of ASCII files, some columns (such as LOB
columns) cannot be extracted from the table. db2dart will tell you if this is the
case.
When using the /DDEL option, you must provide a table space ID, object ID,
starting page number, and number of pages. To extract all of the pages, use 0 for
the starting page number and some very large number for the number of pages.
(Specifying more pages than actually exist will not cause any problems.)
The ORG table in the sample database resides in table space 2 and has an object ID
of 2. To extract all of the data from this table, execute this command:
db2dart sample /ddel
You will then be presented with the column definitions for the table and will be
asked to specify an output file name:
Table object data formatting start.
Please enter
Table ID or name, tablespace ID, first page, num of pages:
(suffic page number with ’p’ for pool relative)
2 2 0 1000
5 of 5 columns in the table will be dumped.
Column numbers and datatypes of the columns dumped:
0 SMALLINT
1 VARCHAR() -VARIABLE LENGTH CHARACTER STRING
2 SMALLINT
3 VARCHAR() -VARIABLE LENGTH CHARACTER STRING
4 VARCHAR() -VARIABLE LENGTH CHARACTER STRING
Default filename for output data file is TS2T2.DEL,
do you wish to change filename used? y/n
You can choose the default or specify a new one. The output file will be created in
the current directory be default.
Related reference:
v db2dart - Database Analysis and Reporting Tool Command
v INSPECT command
v First failure data capture locations
Prerequisites:
You will need the ability to disconnect all applications from the database and to
issue the ALTER TABLESPACE command.
Procedure:
1. Disconnect all applications and reconnect to the database. You will see that the
table space can be taken out of the OFFLINE state.
2. Use the ALTER TABLESPACE ... SWITCH ONLINE statement to bring the table
space up while the rest of the database is still up and deployed.
v If the table space can be brought up successfully after issuing the command,
or if the table space was not in the OFFLINE state to begin with, DB2 will
return an SQLCODE of 0.
v If the table space cannot be brought up successfully because there are still
problems with one or more of the containers, DB2 will return an SQLCODE
of —293. You can force the database to restart by using the RESTART ...
DROP PENDING TABLESPACE, but will have to drop any faulty table
spaces afterwards.
Related reference:
v “ALTER TABLESPACE statement” in the SQL Reference, Volume 2
v “RESTART DATABASE Command” in the Command Reference
Loading data
LOAD is a utility used to bulk-load data from a file or pipe into a database. LOAD
consists of up to three phases. The load phase loads the data, the build phase
builds the indexes if there are any, and the delete phase deletes duplicates if there
are unique indexes.
The main load processes are as follows: (X is a number identifying one of many)
v db2agent
v db2lmr Load Media Reader. This process reads the input.
v db2lbmX Load Buffer Manipulator. Writes loaded data to the database.
v db2lfrmX Load Formatter. Formats the input data into internal form.
v db2lrid Ridder. Organises data to be written to disk. Performs the index sort.
v db2lmwX Load Media Writers. Write the load copy.
LOAD failure:
What do you do when a LOAD fails and the table space is not accessible? The
following options are available.
v Restart the LOAD
In addition, you can issue the following command to examine the state of the table
space whose table is being loaded into:
db2 list tablespaces show detail
Use the db2tbst tool that is provided with DB2 to determine that state of the table
space.
For the above example, you would issue the following command
db2tbst 0x0004
This returns:
State = Quiesced Exclusive
In this state, the table space is inaccessible. To remove the table space from this
state, issue:
db2 quiesce tablespaces for table staff reset
Prior to Version 8, load required exclusive access to table spaces that contained
objects belonging to the table being loaded. In Version 8, load operates at the table
level and no longer requires exclusive access to the table space. The load utility
does not quiesce the table spaces involved in the load operation, and uses table
space states only for load operations with the COPY NO option specified. Refer to
Load overview.
Load also uses the table space state LOAD PENDING while in the load or build phase,
or DELETE PENDING during the delete phase. These states persist after the load
:
v Load overview
v Pending states after a load operation
v db2tbst - Get Tablespace State Command
v Load temporary files
v Load utility log records
Extender issues
All interfaces return DB2 Spatial Extender messages to help you determine
whether the spatial operation that you requested completed successfully or
resulted in an error.
The following table explains each part of this sample DB2 Spatial Extender
message text:
GSE0000I: The operation was completed successfully.
Table 3. The parts of the DB2 Spatial Extender message text
Message text part Description
GSE The message identifier. All DB2 Spatial Extender messages
begin with the three-letter prefix GSE.
0000 The message number. A four digit number that ranges from
0000 through 9999.
I The message type. A single letter that indicates the severity of
message:
C Critical error messages
N Non-critical error messages
W Warning messages
I Informational messages
The operation was The message explanation.
completed successfully.
You can type the GSE message identifier and letter indicating the message type in
uppercase or lowercase. Typing DB2 ″? GSE0000I″ will yield the same result as
typing db2 ″? gse0000i″.
You can omit the letter after the message number when you type the command.
For example, typing DB2 ″? GSE0000″ will yield the same result as typing DB2 ″?
GSE0000I″.
Suppose the message code is GSE4107N. When you type DB2 ″? GSE4107N″ at the
command prompt, the following information is displayed:
GSE4107N Grid size value "<grid-size>" is not valid where it is used.
One of the following invalid specifications was made when the grid index
was created with the CREATE INDEX statement:
- A number less than 0 (zero) was specified as the grid size for the
first, second, or third grid level.
- 0 (zero) was specified as the grid size for the first grid level.
- The grid size specified for the second grid level is less than the grid
size of the first grid level but it is not 0 (zero).
- The grid size specified for the third grid level is less than the grid
size of the second grid level but it is not 0 (zero).
- The grid size specified for the third grid level is greater than 0 (zero)
but the grid size specified for the second grid level is 0 (zero).
msgcode: -4107
sqlstate: 38SC7
If the information is too long to display on a single screen and your operating
system supports the more executable program and pipes, type this command:
db2 "? GSEnnnn" | more
Using the more program will force the display to pause after each screen of data
so that you can read the information.
This topic describes how to diagnose problems when stored procedures are
invoked explicitly in application programs or from the DB2 command line. To
diagnose stored procedures invoked implicitly, you use the messages returned by
the DB2 Spatial Extender CLP or the messages returned by the DB2 Control Center.
These messages are discussed in separate topics.
DB2 Spatial Extender stored procedures have two output parameters: the message
code (msg_code) and the message text (msg_text). The parameter values indicate
the success or failure of a stored procedure.
msg_code
The msg_code parameter is an integer, which can be positive, negative, or
zero (0). Positive numbers are used for warnings, negative numbers are
used for errors (both critical and non-critical), and zero (0) is used for
informational messages.
The absolute value of the msg_code is included in the msg_text as the
message number. For example
v If the msg_code is 0, the message number is 0000.
v If the msg_code is -219 , the message number is 0219. The negative
msg_code indicates that the message is a critical or non-critical error.
v If the msg_code is +1036, the message number is 1036. The positive
msg_code number indicates that the message is a warning.
The msg_code numbers for Spatial Extender stored procedures are divided
into the three categories shown in the following table:
Table 4. Stored procedure message codes
Codes Category
0000 - 0999 Common messages
1000 - 1999 Administrative messages
2000 - 2999 Import and export messages
msg_text
The msg_text parameter is comprised of the message identifier, the
message number, the message type, and the explanation. An example of a
stored procedure msg_text value is:
GSE0219N An EXECUTE IMMEDIATE statement
failed. SQLERROR = "<sql-error>".
When you invoke a DB2 Spatial Extender stored procedure from the DB2
command line, you receive the msg_code and the msg_text output parameters.
These output parameters indicate the success or failure of the stored procedure.
Suppose you connect to a database and want to invoke the ST_disable_db stored
procedure. The example below uses a DB2 CALL command to disable the database
for spatial operations and shows the output value results. A force parameter value
of 0 is used, along with two question marks at the end of the CALL command to
represent the msg_code and msg_text output parameters. The values for these
output parameters are displayed after the stored procedure runs.
call db2gse.st_disable_db(0, ?, ?)
Return Status = 0
Suppose the msg_text returned is GSE2110N. Use the DB2 help command to
display more information about the message. For example:
"? GSE2110"
msg_code: -2110
sqlstate: 38S9A
The following table explains the significant parts of this sample message:
DB21034E The command was processed as an SQL statement because it was
not a valid Command Line Processor command. During SQL processing it
returned: SQL0443N Routine "DB2GSE.GSEGEOMFROMWKT"
(specific name "GSEGEOMWKT1") has returned an error
SQLSTATE with diagnostic text "GSE3421N Polygon is not closed.".
SQLSTATE=38SSL
Table 5. The significant parts of DB2 Spatial Extender function messages
Message part Description
SQL0443N The SQLCODE indicates the type of problem.
GSE3421N The DB2 Spatial Extender message number and message type.
This results in an error message because you did not provide the end value to
close the polygon. The error message returned is:
DB21034E The command was processed as an SQL statement because it was
not a valid Command Line Processor command. During SQL processing it
returned: SQL0443N Routine "DB2GSE.GSEGEOMFROMWKT"
(specific name "GSEGEOMWKT1") has returned an error
SQLSTATE with diagnostic text "GSE3421N Polygon is not closed.".
SQLSTATE=38SSL
The SQL message number SQL0443N indicates that an error occurred and the
message includes the Spatial Extender message text GSE3421N Polygon is not
closed.
The message is repeated, along with a detailed explanation and recommended user
response.
Most of the messages returned through the DB2 Spatial Extender CLP are for DB2
Spatial Extender stored procedures. When you invoke a stored procedure from the
DB2 Spatial Extender CLP, you will receive message text that indicates the success
or failure of the stored procedure.
The message text is comprised of the message identifier, the message number, the
message type, and the explanation. For example, if you enable a database using the
command db2se enable_db testdb, the message text returned by the Spatial
Extender CLP is:
Enabling database. Please wait ...
Likewise, if you disable a database using the command db2se disable_db testdb
the message text returned by the Spatial Extender CLP is:
GSE0000I The operation was completed successfully.
The explanation that appears in the message text is the brief explanation. You can
retrieve additional information about the message that includes the detailed
explanation and suggestions to avoid or correct the problem. The steps to retrieve
this information, and a detailed explanation of how to interpret the parts of the
message text, are discussed in a separate topic.
If you are invoking stored procedures through an application program or from the
DB2 command line, there is a separate topic that discusses diagnosing the output
parameters.
Suppose you decide to display information for a shape file named office. Through
the Spatial Extender CLP (db2se) you would issue this command:
db2se shape_info -fileName /tmp/offices
1 NAME C ( Character) 16 0
2 EMPLOYEES N ( Numeric™) 11 0
3 ID N ( Numeric) 11 0
When you invoke commands that perform migration operations, messages are
returned that indicate the success or failure of that operation.
Suppose you invoke the migration of the database mydb using the command db2se
migrate mydb -messagesFile /tmp/migrate.msg. The message text returned by the
Spatial Extender CLP is:
Migrating database. Please wait ...
GSE0000I The operation was completed successfully.
When you receive a DB2 Spatial Extender message through the Control Center, the
entire message text appears in the text area of DB2 Message window, for example:
GSE0219N An EXECUTE IMMEDIATE statement
failed. SQLERROR = "<sql-error>".
When you receive an SQL message through the Control Center that pertains to
DB2 Spatial Extender:
v The message identifier, message number, and message type appear on the left
side of the DB2 Message window, for example: SQL0612N.
v The message text appears in the text area of the DB2 Message window.
The message text that appears in the DB2 Message window might contain the SQL
message text and the SQLSTATE, or it might contain the message text and the
detailed explanation and user response.
An example of an SQL message that contains the SQL message text and the
SQLSTATE is:
[IBM][CLI Driver][DB2/NT] SQL0612N "<name>" is a duplicate name. SQLSTATE=42711
An example of an SQL message that contains the message text and the detailed
explanation and user response is:
SQL8008N
The product "DB2 Spatial Extender" does not have a valid
license key installed and the evaluation period has expired.
Explanation:
User Response:
Restrictions:
Activate this facility only when directed by a DB2 technical support representative.
Procedure:
To trace the DB2 Spatial Extender events to memory, follow these basic steps:
1. Shut down all other applications.
Records the XML Extender server activity. To start the trace, apply the on option to
dxxtrc, along with the user profile and the name of an existing directory to contain
the trace file. When the trace is turned on, the file, dxxINSTANCE.trc, is placed in
the specified directory. INSTANCE is the value of DB2INSTANCE. Each DB2 UDB
instance has its own log file. INSTANCE is the numeric UID value assigned to the
User Profile for which the trace was started. The trace file is not limited in size.
Syntax:
Examples:
The following examples show starting the trace, with file, dxxdb2inst1.trc, in the
/u/user1/dxx/trace directory.
From the Qshell:
dxxtrc on user1 /u/user1/trace
From the iSeries Navigator:
call myschema.QZXMTRC(’on’, ’user1’, ’/u/user1/trace’);
From the OS command line:
call QDBXM/QZXMTRC PARM(on user1 ’/u/user1/trace’)
Recommendation: Because running the trace log file size is not limited and can
impact performance, turn trace off in a production environment.
Syntax:
Parameters:
Table 7. Trace parameters
Parameter Description
user_profile The name of the user profile associated with
the job within which the XML Extender is
running.
Examples:
DB2 CLI calls return SQLCODE and SQLSTATE values that you can retrieve using
the SQLError function. (For more information about retrieving error information
with the SQLError function, see the CLI Guide and Reference.)
An SQLCODE value of 0 means that the statement ran successfully (with possible
warning conditions). A positive SQLCODE value means that the statement ran
successfully but with a warning. (Embedded SQL statements return information
about the warning that is associated with 0 or positive SQLCODE values in the
SQLWARN field.) A negative SQLCODE value means that an error occurred.
DB2 associates a message with each SQLCODE value. If an XML Extender UDF
encounters a warning or error condition, it passes associated information to DB2
UDB for inclusion in the SQLCODE message.
Embedded SQL statements and DB2 UDB CLI calls that invoke the DB2 XML
Extender UDFs might return SQLCODE messages and SQLSTATE values that are
unique to these UDFs, but DB2 UDB returns these values in the same way that it
does for other embedded SQL statements or other DB2 UDB CLI calls. Thus, the
way that you access these values is the same as for embedded SQL statements or
DB2 UDB CLI calls that do not start the DB2 UDB XML Extender UDFs.
DXXA003E Cannot connect to database <database>. DXXA006I The database <database> was enabled
Explanation: The database specified might not exist or successfully.
could be corrupted. Explanation: This is an informational message.
User Response: User Response: No action required.
1. Ensure the database is specified correctly.
User Response: Ensure you specified the correct Explanation: XML Extender could not disable a
database name, table name, or column name. column because an internal trigger failed. Possible
causes:
DXXA024E The XML Extender encountered an v The system is out of memory.
internal error while accessing the system v A trigger with this name does not exist.
catalog tables.
User Response: Use the trace facility to create a trace
Explanation: The XML Extender was unable to access file and try to correct the problem. If the problem
system catalog table. persists, contact your Software Service Provider and
provide the trace file.
User Response: Ensure the database is in a stable
state.
DXXA030E Could not disable the column.
DXXA025E Cannot drop the default view Explanation: XML Extender could not disable a
<default_view>. column because an internal trigger failed. Possible
causes:
Explanation: While attempting to disable a column,
the XML Extender could not drop the default view. v The system is out of memory.
v A trigger with this name does not exist.
User Response: Ensure the administration user ID for
XML Extender has the privileges necessary to drop the User Response: Use the trace facility to create a trace
default view. file and try to correct the problem. If the problem
DXXA036I XML Extender has successfully disabled DXXA048E Could not enable the column.
database <database>. Explanation: XML Extender could not enable a
Explanation: This is an informational message. column because an internal trigger failed. Possible
causes:
User Response: No action is required.
v The DAD file has incorrect syntax.
v The system is out of memory.
v Another trigger exists with the same name.
User Response: Use the trace facility to create a trace
DXXA062E Unable to retrieve the column number User Response: No response required.
for <column_name> in table <table_name>.
Explanation: XML Extender could not retrieve the DXXA070W The database has already been enabled.
column number for column_name in table table_name Explanation: The enable database command was
from the system catalog. executed on the enabled database
User Response: Make sure the application table is User Response: No action is required.
well defined.
DXXA074E Wrong parameter type. The stored DXXC003E Unable to write to the specified file.
procedure expects a STRING parameter.
Explanation: The XML Extender is unable to write
Explanation: The stored procedure expects a STRING data to the file.
parameter.
User Response: Ensure that the application user ID
User Response: Declare the input parameter to be has write permission for the file or that the file system
STRING type. has sufficient space.
DXXA075E Wrong parameter type. The input DXXC004E Unable to operate the LOB Locator:
parameter should be a LONG type. rc=<locator_rc>.
Explanation: The stored procedure expects the input Explanation: The XML Extender was unable to
parameter to be a LONG type. operate the specified locator.
User Response: Declare the input parameter to be a User Response: Ensure the LOB Locator is set
LONG type. correctly.
DXXA076E XML Extender trace instance ID invalid. DXXC005E Input file size is greater than
XMLVarchar size.
Explanation: Cannot start trace with the instance ID
provided. Explanation: The file size is greater than the
XMLVarchar size and the XML Extender is unable to
User Response: Ensure that the instance ID is a valid
import all the data from the file.
iSeries user ID.
User Response: Use the XMLCLOB column type.
DXXA077E The license key is not valid. See the
server error log for more detail. DXXC006E The input file exceeds the DB2 UDB
LOB limit.
Explanation: The software license has expired or does
not exist. Explanation: The file size is greater than the size of
the XMLCLOB and the XML Extender is unable to
User Response: Contact your service provider to
import all the data from the file.
obtain a new software license.
User Response: Decompose the file into smaller
objects or use an XML collection.
DXXC000E Unable to open the specified file.
Explanation: The XML Extender is unable to open the
DXXC007E Unable to retrieve data from the file to
specified file.
the LOB Locator.
User Response: Ensure that the application user ID
Explanation: The number of bytes in the LOB Locator
has read and write permission for the file.
does not equal the file size.
User Response: Ensure the LOB Locator is set
DXXC001E The specified file is not found.
correctly.
Explanation: The XML Extender could not find the file
specified.
DXXC008E Can not remove the file <file_name>.
User Response: Ensure that the file exists and the
Explanation: The file has a sharing access violation or
path is specified correctly.
is still open.
User Response: Close the file or stop any processes
that are holding the file. You might have to stop and
restart DB2.
DXXC012E Cannot create temporary file. DXXG000E The file name <file_name> is invalid.
Explanation: Cannot create file in system temp Explanation: An invalid file name was specified.
directory.
User Response: Specify a correct file name and try
User Response: Ensure that the application user ID again.
has write permission for the file system temp directory
or that the file system has sufficient space for the file.
DXXG001E An internal error occurred in build
<build_ID>, file <file_name>, and line
DXXC013E The results of the extract UDF exceed <line_number>.
the size limit for the UDF return type.
Explanation: XML Extender encountered an internal
Explanation: The data returned by an extract UDF error.
must fit into the size limit of the return type of the
User Response: Contact your Software Service
UDF, as defined in the DB2 UDB XML Extender
Provider. When reporting the error, be sure to include
Administration and Programming guide. For example,
all the messages, the trace file and how to reproduce
the results of extractVarchar must be no more than 4000
the error.
bytes (including the terminating NULL).
User Response: Use an extract UDF that has a larger
DXXG002E The system is out of memory.
size limit for the return type: 254 bytes for
extractChar(), 4 KB for extractVarchar(), and 2 GB for Explanation: The XML Extender was unable to
extractClob(). allocate memory from the operating system.
User Response: Close some applications and try
DXXD000E An invalid XML document is rejected. again. If the problem persists, refer to your operating
system documentation for assistance. Some operating
Explanation: There was an attempt to store an invalid
systems might require that you reboot the system to
document into a table. Validation has failed.
correct the problem.
User Response: Check the document with its DTD
using an editor that can view invisible invalid
characters. To suppress this error, turn off validation in
the DAD file.
DXXG005E Parameter not supported. DXXQ000E <Element> is missing from the DAD file.
Explanation: This parameter is not supported in this Explanation: A mandatory element is missing from
release, will be supported in the future release. the document access definition (DAD) file.
User Response: Set this parameter to NULL. User Response: Add the missing element to the DAD
file.
DXXG006E Internal Error CLISTATE=<clistate>,
RC=<cli_rc>, build <build_ID>, file DXXQ001E Invalid SQL statement for XML
<file_name>, line <line_number> generation.
CLIMSG=<CLI_msg>.
Explanation: The SQL statement in the document
Explanation: XML Extender encountered an internal access definition (DAD) or the one that overrides it is
error while using CLI. not valid. A SELECT statement is required for
generating XML documents.
User Response: Contact your Software Service
Provider. Potentially this error can be caused by User Response: Correct the SQL statement.
incorrect user input. When reporting the error, be sure
to include all output messages, trace log, and how to
DXXQ002E Cannot generate storage space to hold
reproduce the problem. Where possible, send any
XML documents.
DADs, XML documents, and table definitions which
apply. Explanation: The system is running out of space in
memory or disk. There is no space to contain the
resulting XML documents.
DXXG007E Locale <locale> is inconsistent with DB2
UDB code page <code_page>. User Response: Limit the number of documents to be
generated. Reduce the size of each documents by
Explanation: The server operating system locale is
removing some unnecessary element and attribute
inconsistent with DB2 UDB code page.
nodes from the document access definition (DAD) file.
User Response: Correct the server operating system
locale and restart DB2.
DXXQ003W Result exceeds maximum.
Explanation: The user-defined SQL query generates
DXXG008E Locale <locale> is not supported.
more XML documents than the specified maximum.
Explanation: The server operating system locale can Only the specified number of documents are returned.
not be found in the code page table.
User Response: No action is required. If all
User Response: Correct the server operating system documents are needed, specify zero as the maximum
locale and restart DB2. number of documents.
DXXG017E The limit for XML_Extender_constant has DXXQ004E The column <column_name> is not in the
been exceeded in build build_ID, file result of the query.
file_name, and line line_number.
Explanation: The specified column is not one of the
Explanation: Check the XML Extender Administration columns in the result of the SQL query.
and Programming Guide to see whether your
User Response: Change the specified column name in
application has exceeded a value in the limits table. If
the document access definition (DAD) file to make it
no limit has been exceeded, contact your Software
one of the columns in the result of the SQL query.
Service Provider. When reporting the error, include all
Alternatively, change the SQL query so that it has the
output messages, trace files, and information on how to
specified column in its result.
reproduce the problem such as input DADs, XML
documents, and table definitions.
User Response: Correct the server operating system
locale and restart DB2.
DXXQ057E The schemabindings and dtdid tags DXXQ063E The multi_occurrence attribute value on
cannot exist together in the DAD file. elementname in the DAD file is invalid.
Explanation: The schemabindings and dtdid tags Explanation: The value of the multi_occurrence
cannot exist together in the DAD file. attribute on the specified element_node in the
document access definition (DAD) file is wrong or
User Response: Check that either the schemabindings
missing. The value must be ’yes’ or ’no’, case
tag or the dtdid tag exists in the DAD file, but not
insensitive.
both.
User Response: Ensure that the multi_occurrence
attribute is specified correctly in the DAD file.
DXXQ058E The nonamespacelocation tag inside the
schemabindings tag is missing in the
DAD file. DXXQ064E Column column not found in foreign
table table.
Explanation: The nonamespacelocation tag inside the
schemabindings tag is missing in the DAD file. Explanation: A key column specified in the join
condition was not mapped to any element or attribute
User Response: Add the nonamespacelocation tag to
node.
the schemabindings tag.
User Response: Check to make sure the join condition
specified in the DAD file is correct, and all key
DXXQ059E The doctype tag cannot be located
columns are mapped to element or attribute nodes.
inside the XCollection tag in the DAD
for schema validation.
DXXQ065I All triggers relating to XML enabled
Explanation: The doctype tag cannot be located inside
columns have been successfully
the XCollection tag in the DAD for schema validation.
regenerated.
User Response: Remove the doctype tag inside the
Explanation: This is an informational message only.
Xcollection tag for schema validation.
User Response: No action required.
DXXQ060E Attempt to find SCHEMA ID schemaid
failed. DXXQ066E The primary key for table tablename does
not exist.
Explanation: The XML Extender could not find the
SCHEMA ID while attempting to enable the column. Explanation: XML Extender could not determine the
The SCHEMA ID corresponds to the value of the primary key for table tablename. Check that the primary
location attribute of the nonamespacelocation tag which key for the table was not dropped after the column was
is inside the schemabindings tag in the DAD file. enabled for XML.
User Response: Check that the correct value for the User Response: Alter the table to add the primary key
SCHEMA ID is specified in the DAD file. specified as the ROOT ID when the column was
enabled for XML.
DXXQ061E The format of the string is invalid.
DXXQ067E Attempt to action failed.
Explanation: The format of the string representation is
invalid. If the string is a date, time, or timestamp value, Explanation: While attempting to action, a SQL error
the syntax does not conform to its data type. occurred.
User Response: Check that the format of the date, User Response: Contact your Software Service
time, or timestamp value conforms to the format for its Provider. When reporting the error, be sure to include
data type. the XML Extender trace file.
DXXQ062E No rows of result set for table are left to DXXQ068E Cannot set current SQLID to [userid].
produce a XML value for element. SQLCODE = [sqlcode].
Explanation: This error condition is usually caused by Explanation: While attempting to set current sqlid to a
a missing multi_occurrence = YES specification on the secondary authorization id, a SQL error occurred.
parent element_node of the given element or attribute.
User Response: Check that you are specifying a valid
User Response: Check the DAD that the value of secondary authorization id and that you have
multi_occurrence on the parent element_node correctly authorization for the id.
An application that makes a request for a lock that is not compatible with the
existing locks on the object, or a lock request not already satisfied will be placed
into a lock request pending queue. The lock request will continue to be held for
the waiting application until either timeout period is exceeded or a deadlock is the
cause of the result.
Lock escalation:
In both cases, the database manager will attempt to free up memory allocated to
locking by obtaining table locks and releasing existing row locks. The desired effect
is to make more lock memory available for additional applications.
The following two database parameters have a direct affect on lock escalation:
v locklist- the total number of 4k pages allocated for lock storage.
v maxlocks- the allowable percentage of locklist that can be used by a single
application
Tuning and monitoring may be necessary to find a balance for these values.
Workload, and query behavior dictate locking patterns and how applications will
use lock memory.
Deadlocks:
Related reference:
v Factors that affect locking
v Locks and performance
v Guidelines for locking
v Deadlocks between applications
v Specifying a lock wait mode strategy
v Correcting lock escalation problems
v Deadlock Prevention for Multiple Contexts
Tracking deadlocks
Snapshots provide valuable insight into the number of deadlocks that have
occurred. If you find that the number of deadlocks is abnormally large, you should
consider enabling an event monitor to track the deadlock events more closely. By
default, all databases have an event monitor named DB2DETAILDEADLOCK defined,
which keeps track of DEADLOCKS WITH DETAILS. The DB2DETAILDEADLOCK event
monitor starts automatically when the database starts.
Alternatively, you can analyze the deadlocks using the db2pd tool. Refer to db2pd
sample output.
These examples shows how to identify both a deadlock event and the applications
involved. You could potentially correct this issue by adjusting the lock mode or
isolation level of the application. The DB2 Administration Guide is an excellent
reference for different isolation levels and their effect on concurrency.
Related reference:
v Locks and concurrency control
v Deadlocks between applications [link to
http://publib.boulder.ibm.com/infocenter/db2help/topic/com.ibm.db2.udb.doc/admin/c00054
When there is reason to believe that a locking conditions is being encountered the
following steps are suggested:
Step 1. Take a lock snapshot
"db2 get snapshot for locks on sample"
Step 2. Take an application snapshot
The list of monitor elements that are of interest in such cases can be found here:
Lock wait information monitor elements
In the example, the application experienced 5 lock timeouts during its connection
to the database. Also, we see that the application waited 96443 milliseconds for
locks to be released. The average wait time can be calculated as follows:
(Time application waited for Locks / Lock waits since connect)
In the above case we see that each lock wait had an average time of 8036
milliseconds. In some environments (for example decision support systems) this
might be considered normal, in others (for example online transaction processing)
it would be considered excessive. Of course, user needs and business requirements
should be used as measures.
In cases where you find lock timeouts becoming excessive when compared to
normal operating levels, you may have an application that is holding locks for an
extremely long period of time. It is also possible that if the number of lock
timeouts is extremely low but the response time for queries is sluggish, the lock
timeout parameter may be set too high.
Please note, to simplify and not introduce unnecessary workload onto your
environment, we’re going to model a long running query by disabling autocommit.
1. Open two DB2 command windows, and connect to sample from both windows
2. In the first window, issue the following query:
a. db2 +c ″insert into staff values (27,’Jones’,2,’Mgr’,13,35000,0)″
3. From the second window issue the following query:
a. db2 ″select * from staff″
4. Obtain a snapshot
a. db2 get snapshot for applications on sample
5. View the snapshot
6. Issue a commit or a rollaback in both windows:
a. db2 commit
Look for the ″Application Status″ field. You should see one of the applications in
″UOW waiting″ state, and the other in ″Lock-wait″ state. In the above case, you can
see that application issuing the SELECT had made a lock request, but the
application performing the insert was holding the requested lock. In the example,
Again, in this simplified case we actually forced the lock wait to happen, however
when pursuing such issues, you may want to investigate the frequency of commits
for the application, the locking semantics (isolation level) used or the size of an
application’s unit of work.
Related reference:
v Snapshot monitor sample output
Determine the application that is holding the lock(s) that application handle 1 is
waiting on:
.........................
ID of agent holding lock = 0
Application ID holding lock = *LOCAL.DB2.050312015656
........................
Note that the application is in ″UOW Waiting″ state. This means that application is
either doing some other processing or has an open UOW (unit of work). If the
application is idle, i.e. there is no more work to do then the status will read ″Idle″.
An idle application does not hold any database locks.
...................................
The lock snapshot shows that application handle 1 is requesting a Next Key Share
(NS) lock but is waiting on application handle 0 that has an Exclusive Lock (X).
Analyze the application snapshot to get more details about application handle 0.
An (X) lock is not compatible with an (NS) lock, hence the Lock-Wait. The DB2
UDB Administration Guide outlines lock compatibilities.
If you have the statement monitor switch enabled at the time of the snapshot, you
will also see the following:
.................
Rows read = 2
Rows written = 1
Rows deleted = 0
Rows updated = 0
Rows inserted = 0
Rows fetched = 0
...
Blocking cursor = NO
Dynamic SQL statement text:
insert into staff values (27,’Jones’,2,’Mgr’,13,35000,0)
The application snapshot confirms that the UOW has begun but has not yet been
completed. This indicates that the UOW is still open. The snapshot also tells us
that the application handle is executing a dynamic SQL statement, an insert into
the table STAFF in this case.
Application handle 0 has not yet committed and is holding 4 locks. Details about
these locks can be seen in the lock snapshot, for example:
................................
List Of Locks
Lock Count = 1
Hold Count = 0
Mode = X
..................................
One of the 4 locks that application handle 0 is holding is an X lock. This lock name
is the same as the one which the lock snapshot shows application 1 to be waiting
for.
From the above analysis it can be determined that the cause of this locking
condition is that an application is executing an INSERT into a table which requires
exclusive access and has been granted all the required locks but has not
committed. Any application with a weaker lock will have to wait for the UOW to
commit. (This is the default behavior for the Cursor Stability (CS) isolation level.)
Application handle 0 should commit more frequently.
Performance issues
Performance problems cover a wide range of scenarios:
v Identifiable query performing slower than expected
v Workload or batch job not completing as soon as expected, reduction in
transaction rate or throughput
There are some subtleties in the scenarios depicted above. For problem diagnosis
purposes, it is important to clarify whether something is not meeting expectations
or is exceeding resource capacity. Sometimes it is both.
If the problem has been occurring for some time, and if a database monitor
schedule has been implemented, you can use historical data to find differences.
This will allow you to focus on changes in system behavior and then focus on why
these changes were introduced. Refer to Proactive monitoring tools. It is also
important to consider whether any recent changes occurred, such as hardware or
software upgrades, a new application rollout, additional users, etc.
If the poor performance is continual, check to see if the system has started to
handle more load or if a shared database resource has become a bottleneck. Other
potential causes of performance degradation include increased user activity,
multiple large applications, or removal of hardware devices. If performance is poor
only for brief periods begin by looking for common applications or utilities
running at these times. If users report that a group of applications are experiencing
performance issues, then you can begin your analysis by focusing on these
applications.
Does the problem appear to be system-wide or isolated to DB2 and its applications?
You should determine if any common database tables, table space, indexes, etc. are
involved. If so, this suggests that these objects are a point of contention. Other
areas to potentially focus on are referential integrity constraints, foreign key
cascades, locking issues etc.
Looking at DB2:
It’s possible that after your initial review, you identify that there’s a strong
possibility that DB2 is the source of the performance issues. In this case, ask the
following questions:
Are users reporting abnormally long response time for all applications?
1. Have you detected a large amount of I/O? Here are some possible causes:
a. Overloaded devices.
b. Heavy SORTS or use of temporary table spaces.
c. Table scan of a large table.
d. Insufficient buffer pool.
2. Have you detected a high CPU usage? Possible causes include:
a. Heavy SORTS.
b. Insufficient buffer pool sizes.
3. Both (1) and (2)
a. Increased number of users?
b. Large spilled SORTS.
c. Application design?
4. Neither (1) and (2)?
a. Are applications waiting on locks? Refer to Locking issues.
b. Are applications waiting on data?
Are users reporting abnormally long response time for one application or query? Possible
causes include:
v SORTS.
v Concurrency issues.
v Stale statistics.
These are general questions to ask yourself when faced with a performance issue.
This list is by no means exhaustive given the size and complexity of modern
systems, performance issues can surface from a multitude of possibilities.
Regardless, these questions will start you on a logical path to determining where
the problem came from.
Related reference:
v Elements of performance [Link to ]
v Developing a performance improvement process [Link to ]
v Performance tuning guidelines [link to ]
There are three methods of viewing an access plan. Refer to Explain tools. Note
that prior to using these tools, you must create the EXPLAIN tables for the
database. Refer to Explain tables.
To better understand access plans, you need to first understand these basic
components:
Cardinality
<PLAN OPERATOR>
Cost
I/O Cost
The card or cardinality represents the number of rows that DB2 had estimated to
be the output of the operator. The cost represents the CPU cost of this and
previous operations, and IO cost represents the cost of the operator on the system’s
IO subsystems. For example, a snippet from db2exfmt output may appear as
follows:
383.332 <- Cardinality
MSJOIN <- Plan Operator
( 5)
448.972 <- Cost
14.2765 <- I/O Cost
/---+---\
You may often find yourself reviewing an access plan that suggests that only a few
rows will be returned. You need to examine and evaluate the cardinality estimates
to determine how accurate these really are. For example:
100
FETCH
/-------------+-----------\
100 perfdb
ISCAN Table1
| 1000
Index: perfdb
Index1
1000
The above plan fragment indicates that the FETCH operation will return an
expected 100 rows. If you suspect that more than 100 rows should be returned (or
less. the principle is the same), you can determine and compare the ″true
cardinality″ with the estimated. To do so, you need to first isolate the predicates
applied at the ISCAN. You can find these in the detailed operator section of the
access plan (this has been reduced to show only the important portions):
3) IXSCAN: (Index Scan)
Cumulative Total Cost: 30.9743
Cumulative CPU Cost: 149356
Cumulative I/O Cost: 1
Cumulative Re-Total Cost: 4.15582
Cumulative Re-CPU Cost: 103895
Cumulative Re-I/O Cost: 0
Cumulative First Row Cost: 30.9054
Estimated Bufferpool Buffers: 2
Predicates:
----------
2) Start Key Predicate
Relational Operator: Equal (=)
Subquery Input Required: No
Filter Factor: 0.1
Predicate Text:
--------------
(Q2.column1 = 5)
Taking the predicate applied here, you can formulate an SQL statement to test the
validity of the cardinality estimate:
db2 select count(*) from table1 where column1=5
If you find that the output of the above query generates a value significantly
different than the estimated value, the statistics may have become stale and a
RUNSTATS may be necessary.
You see that from the SORT(16) operator to the TBSCAN(15) operator, the cost
went from 6.14e6 to 6.87e6. This jump in COST for the operation directly following
a sort indicates that the SORT has spilled to disk, and has created temporary tables
in order to handle overflow rows. To determine the estimated number of pages
expected to spill, jump to the operator details section of the plan:
15) TBSCAN: (Table Scan)
.
.
.
Estimated Bufferpool Buffers: 163976
The estimated buffer pool buffers indicate that 163976 pages were expected to spill.
Possible corrections include increasing sortheap or defining an index.
Related reference:
v Description of db2expln and dynexpln output
v Explain tools
v Examples of db2expln and dynexpln output
v Guidelines for analyzing explain information
v The SQL compiler process
v Guidelines for using explain information
v Optimization class guidelines
Tuning practices
Click on this link for more information
Sort overflows
Click on this link for more information
Related reference:
v Data partitioning
v Recovering from transaction failures in a partitioned database environment
If you find that you cannot start the instance successfully after enabling data
partitioning, some of the common causes are:
v The .rhosts file has not been configured properly, on UNIX and Linux platforms
v The fast communication manager (FCM) ports have not been reserved
On UNIX and Linux platforms, when you have set up a partitioned instance and
are trying to start the instance for the first time, you may encounter an SQL6048
error. For example:
If the .rhosts file has not been properly configured, you will see an indication of
the source of the problem in the db2diag.log file:
2005-03-17-18.15.30.810022 Instance:db2inst1 Node:000
PID:59060(db2start) TID:1 Appid:none
oper system services sqloPdbExecuteRemoteCmd Probe:50
0x2FF1D75C : 7273 6864 3A20 3038 3236 2D38 3133 2050 rshd: 0826-813 P
0x2FF1D76C : 6572 6D69 7373 696F 6E20 6973 2064 656E ermission is den
0x2FF1D77C : 6965 642E 0A ied..
...
Since DB2 ESE uses the rsh command to execute some commands such as db2start
on all of the partitions, each partition must have the authority to perform remote
commands on the other partitions. This can be done by updating the .rhosts file in
the instance home directory. Refer to Enabling the execution of remote commands
(UNIX).
After you edit the .rhosts file properly, run db2start again. It should now be
successful on all partitions.
Problem 2: Too few (or no) FCM ports have been reserved
This situation can occur on all platforms. It is usually typified by a SQL6031 error
on db2start. For example:
SQL6031N Error in the db2nodes.cfg file at line number "3". Reason code "12".
To find out what reason code 12 refers to, execute the db2 ? command:
% db2 ? SQL6031
...
(12) The port value at line "<line>" of the db2nodes.cfg file in
the sqllib directory is not in the valid port range defined for
your DB2 instance id in the services file (/etc/services on
UNIX-based systems).
...
Related reference:
Log full situation during redistribution: After adding a database partition and
updating the nodegroup definition, you need to use the REDISTRIBUTE NODEGROUP
utility to move the data to the appropriate database partitions. Partition
redistribution is an insert-delete procedure. DB2 logs each insert and delete SQL on
the related partitions. If the log space size is not big enough, it’s possible for the
partition redistribution operation to fail with an SQL0964 (″The transaction log for
the database is full″) error when a large number of records need to be redistributed
across partitions. For example:
% db2 "redistribute nodegroup ibmdefaultgroup uniform"
SQL6064N SQL error "-964" occurred during data redistribution.
% db2 ? sql0964
SQL0964C The transaction log for the database is full.
From the db2diag.log file, you can tell that partition (NODE) 0 hit the log full
error. You now need to increase the log space size on that partition. You can either
increase the log file size or the number of the log files. The following example
chooses to increase the log file size:
Switch to partition 0:
% db2 terminate
% export DB2NODE=0
Increase the log space size by increasing the LOGFILSIZ db cfg parameter:
% db2 update db cfg for sample using LOGFILSIZ 1000
Related reference:
v Log space requirements for data redistribution
v Redistributing data across partitions
v Redistribution error recovery
SQL1035 (database in use) when taking offline backups in parallel: The version
recovery method requires loading a backup copy of the database. The database
will be restored to exactly the same state that it was in when it was backed up.
Using the version recovery method, you must schedule and perform full backups
of the database on a regular basis.
You may have the following experience: All database partitions are inactive at the
moment. However, offline backup of all partitions in parallel fails with SQL1035N
(The database is currently in use.) on most of the partitions.
This occurs because the database backup utility requires exclusive access to the
catalog partition.
To properly backup the database in parallel, you may use the following
commands:
% db2_all "<<+0<; db2 backup database sample to /database/backup"
% db2_all "<<-0<; db2 backup database sample to /database/backup"
Related reference:
v BACKUP DATABASE command
v Version recovery
DB2 documentation:
Refer to the DB2 Technical Support Web site if you are experiencing problems and
want help finding possible causes and solutions. The Technical Support site has
links to the latest DB2 publications, TechNotes, Authorized Program Analysis
Reports (APARs), FixPaks and the latest listing of internal DB2 error codes, and
other resources. You can search through this knowledge base to find possible
solutions to your problems.
Once you have a clear understanding of what the problem situation is, you need to
compile a list of search keywords to increase your chances of finding the existing
solutions. Here are some tips:
1. Use multiple words in your search. The more pertinent search terms you use,
the better your search results will be.
2. Start with specific results, and then go to broader results if necessary. i.e. If too
few results are returned, then remove some of the less pertinent search terms
and try it again. Alternatively, if you are uncertain which keywords to use, you
can perform a broad search with a few keywords, look at the type of results
that you receive, and be able to make a more informed choice of additional
keywords.
3. Sometimes it is more effective to search for a specific phrase. For example, if
you enter: ″administration notification file″ (with the quotes) you will get only
those documents that contain the exact phrase in the exact order in which you
type it. (As opposed to all documents that contain any combination of those
three words).
4. Use wildcards. If you are encountering a specific SQL error, search for
″SQL5005<wildcard>″, where wildcard is the appropriate wildcard for the
resource you’re searching. This is likely to return more results than if you had
merely searched for ″SQL5005″ or ″SQL5005c″.
5. If you are encountering a situation where your instance ends abnormally and
produces trap files, search for known problems using the first two or three
functions in the trap or core file’s stack traceback. If too many results are
returned, try adding keywords ″trap″, ″abend″ or ″crash″.
6. If you are searching for keywords that are operating-system-specific (such as
signal numbers or errno values), try searching on the constant name, not the
value. i.e. Search for ″EFBIG″ instead of the error number 27. For information
about matching operating system error numbers to their constant names, see
Platform specific error logs and Formatting and interpreting trap files.
Related reference:
v Introduction to problem determination
v Platform specific error logs
v Formatting and interpreting trap files
APARs have unique identifiers. For example, ″IY53671″ and ″JR19727″. Each DB2
APAR is specific to a particular version of DB2 (e.g. DB2 version 8 or DB2 version
7).
FixPaks are cumulative. This means that the latest FixPak for any given version of
DB2 contains all of the updates from previous FixPaks for the same version of
DB2. It is recommended that you keep your DB2 environment running at the latest
FixPak level to ensure problem-free operation.
To get a better understanding of APARs, go to the DB2 UDB Support website for
Linux, Windows and UNIX platforms:
http://www.ibm.com/software/data/db2/udb/support/
In the search bar, enter one of the APAR identifiers mentioned above, i.e. ″IY53671″
or ″JR19727″.
A fix is available
APAR status
Closed as program error.
Error description
Users who have privileges to access a tablespace without the
grant option cannot be granted permission with the grant option
without having their privilege on the tablespace dropped first.
Users who are granted access with the grant option up front do
not have a problem.
Local fix
Drop the user’s access to the tablespace and then reissue the
grant using the ’with grant option’.
Problem Description:
Users who may think they have access to a tablespace with the
grant option will not be able to grant other users access to the
tablespace.
Problem Summary:
Users are unable to grant access to a tablespace when they have
been given explicit grant access with the grant option.
Problem conclusion
Temporary fix
Comments
APAR information
APAR number IY61009
Reported component name DB2 UDB ESE AIX
Reported component ID 5765F4100
Reported release 810
Status CLOSED PER
PE NoPE
HIPER NoHIPER
Submitted date 2004-08-24
Closed date 2005-02-04
Last modified date 2005-02-09
Modules/Macros
DEFSRXXX
Fix information
Applicable component levels
R810 PSY UP
Go back to the main page on the DB2 Support website. Click on the ″APARs″ link.
It should take you to the following page:
http://www.ibm.com/software/data/db2/udb/support/apars.html
Here you will see lists of (among other things) ″Open APARs″. Open APARs are
those which are currently being worked upon or are waiting to be included in the
next available FixPak. You can view lists of all of these outstanding APARs on this
website.
Open APARs are likely to be resolved in the next available FixPak for the version
that they are opened against. There are two exceptions to this:
v an APAR might be identified too late in a FixPak’s development and testing
cycle to be included, or
v an APAR might be closed, to be fixed in a future release (closed as ″FIN″). The
explanation of a FIN APAR is:
High-Impact PERvasive (HIPER) APARs are critical bugs of which all DB2
customers should be aware. Bugs that might result in data loss, system outages,
function loss, poor performance, or are pervasive in the field are typically
categorized as HIPER APARs.
A HIPER APAR has the same format as all other APARs. If you click on one of
these HIPER APARs, though, you will see that there is a flag at the bottom of the
APAR information:
Yes HIPER Yes HIPER
You should review each HIPER APAR that is not resolved in the DB2 version and
FixPak that you are running. This helps you assess the risk exposure of staying at
a particular FixPak level.
Reading the abstract of the less severe open APARs also helps you assess the risk.
Related reference:
v Applying the latest FixPak (Windows and UNIX)
IBM may have patents or pending patent applications covering subject matter
described in this document. The furnishing of this document does not give you
any license to these patents. You can send license inquiries, in writing, to:
IBM Director of Licensing
IBM Corporation
North Castle Drive
Armonk, NY 10504-1785
U.S.A.
For license inquiries regarding double-byte (DBCS) information, contact the IBM
Intellectual Property Department in your country/region or send inquiries, in
writing, to:
IBM World Trade Asia Corporation
Licensing
2-31 Roppongi 3-chome, Minato-ku
Tokyo 106, Japan
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
sites. The materials at those Web sites are not part of the materials for this IBM
product, and use of those Web sites is at your own risk.
IBM may use or distribute any of the information you supply in any way it
believes appropriate without incurring any obligation to you.
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:
Trademarks
The following terms are trademarks of International Business Machines
Corporation in the United States, other countries, or both, and have been used in
at least one of the documents in the DB2 UDB documentation library.
ACF/VTAM iSeries
AISPO LAN Distance
AIX MVS
AIXwindows MVS/ESA
AnyNet MVS/XA
APPN Net.Data
AS/400 NetView
BookManager OS/390
C Set++ OS/400
C/370 PowerPC
CICS pSeries
Database 2 QBIC
DataHub QMF
DataJoiner RACF
DataPropagator RISC System/6000
DataRefresher RS/6000
DB2 S/370
DB2 Connect SP
DB2 Extenders SQL/400
DB2 OLAP Server SQL/DS
DB2 Information Integrator System/370
DB2 Query Patroller System/390
DB2 Universal Database SystemView
Distributed Relational Tivoli
Database Architecture VisualAge
DRDA VM/ESA
eServer VSE/ESA
Extended Services VTAM
FFST WebExplorer
First Failure Support Technology WebSphere
IBM WIN-OS/2
IMS z/OS
IMS/ESA zSeries
Microsoft, Windows, Windows NT, and the Windows logo are trademarks of
Microsoft Corporation in the United States, other countries, or both.
Intel and Pentium are trademarks of Intel Corporation in the United States, other
countries, or both.
Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the
United States, other countries, or both.
Notices 207
UNIX is a registered trademark of The Open Group in the United States and other
countries.
H
high impact pervasive APARs 1
HIPER APARs 1
I
IBM Software Support Handbook 1
O
OFFLINE table space
bringing ONLINE 151
P
problem determination tutorials
introduction to problem
determination 1
operating system diagnostics 71
process model
for DB2 4
process status
viewing
UNIX 41
S
Software Support Handbook 1
system command (UNIX)
dbx 69
system core files, UNIX 69
system processes 4
Product information
Information regarding DB2 Universal Database products is available by telephone
or by the World Wide Web at http://www.ibm.com/software/data/db2/udb
This site contains the latest information on the technical library, ordering books,
product downloads, newsgroups, FixPaks, news, and links to web resources.
If you live in the U.S.A., then you can call one of the following numbers:
v 1-800-IBM-CALL (1-800-426-2255) to order products or to obtain general
information.
v 1-800-879-2755 to order publications.
For information on how to contact IBM outside of the United States, go to the IBM
Worldwide page at www.ibm.com/planetwide
Printed in USA
GC09-2850-01
Spine information:
IBM ® ®
IBM DB2 Universal Database DB2 Troubleshooting Guide