Icono del sitio SNATIC.COM

SAP HANA: Parametrización del Servidor de Estadísticas

Que es SAP HANA Statistics Server (Servidor de estadísticas HANA), es una herramienta central para el monitoreo de la base de datos HANA que realiza las siguientes actividades:

Algunos errores se presentan en HANA cuando se rebasa un volumen muy alto en este servicio al grado que puede deshabilitarse:

Al presentar las alertas muchas de estas pueden ser consideradas, bajas, medias u altas, que pueden provocar incluso un mal funcionamiento en el sistema, existe una pequeña guía que muestra un check de los principales detalles a revisar HANA_Configuration_MiniChecks utilizando para ello métricas vía comando SQL, no todo es almacenado en el monitoreo del sistema y está disponible en SAP HANA Studio o DBACOCKPIT por lo que en ocasiones se requiere mayor detalle, la lista es un poco extensa basado en la siguiente tabla:

Check ID

Detalles

710 Open alerts (high priority)
711 Open alerts (error state)
715 Number of actions not executed as expected
717 Number of disabled actions
718 Number of relevant inactive actions
720 Events not acknowledged since >= 1800 s
730 Pending e-mails older than 3 days
740 Time since statistics server run (s)
745 Total size of statistics server tables (GB)
746 History tables with primary key
747 Number of zero entries in HOST_SQL_PLAN_CACHE
748 History of M_CS_UNLOADS collected
749 Alerts older than 42 days
750 Stat. server tables with retention < 42 days
755 Embedded statistics server used
760 Status of embedded statistics server migration
765 Log segment size of statisticsserver (MB)
770 Number of stat. server tables not on master

 

Por ejemplo utilizando SQL para la definición de alertas del servidor de estadísticas:

SELECT

/*

 

[NAME]

 

– HANA_StatisticsServer_Alerts_Definition

 

[DESCRIPTION]

 

– Definition of SAP HANA Alerts

 

[DETAILS AND RESTRICTIONS]

 

 

[VALID FOR]

 

– Revisions: all

– Statistics server type: all

 

[SQL COMMAND VERSION]

 

– 2014/04/12: 1.0 (initial version)

– 2014/05/30: 1.1 (possibility to filter ALERT_DESCRIPTION)

 

[INVOLVED TABLES]

 

– STATISTICS_LAST_CHECKS

 

[INPUT PARAMETERS]

 

– ALERT_ID

 

Alert identifier

 

55 –> Alert 55

-1 –> No restriction related to alert identifier

 

– ALERT_DESCRIPTION

 

Pattern for alert description

 

‘%secure%’ –> Show all alerts with a description containing ‘secure’

‘%’ –> No restriction of alert description

 

[OUTPUT PARAMETERS]

 

– ALERT_ID: Alert identifier

– ALERT_NAME: Short alert description

– INTERVAL: Alert check interval

– ALERT_DESCRIPTION: Description of alert

– RECOMMENDATION: Recommendations

 

[EXAMPLE OUTPUT]

 

 

ALERT_ID ALERT_NAME INTERVAL ALERT_DESCRIPTION RECOMMENDATION ALERT_TIME RATING
0 Internal statistics server problem

0

Identifies internal statistics server problem. Resolve the problem. For more information, see the trace files. You may need to activate tracing first.

1 Host physical memory usage

60

Determines what percentage of total physical memory available on the host is used. All processes consuming memory are considered, including non-SAP HANA processes. Investigate memory usage of processes.

12/04/2014 23:05


2 Disk usage

300

Determines what percentage of each disk containing data, log, backup files, and trace files is used. This includes space used by non-SAP HANA files. Investigate disk usage of processes. Increase disk space, for example by shrinking volumes, deleting diagnosis files, or adding additional storage.

12/04/2014 23:01


3 Inactive services

60

Identifies inactive services. Investigate why the service is inactive, for example, by checking the service’s trace files.

12/04/2014 23:05


4 Restarted services

60

Identifies services that have restarted since the last time the check was performed. Investigate why the service had to restart or be restarted, for example, by checking the service’s trace files.

12/04/2014 23:05


5 Host CPU Usage

60

Determines the percentage CPU idle time on the host and therefore whether or not CPU resources are running low. Investigate CPU usage.

12/04/2014 23:05


10 Delta merge (mergedog) configuration

3600

Determines whether or not the ‘active’ parameter in the ‘mergedog’ section of system configuration file(s) is ‘yes’. mergedog is the system process that periodically checks column tables to determine whether or not a delta merge operation needs to be executed. Change in SYSTEM layer the parameter active in section(s) mergedog to yes

12/04/2014 22:28


 

 

 

*/

MAP(A.ROW_NUM, 1, LPAD(A.ALERT_ID, 8), ») ALERT_ID,

MAP(A.ROW_NUM, 1, A.ALERT_NAME, ») ALERT_NAME,

MAP(A.ROW_NUM, 1, LPAD(A.INTERVAL, 8), ») INTERVAL,

A.ALERT_DESCRIPTION,

A.RECOMMENDATION,

MAP(A.ROW_NUM, 1, TO_CHAR(A.ALERT_LAST_CHECK_TIMESTAMP, ‘YYYY/MM/DD HH24:MI:SS’), ») ALERT_TIME,

MAP(A.ROW_NUM, 1, MAP(A.ALERT_LAST_CHECK_RATING, 1, ‘INFO’, 2, ‘LOW’, 3, ‘MEDIUM’, 4, ‘HIGH’, 5, ‘INFO’, »), ») RATING

FROM

( SELECT

R.ROW_NUM,

A.ALERT_ID,

A.ALERT_NAME,

A.INTERVAL,

A.ALERT_LAST_CHECK_TIMESTAMP,

A.ALERT_LAST_CHECK_RATING,

SUBSTR(A.ALERT_DESCRIPTION, (R.ROW_NUM – 1) * 100 + 1, 100) ALERT_DESCRIPTION,

SUBSTR(A.ALERT_USERACTION, (R.ROW_NUM – 1) * 100 + 1, 100) RECOMMENDATION

FROM

( SELECT /* Modification section */

-1 ALERT_ID,

‘%’ ALERT_DESCRIPTION

FROM

DUMMY

) BI,

( SELECT TOP 10 ROW_NUMBER () OVER () ROW_NUM FROM M_HOST_INFORMATION ) R,

_SYS_STATISTICS.STATISTICS_LAST_CHECKS A

WHERE

UPPER(A.ALERT_DESCRIPTION) LIKE UPPER(BI.ALERT_DESCRIPTION) AND

( SUBSTR(A.ALERT_DESCRIPTION, (R.ROW_NUM – 1) * 100 + 1, 100) != » OR

SUBSTR(A.ALERT_USERACTION, (R.ROW_NUM – 1) * 100 + 1, 100) != » ) AND

( BI.ALERT_ID = -1 OR A.ALERT_ID = BI.ALERT_ID )

) A

ORDER BY

A.ALERT_ID,

ROW_NUM

Como este existe infinidad de SQL muestra que se pueden utilizar para obtener mayor información del sistema bajo diferentes premisas.

Existen dos formas de configurar el servidor de estadísticas que son Standalone y Embedded, la primera se refiere a instalar todo de manera separada pero presenta innumerables desventajas como el hecho de incrementar los requerimientos de memoria, así como datos innecesarios históricos muy largos y no almacenar los datos importantes, además que no comparte recursos con el servidor de índices lo cual lo hace inestable. En contraparte la Embedded se incorpora en el servidor de índices con la ventaja de reducir memoria, mejorar la comprensión de datos históricos, actualización de alertas, es un prerrequisito para algunas características de SAP HANA, además la versión Standalone ha sido descontinuada y no se le dará más soporte.

El lugar donde se configuran y monitorean las alertas del servidor es la siguiente:

Un proceso sugerido que puede apoyar en mejorar varios aspectos con el servidor de estadísticas es definir el proceso de tiempo de retención de información histórica para el servidor de estadísticas, el cual limita la cantidad de días almacenados pudiendo así autodepurar el crecimiento de estos datos, para esto es importante primero verificar la cantidad de información consumida por este servicio, se puede revisar en la siguiente pantalla:

Ahora partiendo de esto verificar la configuración global para el almacenamiento de historia de estadísticas, para eso ir a Catalog->_SYS_STATISTICS->Tables y checar las tablas que tienen el sufijo GLOBAL* o HOST* y verificar el valor para snapshot_id de manera ascendente con el objetivo de identificar el valor mas viejo.



Como se observa el valor mas viejo es del dia 29/04/2015 ahora restaria verificar la configuracion de retencion de datos para cada tabla en Configuration->Statisticsserver-> Statisticsserver_sqlcommands:

O bien simplemente buscamos en filtro el parametro deseado:

Aquí en el detalle se puede notar la configuración relevante por tabla:

Si tenemos más información de la que se delimita por esta configuración el siguiente proceso es crear un procedimiento llamado SET_RETENTION_DAYS(), el cual nos ayuda a depurar y asignar el número de días a un default.

Después de crearlo solo es necesario ejecutarlo ejemplo:

CALL SET_RETENTION_DAYS(10)

Después de llamar el procedimiento y regresando a los parámetros originales se puede notar como ya se han eliminado:

De la misma forma en el detalle se nota que se asignó a 10:

Con todo esto se logra reducir la cantidad de memoria utilizada por datos viejos u obsoletos en el servidor de estadísticas.

SAP HANA: Parametrización del Servidor de Estadísticas

Salir de la versión móvil