Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

HowTo - New knldiag Message File Format as of SAP MaxDB 7.7

Get to know the new knldiag message file pseudo-XML format format and the additional steps required in order to display it properly.

SAP MaxDBs message file format changed from plain text to pseudo-XML

  1. Introduction
  2. Some facts
  3. Why pseudo-XML? Why a new message list style?
  4. Comparing old and new
  5. How to display the new message files
  6. Just for completeness, here are further options

Introduction

knldiag, knldiag.err, dbm.prt - up to SAP MaxDB 7.6 all of these log files were constantly written in plain text to database run directory. Wanted to know what happened at a certain time? Easy - just drag the content to notepad or use vi.
With SAP MaxDB 7.7 this has considerably changed: we have sacrificed plain text writing for the benefit of enhanced error information.

Do I need to know this/does it concern me?

Depends. Every SAP MaxDB tool automatically converts our pseudo-XML to plain text, so if you are exclusively using Database Studio, Database Manager or Database assistant (transaction DB50/LC10), you do not need to trouble yourself with further details - just get used to the new files enhanced information/column order format.

And why would I want to know the details?

Because in case our tools are unavailable (e.g. not installed, database hangs completely or only operating system access is possible), then some other way of analyzing the error logs is needed: programs DIAG_PACK and PROTOCONV help to deal with such situations.

 

Some facts

Old message file format:
  • used until SAP MaxDB 7.6
  • files located in database run directory, usually: \sapdb\data\wrk\<database_name>
  • files: knldiag, knldiag.old, knldiag.err, dbm.prt, dbm.utl etc.
  • format: plain text style
New message file format: pseudo-XML:
  • only rudimentary implementation with SAP MaxDB 7.6 (coexisting with the old file format)
  • Database assistant (transaction DB50/LC10), Database Manager, Database Studio: automatic conversion to plain text within these tools since SAP MaxDB 7.7 and above
  • on operating system level: automatic conversion to plain text with DBM command diag_pack or single file conversion with PROTOCONV since SAP MaxDB 7.7.04.23
  • files located in database run directory, usually: \sapdb\data\wrk\<database_name>
  • new files KnlMsg, KnlMsg.old, KnlMsgArchive written in pseudo-XML replacing knldiag, knldiag.old and the other diag files.

 

Why pseudo-XML? Why a new message list style?

This format invented by SAP MaxDB developers supposedly is easier to read and understand for end users.
The idea was to better assist users in error situations. So, development created a new message style pseudo-XML, which would be enriched with additional information when converted to plain text. This is an important detail: The pseudo-XML files KnlMsg, KnlMsg.old and KnlMsgArchive itself do not show the full information - only after converting them, they may include further long text and possibly even advice on how to handle specific error situations.
In addition, unless you prefer reading native XML you will not enjoy the pseudo-XML files. Of course, every internet browser understands XML and displays it properly. Try our XML style with it and see it failing. This is, because pseudo-XML was never intended to be fully XML compliant. One reason is the way we have partitioned our message files in a header part written at database start followed by cyclical regular work messages. This means that the entry written at the end of file is normally not the actual last line added.
Sounds complicated? Granted, the whole procedure has become more complex and fragile, but then most work is supposed to be done automatically in background. Without database tools at hand - well, this is where the fun stops...

Comparing old and new

the following 3 text files show the same information displayed in the old format plain text and the new pseudo-XML and converted XML:

Old file layout of knldiag (used until SAP MaxDB 7.6)

plain text

2008-10-07 23:54:07     0x1364     53000 OBJECT   Restarted Garbage coll: 0
2008-10-07 23:54:07     0x1364        11 Rst      168 redo transactions readable and 64 redo tasks available.
2008-10-07 23:54:07      0x194         7 Restart  recovering log from log_volume from IOSeq: '60619'
New file layout of KnlMsg (used since SAP MaxDB 7.7)

pseudo-XML

<MSGL _NO="18476" _PROCESS="6008" _THREAD="0x1364" _TASK="69" _TIME="2008-10-07 23:54:07.397">
  <MSG _NO="1" _ID="53000" _COMP="MsgOutput" _TEXT="Restarted Garbage coll: 0">
   <MSG_ARGS
     _FILE="Msg_OutputKnlDiag.cpp"
    _LINE="407"
    _TIME="2008-10-07 23:54:07.397"
     _LABEL="OBJECT"
    />
  </MSG>
 </MSGL>
<MSGL _NO="18477" _PROCESS="6008" _THREAD="0x1364" _TASK="69" _TIME="2008-10-07 23:54:07.397">
  <MSG _NO="1" _ID="11" _COMP="Rst" _TEXT="$TASKS_WANTED$ redo transactions readable and $TASKS_AVAILABLE$
 redo tasks available.">
   <MSG_ARGS
     _FILE="Rst_RedoManager.cpp"
    _LINE="136"
    _TIME="2008-10-07 23:54:07.397"
     _MESSAGEVERSION="1"
     TASKS_WANTED="168"
     TASKS_AVAILABLE="64"
    />
  </MSG>
 </MSGL>
<MSGL _NO="18478" _PROCESS="6008" _THREAD="0x194" _TASK="153" _TIME="2008-10-07 23:54:07.397">
  <MSG _NO="1" _ID="7" _COMP="Restart" _TEXT="recovering log from log_volume from IOSeq: &apos;60619&apos;">
   <MSG_ARGS
     _FILE="Rst_LogEntryIterator.cpp"
    _LINE="138"
    _TIME="2008-10-07 23:54:07.397"
    />
  </MSG>
 </MSGL>
New file layout of KnlMsg (used since SAP MaxDB 7.7): converted

pseudo-XML converted to plain text
A big screen will certainly help in displaying all columns and finding the relevant data. Please note that I had to add some line breaks for this example to have it fit to the wiki length limit.

Thread  0x136 Task     69  2008-10-07 23:54:07     OBJECT     53000:  Restarted Garbage coll: 0
Thread  0x136 Task     69  2008-10-07 23:54:07     Rst           11:  168 redo transactions readable and 64
redo tasks available.
                                                                      DESCRIPTION:
                                                                      It may not be a problem if fewer redo
 tasks are available for a restart than
                                                                      user tasks are possible.
                                                                      However if it is a problem, then the
 parameter MAXSERVERTASKS must be increased.
                                                                      ACTION:
                                                                      The parameter MAXSERVERTASKS should be
 increased.
                                                                      If the problem remains then contact
development support.
Thread  0x194 Task    153  2008-10-07 23:54:07     Restart        7:  recovering log from log_volume from
IOSeq: '60619'

  

How to display the new message files

Using

Requires

Authorization

Additional Information

Database Studio

SAP DB connection

Database user management

automatic file conversion on display

Database Manager (discontinued)

SAP DB connection

Database user management

automatic file conversion on display

Database assistant (DB50/LC10)

R/3 connection

R/3 permission to use transaction

automatic file conversion on display

DBM command diag_pack

SAP MaxDB client installation

Database user management

creates tgz archive with all available
log files converted to plain text

PROTCONV

Operating system access
to database server

Operating system level permission

converts a single file to plain text

Database Studio:
  • automatic conversion - no further steps necessary
Database Manager:
  • automatic conversion - no further steps necessary
Database assistant (transaction DB50/LC10):
  • automatic conversion - no further steps necessary
DBM command diag_pack (fully functional since 7.7.04.23, PTS 1155615)
  • Open a DBM session and use DBM command diag_pack to convert and pack all message files automatically including rtedump (if available) and knltrace.
    Files from the diaghistory subdirectory will be used for evaluation and added to the archive, if not older than one week.
  • Example:
    dbmcli -d tz77 -u dbm,dbm diag_pack
    creates a diagpkg.tgz archive containing the following files:
     xserver_<host_name>.prt, x_server_<host_name>.old, TZ77.pah, knltrace.prt, KnlMsgArchive.txt, KnlMsg.txt, KnlMsg.old.txt, dbmsrv_<host_name>.prt, dbm.prt, dbm.ins and some optional files like rtedump or dumped pages .bad and .cor.

    Use DIAG_PACK to create a comprehensive archive of all available log files

    If you do not have any system access - just ask for a 'dbmcli ... DIAG_PACK' to be executed and have the resulting archive attached to the customer message or sent to you.

PROTCONV (fully functional since SAP MaxDB 7.7.04.23)
  • Use PROTCONV to convert a single file from pseudo-XML to plain text.
  • Example:
    protconv c:\sapdb\data\wrk\tz77\KNLMSG > knlmsg.txt (<file_type> = KNLMSG | KNLMSGARCHIVE)
    converts the pseudo-XML file KnlMsg to plain text file knlmsg.txt.

    Use PROTCONV if you have limited operating system access without graphical interface or database tools

    Converts and displays a single file to standard output unless redirected to file.

Just for completeness, here are further options

Converting pseudo-XML to plain text:

dbmcli -d a77 -u dbm,dbm -nohold file_getfirst <file_type>
dbmgetf -d a77 -u dbm,dbm -q -k <file_type>

with <file_type> = KNLMSG | KNLMSGOLD | KNLMSGARC

Converting pseudo-XML file to standardized XML:

dbmcli -d a77 -u dbm,dbm -nohold file_getfirst <file_type>
dbmgetf -d a77 -u dbm,dbm -q -k <file_type>

with <filet_ype> = KNLMSGX | KNLMSGOLDX | KNLMSGARCX

 
 
 

 

 

  • No labels