IBM Support

db2trc fails with "Unexpected error: Trace buffer size is too small"

Technical Blog Post


Abstract

db2trc fails with "Unexpected error: Trace buffer size is too small"

Body

 

db2trc with any options may fail with following error sometimes (even after selecting higher buffer size): 

 

 

"Unexpected error: Trace buffer size is too small”.

 

This might occur more often when trying to run db2trc on a db2 cli client. 

 

 

 

db2trc buffer allocation : 

It will be allocated on db2start or when "db2trc on” command is run it will allocate trace buffer if it has not been created yet.  When a new trace buffer is being created, the size can be determined if  the trace buffer size is specified by -i or -l option in db2trc on command, or by setting DB2TRC_DEF_BUFFSIZE environment var;  if neither of this is set, it will use the default buffer size. 

 

 

Solution options:

 

1> The first option to try is to remove all shared memory segments by recycling the db2 instance :

db2stop (force)

db2start

Optional : ipclean if required.

This will to make sure the trace shared memory segment be re-created and re-intialized.  Recycle will fix 

almost all such cases. 

 

2> If there was a recent upgrade then try to update the instance from install path for this instance. 

  ./db2iupdt <instance> 

 

3> Check if the db2trc tool is installed and available : 

    i> Check where the db2trc tool is present (default outputs included) : 

    $ which db2trc

    /home/xxxxx/sqllib/adm/db2trc

    ii> Go to that directory :

    $ cd /home/xxxxx/sqllib/adm/ 

iii> Get “ls -l” on db2trc location to check its ownership and permissions : 

$ ls -l | grep -i “db2trc"

-r-sr-s--x    1 xxxxx  build       7504075 Sep 01 19:26 db2trc

iv> Try to start trace from here : 

db2trc on

If this works, contact your OS admin to make sure the tool is accessible by including this in environment path. 

 

 

 

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

UID

ibm13285909