Skip to content

Instantly share code, notes, and snippets.

View mr-stringer's full-sized avatar
💭
Do a kickflip 🛹

Steven Stringer mr-stringer

💭
Do a kickflip 🛹
View GitHub Profile
@mr-stringer
mr-stringer / BackgroundRss.sh
Last active May 1, 2020 13:20
The the resident memory of non HANA processes, useful for setting the GAL
#!/bin/bash
#
# Script to figure out the non-HANA resident memory high watermark so that
# the GAL can be correctly configured
# Number of passes (minutes) to run the script for, suggest 24 hours 1440
Passes=1440
Sleep=60
HighWaterMark=0
HighWaterMarkDate=''
@mr-stringer
mr-stringer / HANA_Backup_Sizes.sql
Last active September 29, 2022 21:17
Get the size of the last full backup and the size of log backups for the last 24hours on SAP HANA. The queries do not currently calculate the size of the backup catalogue files.
SELECT
C.BACKUP_ID AS BACKUP_ID,
SUM(ROUND(TO_DOUBLE(F.BACKUP_SIZE)/1024/1024/1024, 2)) AS LAST_FULL_BACKUP_GiB
FROM
M_BACKUP_CATALOG_FILES AS F
JOIN
M_BACKUP_CATALOG AS C ON C.BACKUP_ID = F.BACKUP_ID
WHERE
C.ENTRY_TYPE_NAME = 'complete data backup'
AND
@mr-stringer
mr-stringer / hdb_datafootprint.sql
Created August 29, 2017 15:06
A single statement to calculate HANA table data footprint
SELECT
ROUND(SUM(BYTES)/1024/1024/1024,3) AS DATA_FOOTPRINT_GiB
FROM (
SELECT
(
SUM(MEMORY_SIZE_IN_TOTAL) +
SUM(MEMORY_SIZE_IN_DELTA) +
SUM(
CASE
WHEN LOADED = 'FULL' THEN '0'
@mr-stringer
mr-stringer / bkperf.sql
Last active June 14, 2017 10:52
A query to get some basic details about the performance of full data backups in HANA
SELECT
SQ.START_TIME AS START_TIME_OF_LAST_BACKUP,
ROUND(TO_REAL(SQ.SIZE_MiB),1) AS SIZE_OF_LAST_BACKUP_MB,
SQ.SECONDS AS SECONDS_ELAPSED,
ROUND(SQ.SIZE_MiB/SECONDS,1) AS MB_PER_SECOND
FROM
(
SELECT
C.UTC_START_TIME AS START_TIME,
SECONDS_BETWEEN(C.UTC_START_TIME,C.UTC_END_TIME) AS SECONDS,