Register Login

SAP HANA Database Trace Interview Questions and Answer

Updated May 18, 2018

SAP HANA Database Trace FAQ's

Q-1 What is the structure of HANA database trace?

Ans) The trace entries have the following structure:

[<thread_id>]{<connection_id>}[<transaction_id>/<update_transaction_id>] <date> <time> <trace_level> <component> <source_file> : <message
Example:

[24294]{-1}[164/215452358] 2016-10-10 12:20:39.296454 i TraceContext TraceContext.cpp(00878) : UserName= ...

Q-2 Different trace levels of the database trace?

Ans) Below are the following trace levels (<trace_level>) which exist for the database trace:

Trace level Trace level long Details
d debug Debugging information, mostly not gets activated per default.
i info Information, such as about database actions like log switches.
w warning Warning about less critical misconfigurations and issues
e error Potentially critical problems
f fatal Highly critical problems

Q-3 Define SAP HANA database trace?

Ans) A SAP HANA database trace is operating system trace where all important information about states, actions and problem situations is stored. It is meant to be evaluated by SAP support, but also help administrators to understand the database internal structure.

SAP HANA database trace gets activated per default therefore doesn't need to be activated explicitly

Q-4 What other trace types are based on HANA database trace?

Ans) The following trace types are based on HANA database trace and follow same mechanisms to that of the database trace:

  • Alert trace
  • User-Specific Trace
  • End-to-End trace

Q-5 What is the stored location of SAP HANA database trace?

Ans) HANA database trace is written to service specific files on operating system level.

Below is the location of trace directory:

/usr/sap/<sid>/HDB<inst>/<host>/trace

Below are the following naming convenction of the database trace files:

<service>_<host>.<port>.<counter>.trc

These files can be accessed by user either directly on operating system level or in the following ways given below:

SAP HANA Studio -> Administration -> Diagnosis Files
DBACOCKPIT -> Diagnostics -> Diagnosis Files

Q-6 What is the nameserver_<host>.00000.counter.trc trace file?

Ans) The trace file nameserver_<host>.00000.counter.trc with the '00000' port is related to direct accesses of the hdbnsutil tool to the nameserver.

Q-7 How to configure database trace?

Ans) User can adjust the database trace according to his need is following ways:

SAP HANA Studio -> Administration -> Trace Configuration -> Database Trace
DBACOCKPIT -> Configuration -> Trace Configuration -> Database Trace

Or user can influence the database trace by directly modifying parameters in the [trace] section (of global.ini or specific services like indexserver.ini):

Parameter Default Details
<component> = <trace_level> individual


Set trace for component <component> to a dedicated trace level <trace_level>

Example: (set trex_qo trace to debug level)

indexserver.ini -> [trace] -> trex_qo = 'debug'

ALTER SYSTEM ALTER CONFIGURATION ('indexserver.ini', 'SYSTEM') SET ('trace', 'trex_qo') = 'debug'

maxfiles = <num_files> 10 Number of concurrently available trace files, when a new trace file exceeds this limit, the oldest trace file is automatically dropped
maxfilesize = <byte> 10000000 Number of concurrently available trace files, when a new trace file exceeds this limit, the oldest trace file is automatically dropped.

Is it possible to evaluate the content of the database trace files ?

By directly looking into the trace file for seeing what actually happened around that time, as this helps in analyzing a specific issue (e.g. a termination). The following approach can be used for a SQL interface to the database traces, in case a larger time frame needs to be scanned. 

Monitoring view M_MERGED_TRACES

SQL: "HANA_Tracefiles_Content" (SAP Note 1969700)
SQL: "HANA_Tracefiles_Content" allows flexible filtering and aggregation 

What does the nameserver_<host>.00000.counter.trc trace file refer to?

The trace file with the '00000' port refers to the elated to direct accesses of the hdbnsutil tool to the nameserver.

What are the other trace types, which are based on the database trace?

Quite similar to the database trace, the alert trace, user-specific trace and end-to-end trace use the same mechanisms.

How can the database trace be eliminated?

A kind of automatic purge of old files exist, because of the trace file rotation. Incase you want to clearly purge the trace files older than certain amount of days, then you can utilize the SAP HANACleaner (SAP Doc 2399996) or manullay perform a cleanup on file system level or via ALTER SYSTEM REMOVE TRACES.


×