Wednesday, February 17, 2016

How to enable and disable HANA Client Trace

Use hdbodbc_cons for tracing applications based on ODBC and hdbsqldbc_cons for tracing applications based on SQLDBC.

Use blow syntax

hdbodbc_cons.exe trace <level> <on/off>

Where levels are:
             api: tracing of ODBC api calls
             debug: detailed tracing of whole call stack
             sql: tracing of sql commands as well as output and parameter handling

Before you trun on trace, first configure the trace file name.
C:\Program Files\sap\hdbclient>hdbodbc_cons.exe config trace filename C:\temp\hdbodbc_trace.log

To turn on/off trace use below examples

Tracing of sql commands as well as output and parameter handling
          C:\Program Files\sap\hdbclient>hdbodbc_cons.exe trace sql on
          C:\Program Files\sap\hdbclient>hdbodbc_cons.exe trace sql off

Detailed tracing of whole call stack
          C:\Program Files\sap\hdbclient>hdbodbc_cons.exe trace debug on
          C:\Program Files\sap\hdbclient>hdbodbc_cons.exe trace debug off

Tracing of ODBC api calls
           C:\Program Files\sap\hdbclient>hdbodbc_cons.exe trace api on
           C:\Program Files\sap\hdbclient>hdbodbc_cons.exe trace api off

Reference:-
SAP Note: 1993254 - Collecting ODBC Trace
SAP Note: 1993251 - Collecting SQLDBC Trace

Regards,
Satishbabu Gunukula, Oracle ACE

SAP DBTech JDBC: [2048]: column store error: search table error

We have received following error when selection data from an reporting application.

[SAP AG][LIBODBCHDB DLL][HDBODBC] General error;2048 column store error: search table error: [1000002] exception 1000002: ltt/impl/memory.cpp:86 Allocation failed ; $size$=1573119; $name$=ihm; $type$=pool; $inuse_count$=80; $allocated_size$=109062096 exception 1000002: ltt/impl/memory.cpp:86 Allocation failed ; $size$=209664; $name$=temp_aggregates; $type$=pool; $inuse_count$=946; $allocated_size$=58136000 Unable to create extract

Sometimes you will not get complete error message in the application log. It’s always good idea to run the query in HANA studio to get the complete error.

I have ran the same query manually using HANA studio and got the below error

SAP DBTech JDBC: [2048]: column store error: search table error: [9] Memory allocation failed
If you look at the error carefully you should be able to identify that “memory allocation failed”. Normally you will see this error when there is a statement memory limit set for the application user or end user running the query.

I have increased the memory for the user using below command and the issue has been resolved.
ALTER USER <username> SET PARAMETER STATEMENT MEMORY LIMIT = <gb>

You need to identify the optimal value for you environment to avoid these errors.

To reset a statement limit use the SQL statement:
ALTER USER <username> CLEAR PARAMETER STATEMENT MEMORY LIMIT


Note that in order to enable statement memory limit you must enable STATEMENT MEMORY TRACKING IN THE GLOBAL.INI FILE.

The below parameters must be ON.
enable_tracking = on
memory_tracking = on

You should be able to view the memory consumption of a statement in M_EXPENSIVE_STATEMENTS.MEMORY_SIZE.

Regards,
Satishbabu Gunukula, Oracle ACE