Thursday, 7 December 2023

Kernel profile in SAP HANA

Activity 1:


The following statement starts profiling for the SYSTEM user, sets a memory limit of 1 GB, and sets a sampling interval of 2 milliseconds.




ALTER SYSTEM START KERNEL PROFILER USER SYSTEM MEMORY LIMIT 1073741824 SAMPLING INTERVAL 2; 

Activity 2:

The following statement stops profiling, saves the data for the specified call stacks into the trace directory, and then frees the memory that was used for the profiling data.

ALTER SYSTEM SAVE KERNEL PROFILER FOR CALLSTACK 'Execution::JobExecWatchdog::run','System::ProcessorInfo::getCurrentProcessorIndex' INTO CPU FILE 'cpu.dot' WAIT FILE 'wait.dot';

Activity 3:


ALTER SYSTEM STOP KERNEL PROFILER

Stops the Kernel Profiler (but does not free up the allocated memory).

<stop_profiler> ::= STOP KERNEL PROFILER [ <location> ]


Activity 4:

The following statement clears all previously collected Kernel Profiler data.


ALTER SYSTEM CLEAR KERNEL PROFILER;

Wednesday, 6 December 2023

All about HDBUSERSTORE LIST


ACTIVITY1:



hdbuserstore SET <HANASITTER1KEY> dc1-saphanad01:30044 HANASITTER1 Naveen@8977779532


<HANASITTER1KEY> - hana user store key name

dc1-saphanad01 - hostname

30044 - SQL port of tenent 

HANASITTER1 - User

Naveen@8977779532 - Password



example2:

Create a key:

hdbuserstore -i SET <key_name> <hostname>:<port>@<DB Name> <Username> <Password>

where,
key_name - Name you want to give to your key
hostname - Hostname on which DB is installed (can be localhost or ip or virtual host)
port - Port number to be used to connect to DB
Username - User for which you are creating the key
Password - Password of the above existing user
DB Name - Database name in MDC environment
Combination of hostname:port is known as environment and represented as env

Note: It's not mandatory to provide DB name while generating key but it's a good practice to prevent conflicts.

Example:
hdbuserstore -i SET X vhabcxyzdb:30213@SYSTEMDB SYSTEM hello@123





ACTIVITY2:


To delete HDBUSERSTORE KEY

hdbuserstore DELETE HANASITTER1KEY



ACTIVITY3:

List all keys

hdbuserstore list



ACTIVITY4:

Using key to login

hdbsql -U <key_name>
You can know about other possible operations using hdbuserstore -h command.



ACTIVITY5:

ListFromDir <DIR>

        List entries from a store in <DIR>.

        <DIR>       store directory from which entries to be read


ACTIVITY6:

  ChangeKey

        Generate new encryption key and encrypt passwords again.


ACTIVITY 7:

AddFromDir <DIR>

        Add entries from a store in <DIR> without overwriting existing keys.

        <DIR>       store directory from which entries to be read


-----------------------------------------------------------------------------------------------------------------------




ACTIVITY 8:



hdbuserstore -h

Usage: hdbuserstore [options] command [arguments]


Options:

  -u <USER>       perform operation for other operating system user

  -v              verbose mode, print operations done

  -i              interactive mode, ask for missing values

  -h              this help message

  -H <HOST>       assume host name <HOST>

Commands (the command name is case insensitive):

  Help

        Print help message.

  Set <KEY> <ENV>[@<DATABASE>] <USERNAME> <PASSWORD>

        Add or update a profile entry.

        <KEY>       entry key name

        <ENV>       database location (host:port)

        <USERNAME>  user name

        <PASSWORD>  password

        <DATABASE>  database name in MDC environment

  AddFromDir <DIR>

        Add entries from a store in <DIR> without overwriting existing keys.

        <DIR>       store directory from which entries to be read

  Delete <KEY>

        Delete entry with key <KEY>.

  List [<KEY> ...]

        List entries of store. The passwords are not shown.

  ListFromDir <DIR>

        List entries from a store in <DIR>.

        <DIR>       store directory from which entries to be read

  ChangeKey

        Generate new encryption key and encrypt passwords again.

---------------------------------------------------------------------------------------------------------------



Sunday, 3 December 2023

Host, Database,system,default layers, Parameters configuration in SAP HANA

 Host layer: it has the highest priority when a parameter is configured in the host layer have more      importance then Database,system,default layers.
Database layer: parameters defined here are specific to tenant database, when a parameter is configured  in the Database layer have more importance then system,default layers.
System layer:parameters defined here are for all tenant databases in one system DB, when a parameter is configured  in the system layer have more importance then default layers.

Default layer: it have least priority among all the 4 parameter layers.

Friday, 1 December 2023

run time dump file creation in SAP HANA

switch to <SID>ADM


cdpy 


h2dadm@dc1-saphanad01:/usr/sap/H2D/HDB00/exe/python_support> python fullSystemInfoDump.py --rtedump --tenant=DB9  --sets=1 --interval=1 --services=indexserver

System Info Dump created 2023-12-01 18:51:45 (UTC) with script version 2.40

Called with command line options: --rtedump --tenant=DB9 --sets=1 --interval=1 --services=indexserver


FSID of the last 7 day(s) (from date: 2023-11-24, to date: 2023-12-01)


Writing to file /usr/sap/H2D/SYS/global/sapcontrol/snapshots/fullsysteminfodump_H2D_DB9_dc1-saphanad01_2023_12_01_18_51_45.zip



----- 2023-12-01 10:51:45 Exporting runtime dump information -----

Collecting runtime dump for IndexServer on host dc1-saphanad01:30043 ...

section 3/32 done: STACK_SHORT - Short call stacks and pending exceptions of all threads

section 4/32 done: CPUINFO - CPU info

section 5/32 done: MEMMAP - Memory map

section 11/32 done: STATISTICS - Statistics data

section 12/32 done: PROCESS_INFO - Process Info

section 16/32 done: INDEXMANAGER_WAITGRAPH - Wait graph for index handles

section 17/32 done: INDEXMANAGER_STATE - IndexManager internal state

section 22/32 done: THREADS - Running threads

section 25/32 done: REGISTERED_STACK_OBJECTS - Objects on stack registered to be dumped

section 27/32 done: IPMM_MEMORY - IPMM information

section 28/32 done: MEMORY_ACCOUNTING - Memory accounting

section 30/32 done: OS_MEMORY - Operating system information about memory

done.




System information written to file /usr/sap/H2D/SYS/global/sapcontrol/snapshots/fullsysteminfodump_H2D_DB9_dc1-saphanad01_2023_12_01_18_51_45.zip

Dump created between 2023-12-01 18:51:45 and 2023-12-01 18:51:49 (UTC). Duration: 0:00:03.638853


Full System Info Dump done.


fullsysteminfodump_H2D_DB9_dc1-saphanad01_2023_12_01_18_51_45.zip

[OK]

h2dadm@dc1-saphanad01:/usr/sap/H2D/HDB00/exe/python_support> cd /usr/sap/H2D/SYS/global/sapcontrol/snapshots/

h2dadm@dc1-saphanad01:/usr/sap/H2D/SYS/global/sapcontrol/snapshots> ls -latr | grep 'fullsystem*'

total 19644

-rw-r--r-- 1 h2dadm sapsys 5417780 Sep 30  2021 fullsysteminfodump_H2D_QE7_dc1-saphanad01_2021_10_01_01_05_16.zip

drwxr-xr-x 3 h2dadm sapsys      72 Nov  5 02:19 ..

-rw-r--r-- 1 h2dadm sapsys 3098607 Dec  1 09:43 fullsysteminfodump_H2D_DB9_dc1-saphanad01_2023_12_01_17_43_53.zip

-rw-r--r-- 1 h2dadm sapsys 6173857 Dec  1 10:10 fullsysteminfodump_H2D_DB9_dc1-saphanad01_2023_12_01_18_09_25.zip

-rw-r--r-- 1 h2dadm sapsys 3082785 Dec  1 10:14 fullsysteminfodump_H2D_DB9_dc1-saphanad01_2023_12_01_18_14_43.zip

-rw-r----- 1 h2dadm sapsys 2327898 Dec  1 10:51 fullsysteminfodump_H2D_DB9_dc1-saphanad01_2023_12_01_18_51_45.zip

drwxrwx--- 2 h2dadm sapsys    4096 Dec  1 10:51 .

h2dadm@dc1-saphanad01:/usr/sap/H2D/SYS/global/sapcontrol/snapshots>