# Getting age of tracefiles in SAP HANA database

SAPSAP HANASAP Basis

In SAP HANA database, you have diagnosis files include log and trace files, a mixture of other diagnosis, error, and information files.These files can be checked for diagnosis to find errors in SAP Hana database.

In HANA db, you have trace files stored separated per host, so to get access to the trace files of a multi-node system you have to check for each host individually.

To find the location of trace files in SAP HANA you can run the following SQL statement −

SELECT* FROM M_DISKS WHERE USAGE_TYPE ='TRACE';

To access tracefiles using the command line, you can use cdtrace as below −

You can check details of these files using HANA Studio → Administration tab

You can also try something like this −

SelectFILE_NAME, SECONDS_BETWEEN(FILE_MTIME , CURRENT_TIMESTAMP) AS Age from M_TRACEFILES
Published on 14-Dec-2017 11:02:27