0% found this document useful (0 votes)
70 views

SQL Commands

The document contains SQL queries to check metrics, memory usage, thread counts, and disk usage for a SAP HANA database. Queries are provided to check for disabled metrics and delta merge errors, enable disabled metrics, get thread counts by user, see top memory pool usage, top memory usage for column stores, and total data disk usage.

Uploaded by

varenyan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views

SQL Commands

The document contains SQL queries to check metrics, memory usage, thread counts, and disk usage for a SAP HANA database. Queries are provided to check for disabled metrics and delta merge errors, enable disabled metrics, get thread counts by user, see top memory pool usage, top memory usage for column stores, and total data disk usage.

Uploaded by

varenyan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

check disabled metrics---------------------------------------------------------------------------------------

select

ss.ID,

ss.STATUS,

ss.STATUSREASON,

ss.LATEST_START_SNAPSHOT_ID,

so.NAME

from "_SYS_STATISTICS"."STATISTICS_SCHEDULE" ss,

"_SYS_STATISTICS"."STATISTICS_OBJECTS" so

where ss.id = so.id

and ss.status <> 'Idle'

order by ss.id

Check delta merge errors---------------------------------------------------------------------------------------

select

from "PUBLIC"."M_DELTA_MERGE_STATISTICS"

where SUCCESS='FALSE'

Enable disabled metrics---------------------------------------------------------------------------------------

'update "_SYS_STATISTICS"."STATISTICS_SCHEDULE"

set status = 'Idle'

where status ='Disabled'

Threads by user---------------------------------------------------------------------------------------
select

HOST,

APPLICATION_USER_NAME,

count(*) as TOTAL

from "PUBLIC"."M_SERVICE_THREADS"

where IS_ACTIVE<>'FALSE'

group by HOST,

APPLICATION_USER_NAME

Total Threads by user---------------------------------------------------------------------------------------

select

APPLICATION_USER_NAME,

count(*) as TOTAL

from "PUBLIC"."M_SERVICE_THREADS"

where IS_ACTIVE<>'FALSE'

group by APPLICATION_USER_NAME

order by TOTAL desc

top pool usage---------------------------------------------------------------------------------------

select

HOST,

CATEGORY,

ROUND(EXCLUSIVE_SIZE_IN_USE/1024/1024/1024,

2) as CURRENT_SIZE_IN_GB

from "PUBLIC"."M_HEAP_MEMORY"

order by EXCLUSIVE_SIZE_IN_USE desc


Top CS memory usage---------------------------------------------------------------------------------------

select

HOST,

ROUND(SUM(MEMORY_SIZE_IN_TOTAL/1024/1024/1024),

3) as TOTAL_MEM_IN_GB

from "SYS"."M_CS_TABLES"

group by HOST

Top CS memory estimate---------------------------------------------------------------------------------------

select

HOST,

ROUND(SUM(ESTIMATED_MAX_MEMORY_SIZE_IN_TOTAL/1024/1024/1024),

3) as TOTAL_MEM_EST_IN_GB

from "SYS"."M_CS_TABLES"

group by HOST

order by TOTAL_MEM_EST_IN_GB desc

top pool usage on single node---------------------------------------------------------------------------------------

select

sum (CURRENT_SIZE_IN_GB) as TOTAL_GB

from (select

HOST,

CATEGORY,

ROUND(EXCLUSIVE_SIZE_IN_USE/1024/1024/1024,

2) as CURRENT_SIZE_IN_GB
from "PUBLIC"."M_HEAP_MEMORY"

where HOST='hostname'

order by EXCLUSIVE_SIZE_IN_USE desc )

total data disk usage---------------------------------------------------------------------------------------

select HOST,ROUND(USED_SIZE/1024/1024/1024/1024,3)as USED_SIZE_IN_TB from


"PUBLIC"."M_DISKS" where PATH='/hana/data/PB0/'

You might also like