MENU

Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Sunday, February 14, 2016

Deadlock detector graph in HANA

Please collect a deadlock detector graph .

This can be done via hdbcons -

hdbcons "deadlockdetector waitgraph -o {filename}"
hdbcons "deadlockdetector waitgraph -w -o {filename}"


You need to specify the full path for like /tmp/waitgraph.dot or /tmp/waitgraph_with_w.dot.

Tuesday, February 2, 2016

Binary export of a table in HANA



Here , I Explained about how to get the Binary export of a table in HANA Database using export utility.

Case Study : Binary export of the table from System SID !!!!

      Binary export for the Single table .

      export "Schema_Name"."Table_Name" as binary into 'PATH_DETAIL' ;

      Example:

      export "HANADBXY"."/1XT/D140/SID" as binary into xyz/HDB/BACKUP/;

      Binary export for  More then One tables at a time 

      export hanadbxy."SRIT_SEQ" "MSG", hanadbxy."SRIT_SEQ" "SEQ", hanadbxy."SRIT_MAP" as binary into xyz/HDB/BACKUP/ ;

      Compress Binary Export 

      Compress directory into a single file, e.g.

      tar czvf export.tgz export_dir_on_server

How to get the metadata of a table in HANA



Here , I Explained about how to get the metadata of a table in HANA Database using export utility.

we can export the table as CSV and the metadata is created in one of the files.

export HANADBXY."AA05B" AS CSV INTO '/hana/shared' WITH CATALOG ONLY

export HANADBXY."AA05B" AS CSV INTO 'xyz/hana/shared'

how to check alerts in HANA database



Here, I Explained about how To check status of alerts on HANA database using the following sql, the status should be IDLE , if the status is DISABLED the alerts won't run the next scheduled time

select * from _sys_statistics.STATISTICS_SCHEDULE;

if status DISABLED then To enabled the status of alerts back to Idle from DISABLED use as below 

update _sys_statistics.statistics_schedule set status='Idle' where status='Disabled';

how To check the count of alerts generated and accumulated for email processing check :

select count(*) from "_SYS_STATISTICS"."STATISTICS_EMAIL_PROCESSING";

Case Study - Suppose , we had 500000 emails accumulated which crashed the index server and thus had to truncate the email processing table as :

truncate table "_SYS_STATISTICS"."STATISTICS_EMAIL_PROCESSING";

how To check the email recepients on HANA database for alerts 

select * from "_SYS_STATISTICS"."STATISTICS_EMAILRECIPIENTS"

how To check the threshold values for each alerts on HANA database

Select * from  "_SYS_STATISTICS"."STATISTICS_ALERT_THRESHOLDS"

how To check the SMTP configuration for HANA database alerts

select * from   _SYS_STATISTICS.STATISTICS_PROPERTIES

how to check Memory Usage in HANA



Here, I explained about how to check Memory Usage detail in hana database using sql queries.

1- How to find out the top 100 memory usage in HANA database between a specified date and time .

select top 100 round(TOTAL_MEMORY_USED_SIZE/1024/1024/1024, 2) as
"Used Memory GB", HOST, SERVER_TIMESTAMP  from _SYS_STATISTICS.HOST_SERVICE_MEMORY where SERVER_TIMESTAMP between '14.04.2016 08:00:00' and '16.04.2016 16:00:00' order by TOTAL_MEMORY_USED_SIZE desc

2- How to check the peak memory usage .

select top 1 HOST, SERVER_TIMESTAMP, round(TOTAL_MEMORY_USED_SIZE/1024/1024/1024, 2) as "Used Memory GB" from _SYS_STATISTICS.HOST_SERVICE_MEMORY where SERVICE_NAME = 'indexserver'
order by TOTAL_MEMORY_USED_SIZE desc

3- How to find the schema name, current memory usage, max memory usage (if all tables and all their columns were loaded into memory simultaneously) and record count in each schema .

select schema_name, round(sum(memory_size_in_total/1024/1024/1024),1) as "Current MEM GB",
round(sum(estimated_max_memory_size_in_total/1024/1024/1024),1) as "MAX MEM GB",
sum(record_count)  from "SYS"."M_CS_TABLES"  group by schema_name  order by "Current MEM GB" desc

4- How to get the total table count in a schema.

SELECT  count(*) "TABLE_NAME" FROM "SYS"."M_TABLES" where "SCHEMA_NAME" = 'SAPHP'

5- How to get the total memory usage of a schema .

For column tables -

SELECT TABLE_NAME AS "Table",sum(round(MEMORY_SIZE_IN_TOTAL/1024/1024, 2)) as "MB" FROM  M_CS_TABLES WHERE SCHEMA_NAME = 'HANADBXY'

For Row tables -

select round(sum(USED_FIXED_PART_SIZE + USED_VARIABLE_PART_SIZE)/1024/1024) as "Row Tables MB Used" from M_RS_TABLES where "SCHEMA_NAME" = 'HANADBXY'