SAP HANA Database Server Management Console (Hdbcons)
Topics covered
SAP HANA Database Server Management Console (Hdbcons)
Topics covered
Symptom
You are interested in details how to use the SAP HANA database console tool hdbcons.
Environment
SAP HANA
Cause
1. What is the SAP HANA database server management console?
2. Which indications exist for hdbcons issues?
3. In which contexts is hdbcons particularly useful?
4. How can hdbcons be started?
5. Where do I find an overview about available hdbcons functionalities?
6. What are the most important hdbcons functionalities?
7. How can I configure automatic executions of hdbcons commands during startup?
8. What has to be considered when using hdbcons in multitenant environments?
9. What happens in case of a hdbcons crash?
10. What are typical errors related to hdbcons?
11. How can SAP HANA threads related to hdbcons activities be identified?
12. How can I find out when hdbcons was called?
Resolution
Check ID Details
SQL: "HANA_TraceFiles_MiniChecks" (SAP Note 2380176) reports one of the following check IDs:
Check ID Details
Tool Details
Per default hdbcons will connect to the indexserver process, but you can specify the process ID of another SAP HANA p
rocess via "-p <pid>" or the name of another SAP HANA process via "-e <process_name>" (e.g. <process_name> = 'hd
bnameserver').
Starting with SAP HANA 2.0 SPS 06 calling hdbcons without any additional option will fail to connect to the indexserve
r in case the tenant name is different from the database system ID and the following error is returned (issue number 28
8374):
Try to open connection to server process 'hdbindexserver' on system '<db_system_id>', instance '<inst_
id>' and tenant '<db_system_id>'
exception 1: no.2050100 (Basis/System/SystemCall.hpp:558) TID: <tid> System call failed [generic:111]:
Connection refused
This is an intended behavior change. You can now use the new "-d" option to provide the proper tenant database name:
hdbcons -d <tenant_db_name>
SAP HANA Per default the database console isn't displayed, but you can change it via:
Studio
Window
-> Preference
-> SAP HANA
-> Global Settings
-> Show Management Console for hdbcons
Systems
-> Administration
-> Console
Attention: In multitenant environments (SAP Note 2101244) hdbcons should exclusive be used from the system datab
ase, so the Console tab will not be displayed for tenant connections.
SQL You can start certain hdbcons commands via SQL using:
<hdbcons_command> is a hdbcons command, e.g. the ones listed in "What are the most important hdbcons functionali
ties" below.
The possibility to use this procedure can be controlled with the following SAP HANA parameter (default: true, SAP Not
e 2893892):
If a certain command isn't supported on SQL level, the following error is returned:
[ERROR] exception during command processing: exception 2120012: External command savepoint not availab
le in sql
Command Details
Command SA Details
PN
ote
\< <file_name>
Read commands from file <file_name>
\> <file_name>
Write output to file <file_name>
Attention: Only a subset of internal deadlocks is recognized, semaphore waits are for ex
ample not considered
Direct connections with hdbcons may be able to succeed at the same time. Thus, try to ru
n critical analysis commands like the generation of runtime dumps with a direct hdbcons
access to the processes whenever possible.
297 This option exists with SAP HANA >= 2.00.048.02 and >= 2.00.053 and can be used to
dvol sbtouch -n <blocks>
356 mark the last <blocks> data volume superblocks per size class (4 KB, 16 KB, ...) dirty. Thi
0 s can improve the result of data volume reclaim operations.
187 Execution of data file defragmentation comparable to ALTER SYSTEM RECLAIM DATA
dvol shrink -o <overhead_pct
> 085 VOLUME <overhead_pct>
8
A standard value of 120 is suggested for <overhead_pct>, only useful if space will remain
on a lower level permanently, preferably to be executed at times of lower system load
Must not be executed on secondary system replication sites (SAP Note 1999880)
199 As of SAP HANA SPS 12 you can use this command to display the current state of index h
indexmanager list [-f <table
>] 999 andle locks. With the "-f" option you can restrict the output to a specific table name.
8
indexmanager waitgraph -w
199 Starting with SAP HANA SPS 12 you can use this command to determine dependencies f
999 or the index handle lock. This simplifies the identification of the activity responsible for t
8 he locking. The output is a ".dot" file that can be transformed into a PDF file using a com
mand like:
210 Information about available CPUs (incl. sockets) and available SAP HANA concurrency
jexec info
004
0
jexec loginfo
2119 Current state of activated job execution log
087
2119 Activation of a job execution log, a good starting point for <events_in_million> can be 3
jexec logstart -c <events_in
_million> 087 0
log backup
210 Force log backup
624
0
199 List the top contributors to the memory allocation of a specific heap allocator <allocator>
mm bl -t <allocator>
999
Only available for Pool allocators (name starting with "Pool/")
7
Attention: Crashes possible with SAP HANA <= 1.00.122.15, <= 2.00.012.04 and <= 2.
00.023 (SAP Note 2599979)
178 Generate output file with allocation stack trace information for heap allocator <allocator
mm cg -o <path_and_file>.dot
<allocator> 691 >
8
Only available for Pool allocators (name starting with "Pool/")
199
999 Attention: Crashes possible with SAP HANA <= 1.00.122.15, <= 2.00.012.04 and <= 2.
7 00.023 (SAP Note 2599979)
178 Activation / deactivation (-d) of allocator call stack trace for <allocator>
mm f <allocator> as
mm f <allocator> as -d 691
Only available for Pool allocators (name starting with "Pool/")
8
199 Memory being allocated and also deallocated during the trace isn't covered, only allocatio
999 ns without subsequent deallocations are considered.
7
199 Return free memory to the operating system ('-f' to consider also free fragments in big bl
mm gc [-f]
999 ocks)
7
Can cause significant performance issues and follow-up problems, so should only be used
if requested by SAP support
See SAP Note 1999997 ("How can I trigger a memory garbage collection?") for further de
tails.
178 Print general heap allocator list with some statistics ('-s'), sorted by total size descending
mm l -s -S -p
691 (-S) and peak usage statistics (-p)
8
199 Details for memory management structures, useful to analyze the content of heap allocat
mm level2map (SAP HANA 1.00)
mm pagetable (SAP HANA >= 2. 999 or AllocateOnlyAllocator-unlimited/FLA-UL<3145728,1>/MemoryMapLevel2Blocks
00) 7
253 Print content of monitor view <monitor_view_name> ('-h' is required for printing colum
monitor print -h -n <monitor
_view_name> 247 n names)
5
"monitor" is more complex than "statreg" (e.g. due to timestamp conversions)
247 NUMA statistics of specific table (use <part_id> = 0 in case of non-partitioned table)
numa locate <schema> <table>
<part_id> 028
9
199 Provide information about SAP HANA pages currently loaded in memory
pageaccess a [ext] [d]
999
Optional parameters:
7
ext: Extended output
d: Consider all pages on disk, not only the ones loaded into memory; Attention: ve
ry high runtime because pages have to be loaded from disk for inspection
Attention: Crashes possible with SAP HANA <= 1.00.122.15 (SAP Note 2616088)
237 Make sure that all row store pages are written to persistence when next savepoint is exec
pageaccess touch row
016 uted (SAP HANA >= 1.0 SPS 12)
0
257 Touch an individual memory page (SAP HANA >= 1.0 SPS 12) so that the next savepoint
pageaccess touch <hex_pageno
> 731 flushes it to disk, not limited to row store tables
4
280 Start a kernel profiler trace, different filter options are available:
profiler start [--cs <db_use
r>] [--ca <app_user>] [--cc 003
--cs <db_user>: Database user name
<conn_id>] [--ch <statement_ 0
--ca <app_user>: Application user name
hash>] --cc <conn_id>: Connection ID (SAP HANA >= 2.00.020)
--ch <statement_hash>: Statement hash (SAP HANA >= 2.00.030)
profiler stop
280 Stop a kernel profiler trace
003
0
199 List of existing read write locks including unused ones that aren't reported via M_READ
readwritelock l
999 WRITELOCKS
7
Attention: Output can be huge (several GB).
savepoint execute
222 Trigger a savepoint
8171
237
016
0
199 Analyze SAP HANA snapshot (<snapshot_id> can be retrieved via "snapshot l")
snapshot a <snapshot_id>
988
0
199 Delete SAP HANA snapshot (<snapshot_id> can be retrieved via "snapshot l")
snapshot d <snapshot_id>
988
0
210
000
9
199 List SAP HANA snapshots
snapshot l
988
0
240 List available statistics / monitoring views (to be printed via "statreg print" or as part of t
statreg list
000 he [STATISTICS] section of runtime dumps)
7
200 Print content of monitor view <monitor_view_name> ('-h' is required for printing colum
statreg print -h -n <monitor
_view_name> 000 n names)
0
"statreg" is more lightweight than "monitor" and provides raw statistical data
Attention: This command can result in a service crash with SAP HANA 2.00.040 - 20.0
0.042 (SAP Note 2845208).
222 Print mutex information including inactive mutexes that aren't part of M_MUTEXES or
statreg print --all -h -n M_
MUTEXES 2110 M_MUTEXES_
200 Reset a monitoring view (comparable with "ALTER SYSTEM RESET MONITORING VIE
statreg reset -n <monitor_vi
ew_name>_RESET 000 W <monitor_view_name>_RESET")
0
188 Persist preload information based on columns currently loaded in memory ('-s' for synch
tablepreload w [-s]
908 ronous write)
1
210
795
9
212
745
8
The following kind of message is printed in the SAP HANA database trace (SAP Note 238
0176):
209 Forced deactivation of a trans token (SAP HANA <= 2.0 SPS 03, M_TRANSTOKEN_DI
transaction d <trans_token>
(SAP HANA <= 2.0 SPS 03) 219 RECTORY_.TRANS_TOKEN_ID) or consistent view including related trans token (SAP
6 HANA >= 2.0 SPS 04, M_CONSISTENT_VIEW_STATISTICS_.ID)
transaction d <consistent_vi
Attention: Can result in instabilities in case a still required trans token is deactivated
ew> (SAP HANA >= 2.0 SPS 04)
Attention: Can result in indexserver crashes with SAP HANA <= 2.0 SPS 03 (SAP Note
2858546)
7. How can I configure automatic executions of hdbcons commands during startup?
For some reasons it can be useful to execute hdbcons commands as initial part of the SAP HANA startup, e.g. in order to
activate specific traces. This can be achieved with the following SAP HANA parameter setting:
Be aware that special characters like commata have to be quoted with a backslash.
Example: (activation of memory fencing, SAP Note 2222276)
cons.crashdump.<timestamp>.trc
See SAP Note 2177064 for more information related to SAP HANA crashes.
Error Details
Calling hdbcons with is terminated with this error in the following scenarios:
Could not open connecti
on to server process A non-existing process ID is specified with the "-p <pid>" option
Non "-p <pid>" is used and the indexserver can't be contacted via socket
The second scenario typically happens when (at least temporarily) two indexserver processes were st
arted on the same node. In this case the following messages are printed to the database trace (SAP N
ote 2380176) of the indexservers that were started while another indexserver was already running:
As a workaround you have to call hdbcons with the explicit “-p <pid>” option. After a stop of SAP HA
NA and a restart of a single indexserver process this problem scenario is fixed.
For security reasons hdbcons is only allowed to write to specific directories, e.g. /tmp or the SAP HA
[ERROR] Write access fo
r file with name '<path NA trace directories. In case of other destinations this error message is written. You can display the v
_and_file> is prohibite alid output directories via hdbcons option 'output l'. A typical result looks like:
d.'
# Directory valid device id inode
0 /tmp true 2049 129860
1 /usr/sap/<sid>/home true 2049 650533
2 /usr/sap/<sid>/HDB01/work true 65024 6504259795
3 /usr/sap/<sid>/HDB01/<host> true 65024 66980829
4 /usr/sap/<sid>/HDB01/<host>/trace/DB_<sid> true 65024 63347734
The path can either be specified as absolute path (starting with "/") or as relative path. In case of a rel
ative path, it is relative to the SAP HANA trace directory path. In some cases relative paths don't wor
k (issue number 321727). In this case you can use an absolute path as a workaround.
11. How can SAP HANA threads related to hdbcons activities be identified?
Depending on the scenario and the SAP HANA Revision level the type and method of a SAP HANA thread is one of the
following when hdbcons commands are executed (SAP Note 2114710):
Request core/ngdb_console
Request ngdb_console
JobWorker ServerJob
Appro Details
ach
Thread You can check the historic thread samples (e.g. using SQL: "HANA_Threads_ThreadSamples_FilterAndAggregation", SA
sample P Note 1969700) as described in "How can SAP HANA threads related to hdbcons activities be identified?" in order to check
s for the thread types / thread methods related to hdbcons executions.
Trace f Starting with SAP HANA 2.0 SPS 03 dedicated service trace files are written that track all hdbcons calls including paramete
iles rs, execution timestamp and duration:
<service>_<host>.<port>.hdbcons.trc
Example:
Keywords
SAP HANA hdbcons administration management console
# Directory valid device id inode0 /tmp true 2049 1298601
/usr/sap/<sid>/home true 2049 6505332 /usr/sap/<sid>/HDB01/work true 65024
65042597953 /usr/sap/<sid>/HDB01/<host> true 65024 669808294
/usr/sap/<sid>/HDB01/<host>/trace/DB_<sid> true 65024 63347734
Products
Products
2814623
2452123 HAN-DB hdbcons runtimedump dump -f [ERROR] Write access for file with name ... is prohibited
2313619 HAN-DB- How-To: Generating and Evaluating SAP HANA Call Stacks
MON
2106240 HAN-DB-PER HANA persistence startup error: ForceLogBackup - command already active
1999020 HAN-DB How-To: SAP HANA Troubleshooting when Database is no longer accessible
2910004 HAN-DB Increase Disk Usage After Performing DDL Operation on Table With Packed LOB Column
2845208 HAN-DB indexserver crash when run "hdbcons 'statreg print -h'" command in OS level
2532475 HAN-DB Long Startup Time Due to Long Running Garbage Collection
3217547 HAN-DB "Cannot connect with process PID" error while connecting with SAP HANA database console tool
hdbcons
2817438 HAN-DB- How to check memory usage on secondary site in HANA system replication scenario
MON
2784291 HAN-DB How to generate runtime dumps for a specific HANA service from command line
2399979 HAN-DB- How-To: Configuring automatic SAP HANA Data Collection with SAP HANASitter
PERF
2313619 HAN-DB- How-To: Generating and Evaluating SAP HANA Call Stacks
MON
1999020 HAN-DB How-To: SAP HANA Troubleshooting when Database is no longer accessible
2857855 HAN-DB Crash With Exception "Wrong savepoint version: Expected XXXX but found XXXX"
2743294 HAN-DB System not Responsive due to High Memory Consumption Causing Deadlocks in Handling NO
LOGGING RETENTION Tables
2701292 HAN-DB-HA Impaired System Replication When Having Network Issues and OOM on Primary Site Simultaneously
2637781 HAN-DB SQL Query Fails With "Data receive failed [Connection reset]", Indexserver Reports Error "close
channel while sending reply message"
2576669 HAN-DB-HA Increasing Log Volume Size on Secondary Site of a Multitier System Replication Setup With Operation
Mode Logreplay