SAP HANA System Views for SQL Monitoring
SAP HANA comprises 3 types of built-in system views:
- Monitoring Views
These views are in Schema 'SYS' and can be identified by the M_ at the beginning of the view name. SAP HANA includes a set of useful runtime views called monitoring views. These views are useful for monitoring and troubleshooting SQL performance. They provide actual SAP HANA runtime data, including statistics and status information related to the execution of DML statements. At the time of writing there are 385 monitoring views. The data in monitoring views is not stored; the view is calculated when you select it. Nevertheless, the result sets can be materialized in tables if needed. Further information can be looked up in the SAP HANA SQL Reference Guide.
Examples: M_SQL_PLAN_CACHE, M_EXPENSIVE_STATEMENTS
- System Views
Main focus area is administration and system state.
System views are stored in the SYS schema. In tenant databases, each database has a SYS schema with system views that contain information focused on the tenant. System views allow you to evaluate information about the system state itself and not the application code like SQL. The System Privileges CATALOG READ or DATABASE ADMIN are needed to use them.
Examples: CS_JOIN_TABLES, EFFECTIVE_PRIVILEGES
- Embedded Statistics Service Views
Tables and views are stored in the _SYS_STATISTICS schema. It is implemented by a set of tables and SQLScript procedures in the master index server and by the statistics scheduler thread that runs in the master name server. The statistics service is continuously collecting and evaluating information about status, performance, and resource usage from all components of the SAP HANA database.
Examples: HOST_CS_UNLOADS, HOST_RS_INDEXES
M_SQL_PLAN_CACHE
The M_SQL_PLAN_CACHE view shows statistics for individual execution plans. It shows which part of the execution is dominant. For each plan in the cache, it delivers statistics from execution and technical details such as related objects and object IDs, updated objects, and much more.
M_SQL_PLAN_CACHE shows views that can be reset. This is beneficial to only see results after the point in time when it was reset.
To reset the view, execute the following statement: ALTER SYSTEM RESET MONITORING VIEW SYS.M_SQL_PLAN_CACHE_RESET;
In SAP HANA SPS07, this view has 108 columns. When you scroll with the bar at the bottom to the right, you can see more or you can choose to let the tool create the select statement on the view so as to select the information you would like to see.
M_EXPENSIVE_STATEMENTS

Expensive Statements Trace Information
If you have the TRACE ADMIN privilege, then you can view expensive statements trace information in the following ways:
- In the Expensive Statements app of the SAP HANA Cockpit
- In the Statement Library in the SAP HANA database explorer by searching for Expensive Statements Analysis
- In the M_EXPENSIVE_STATEMENTS system view
Expensive statements are SQL statements with execution times exceeding a configured threshold. The thresholds should be selected in a way that these thresholds are reached only in critical situations that are abnormal. Never set the threshold too high that it can never be reached. Threshold values could be found and fixed when testing applications. The expensive statements trace records information about these statements for further analysis and is inactive by default.
If, in addition to activating the expensive statements trace, you can also enable per statement memory tracking, the expensive statements trace will show the peak memory size used to execute the expensive statements.










