Hana -Cleanup of Logs/Traces
- Cleanup of backup catalog entries
- Cleanup of trace files
- Cleanup of SAP HANA alerts
- Cleanup of Dumps
SELECT T3.DESTINATION_PATH CATALOG_FILE_NAME,
T3.DESTINATION_TYPE_NAME FILE_TYPE,
TO_CHAR(TO_DECIMAL(T3.CATALOG_SIZE_MB,10,2))||' MB' CATALOG_SIZE,
TO_CHAR(T4.OLDEST_BACKUP_DATE,'YYYY/MM/DD HH24:MI:SS') OLDEST_BACKUP_DATE,
LPAD(T4.OLDEST_BACKUP_DAYS,18) BACKUP_RETENTION_DAYS,
TO_CHAR(CURRENT_TIMESTAMP,'YYYY/MM/DD HH24:MI:SS') ANALYSIS_TIME
FROM (SELECT TOP 1 T2.DESTINATION_PATH,
T2.DESTINATION_TYPE_NAME,
T2.BACKUP_SIZE / 1024 / 1024 CATALOG_SIZE_MB
FROM M_BACKUP_CATALOG T1,
M_BACKUP_CATALOG_FILES T2
WHERE T1.BACKUP_ID = T2.BACKUP_ID
AND T2.SOURCE_TYPE_NAME = 'catalog' AND T1.STATE_NAME = 'successful'
ORDER BY T1.SYS_START_TIME DESC ) T3,
(SELECT MIN(SYS_START_TIME) OLDEST_BACKUP_DATE,
DAYS_BETWEEN(MIN(SYS_START_TIME), CURRENT_TIMESTAMP) OLDEST_BACKUP_DAYS
FROM M_BACKUP_CATALOG
) T4
Output:
Trace and logs location -> /usr/sap/SID/HDB00/hostname/trace/DB_SID
-> This location contains :
- trace files of executed, expensive, load and unload statement traces etc..
- Alerts (zip) compressed files
- Dumps (rte..ooo dumps, crash dumps....)
Types of files mostly required cleanup?
- Trcae files
- Alerts
- Dumps (runtimedumps, crashdumps, oom dumps )
1.How to configure HANA log/trace file rotation/cleanup?
A: Trace file (.trc) rotation using parameters maxfiles (number of files, typically 10) and maxfilesize (size of each file, typically 10 MB). When all files are written, the first one will be removed and a new, empty one is created.
2.The parameter global.ini -> [trace] -> maxalertfilesize defines the maximum size of alert files (default: 50 MB). When the configured size is reached, the file is compressed (including a timestamp in its name) and a new file is written from scratch.
Note : Alert files and dumps are not part of the trace file rotation/cleanup configured via parameter maxfiles.
- Alert files are zipped after reaching the size configured in maxalertfilesize.
- Dumps (runtimedumps, crashdumps, oom dumps) are not part of any trace rotation.
How to automate cleanup using Hana cleaner ?
https://elrincondeosalla.blogspot.com/2018/06/how-to-configuring-automatic-sap-hana.html
Comments
Post a Comment