Analise High load SAP HANA

Notas:

1804811 - SAP HANA Database: Kernel Profiler Trace

Solution 
Connect to your HANA database server as user sidadm (for example via putty) and start hdbcons by typing command "hdbcons".
To do a Kernel Profiler Trace of your query, please follow these steps:
    1. "profiler clear" - Resets all information to a clear state
    2. "profiler start" - Starts collecting information.
    3. Execute the affected query.
    4. "profiler stop" - Stops collecting information.
    5. "profiler print -o /path/on/disk/cpu.dot;/path/on/disk/wait.dot" - writes the collected information into two dot files which can be sent to SAP.
Attention: Specifying both a database user and an application user with SAP HANA SPS <= 10 can result in a crash. This problem is fixed as of SAP HANA SPS 11.

1732157 - Collecting diagnosis information for SAP HANA [VIDEO]

1813020 - How to generate a runtime dump on SAP HANA 

1) From the OS Level


1) Log into the linux HANA host presenting the issue as sidadm user;
2) Run command 'hdbcons';
3) On the hdbcons console run command below:
 > runtimedump dump

This will create a runtimedump for the host you logged in. The generated file will be under traces directory with naming like 'indexserver....rtedump.trc'.
4) Attach generated trace file to the OSS Message

Na prática


  1. generate a kernel profiler trace. Please refer to SAP note 1804811

  • 1. "profiler clear" - Resets all information to a clear state
  • 2. "profiler start" - Starts collecting information.
  • 3. Execute the affected query. - in the case of our problem, it is not necessary
  • 4. "profiler stop" - Stops collecting information.
  • 5. "profiler print -o /hana/shared/SID/HDB00/serverXX/trace//wait.dot" - writes the collected information into two dot files which can be sent to SAP.


2 . generate 3 runtime dumps with 2 minutes interval between each. These must be generated DURING the system hang. Please refer to 1813020.

  • cd /hana/shared/SID/HDB00/serverX/trace/      
  • exec /hana/shared/rtedump_script.sh


3. generate a full system dump as per note 1732157 during the time frame of the high cpu.
cd /usr/sap/SID/HDB00/exe/python_support/
python fullSystemInfoDump.py
cd /usr/sap/SID/SYS/global/sapcontrol/snapshots/
ls –larth
Copy the newer files on diretory


PARA executar tudo em um comando (copiar e colar na linha de comando e lembrar de alterar serverX pelo nome correto do servidor):


hdbcons "runtimedump dump" ; hdbcons  "profiler clear" ; hdbcons   "profiler start" ; hdbcons  "profiler stop" ; hdbcons   "profiler print -o /hana/shared/SID/HDB00/serverX/trace/wait.dot" ; cd /hana/shared/SID/HDB00/serverX/trace/  ; /hana/shared/rtedump_script.sh ; cd /usr/sap/SID/HDB00/exe/python_support/ ; python fullSystemInfoDump.py

Depois da execução, proceder com a coleta, compressão e envio do arquivo para a SAP.

Executar $hdbcons "runtimedump dump"
    hdbcons  "profiler clear"
hdbcons   "profiler start" hdbcons  "profiler stop" hdbcons   "profiler print -o /hana/shared/SID/HDB00/backup/wait.dot"

verificar qual thread consome mais recursos:

top -H -u sidadm
Guardar este número para procurar nos dumps

listar threads:

ps -eLf

Executar $hdbcons "runtimedump dump"
    hdbcons  "profiler clear"
hdbcons   "profiler start" hdbcons  "profiler stop" hdbcons   "profiler print -o /hana/shared/SID/HDB00/backup/wait.dot"

Dicas LVM / TIPS and Tricks LVM



Resize com LVM
- Adicionar o novo disco e criar a partição:
  # fdisk /dev/sdb (id 8e)

- visualiza todos os lvm
  # lvdisplay

- ver LVM com:
  # vgs
  # lvs
  # pvs

- Criar PV
  # pvcreate /dev/sdb1

- Criar VG
  # vgcreate vg1 /dev/sdc1

- Criar LV
  # lvcreate -L "tamanho" -n "device" vg0

- Extendendo PV
# pvresize --setphysicalvolumesize 40G /dev/sda1 
  
- Extendendo VG
  # vgextend vg0 /dev/sdb1

- extendendo LVM
  # lvextend -L 5G /dev/vg0/opt (tamanho da partição será 5gb)
  # resize2fs -p /dev/vg0/opt

- reduzindo LVM
  # e2fsck -f /dev/vg0/opt (sempre rodar FSCK antes de realizar resize)       
  # resize2fs /dev/vg0/opt 10G (margem de 10% de segurança)
  # lvreduce -L 10G /dev/vg0/opt (tamanho da partição será 10gb)

- removendo disco do VG
  # vgreduce vg0 /dev/sdb1

- extendendo PV
  # pvresize /dev/sdb

- crescer LVM em SWAP

# swapoff -a
# lvextend -L 5G /dev/vg0/swap (tamanho da partição será 5gb)
# mkswap /dev/vg0/swap
# swapon -a