Db2 11.1

Introduction to messages

Messages convey event information to users. A message describes the cause of an event and any actions you can take in response to an event.

Messages typically contain the following information:
  • The nature of an event.
  • The possible cause of an event.
  • The possible action that you can take to resolve or avoid an event.

Message structure

When an event occurs, messages can be printed to diagnostic or notification logs, to a console, or on a graphical interface. These messages are typically presented in a standardized structure. A message contains the following sections:
  • A unique identifier
  • Short text
  • An explanation section
  • A user response
Unique message identifier
Identifiers consist of a three character message prefix, followed by a four or five-digit message number, followed by a single letter suffix. For example, SQL1042C.
Message identifier prefix
Three characters that identify the category of a message. For example, the ADM message identifier prefix identifies a message as an administration notification message.
Message number
Unique four or five-digit number that identifies the message.
Single letter suffix
A single character that indicates the type of event message.
Indicates a severe error message.

For messages with an SQL message identifier prefix, the C suffix indicates a critical error message.

Indicates an urgent error message. The E suffix is for non-SQL messages.
Indicates an error message.
Indicates a warning message.

For messages with an ADM message identifier prefix, the W suffix indicates an important event message.

For messages with an SQL message identifier prefix, the W suffix indicates a warning or informational message.

Indicates an informational message.
Short text
A brief statement that describes the event. The short text can contain one or more tokens that are replaced at run time with specific values to help you diagnose the cause of an event. The message tokens are also referred to as message variables. For example, the SQL0107N message has following short text:
SQL0107N The name "name" is too long. The maximum length is "length". 
You can use the SQL0107N message tokens "name" and "length" to determine which object caused the error event and the maximum length that is allowed for that type of object.
In some cases, a token is not applicable for a specific instance of an error, and the value *N is returned instead. For example:
SQL20416N The value provided ("*N") could not be converted to a security
label. Labels for the security policy with a policy ID of "1" should be "8"
characters long. The value is "0" characters long.  SQLSTATE=23523
Explanation section
Some paragraphs that provide context and explain the event in more details.
User response
A paragraph that provides you with directions to handle the event that generated the message.

Getting message help from the CLP or Command Window

You can display help for a message from the Db2® CLP or Db2 Command Window. You can display help for a message identifier or an SQLSTATE.

Table 1. Format and examples for getting message help
Context Command utility Format Example
Message identifier Db2 CLP ? identifier ? SQL20506N
Message identifier Db2 Command Window db2 ? identifier db2 ? SQL20506N
SQLSTATE Db2 CLP ? sqlstate ? 51044
SQLSTATE Db2 Command Window db2 ? sqlstate db2 ? 51044

Messages that appear only in the diagnostic file

Messages with a DIA identifier prefix are logged in the diagnostic file (db2diag.log), but are not documented anywhere else.