SAP HANA Monitoring Views: Which M_ View Answers Which Question
This reference lists the SAP HANA 2.0 monitoring views (the M_ system views in schema SYS) that DBAs and Basis admins use most, with the key columns to select and the question each one answers. Use it to write quick SQL in HANA Studio, the SQL console of HANA cockpit or hdbsql.
| View | What it shows | Key columns | Question it answers | Scope |
|---|---|---|---|---|
M_DATABASE | Basic database information | SYSTEM_ID, DATABASE_NAME, VERSION, START_TIME | Which HANA revision is this and when did it start? | Tenant or SYSTEMDB |
M_DATABASES | All databases of the system with status | DATABASE_NAME, ACTIVE_STATUS | Are all tenants running? | SYSTEMDB |
M_SERVICES | Services per host | HOST, PORT, SERVICE_NAME, ACTIVE_STATUS, COORDINATOR_TYPE | Is the indexserver up, and which node is master? | Tenant or SYSTEMDB |
M_SERVICE_MEMORY | Memory per service | SERVICE_NAME, TOTAL_MEMORY_USED_SIZE, HEAP_MEMORY_USED_SIZE, SHARED_MEMORY_USED_SIZE, EFFECTIVE_ALLOCATION_LIMIT | How close is the indexserver to its allocation limit? | Tenant or SYSTEMDB |
M_HOST_RESOURCE_UTILIZATION | Host memory and CPU | HOST, FREE_PHYSICAL_MEMORY, USED_PHYSICAL_MEMORY, ALLOCATION_LIMIT, INSTANCE_TOTAL_MEMORY_USED_SIZE | How much physical memory is left on the host? | Tenant or SYSTEMDB |
M_HEAP_MEMORY | Heap allocators | HOST, PORT, CATEGORY, EXCLUSIVE_SIZE_IN_USE, EXCLUSIVE_ALLOCATED_SIZE | Which heap allocators are the top memory consumers? | Tenant or SYSTEMDB |
M_CS_TABLES | Column store tables and partitions in memory | SCHEMA_NAME, TABLE_NAME, PART_ID, MEMORY_SIZE_IN_TOTAL, MEMORY_SIZE_IN_MAIN, MEMORY_SIZE_IN_DELTA, RECORD_COUNT, LOADED, ESTIMATED_MAX_MEMORY_SIZE_IN_TOTAL | Which column tables use the most memory and are they fully loaded? | Tenant |
M_RS_TABLES | Row store tables | SCHEMA_NAME, TABLE_NAME, RECORD_COUNT, ALLOCATED_FIXED_PART_SIZE, ALLOCATED_VARIABLE_PART_SIZE | How big is the row store and which tables drive it? | Tenant |
M_TABLES | All tables with size and type | SCHEMA_NAME, TABLE_NAME, RECORD_COUNT, TABLE_SIZE, IS_COLUMN_TABLE | Quick list of the largest tables in a schema | Tenant |
M_TABLE_PERSISTENCE_STATISTICS | Disk size of tables | SCHEMA_NAME, TABLE_NAME, DISK_SIZE | How much disk does each table occupy (not memory)? | Tenant |
M_CS_UNLOADS | History of column table unloads | UNLOAD_TIME, SCHEMA_NAME, TABLE_NAME, REASON | Were tables unloaded because of memory pressure (REASON LOW MEMORY)? | Tenant |
M_DELTA_MERGE_STATISTICS | Delta merge history | START_TIME, TABLE_NAME, TYPE, MOTIVATION, EXECUTION_TIME, SUCCESS | Are merges failing or taking too long on a table? | Tenant |
M_SAVEPOINTS | Savepoint history | START_TIME, DURATION, CRITICAL_PHASE_DURATION, TOTAL_SIZE | Are long savepoint critical phases causing short freezes? | Tenant or SYSTEMDB |
M_LOG_SEGMENTS | Redo log segments | HOST, PORT, STATE, TOTAL_SIZE, USED_SIZE | Is the log volume filling because segments are not freed (backup or replication)? | Tenant or SYSTEMDB |
M_VOLUME_FILES | Data and log volume files | HOST, PORT, FILE_TYPE, FILE_NAME, USED_SIZE, TOTAL_SIZE | How large are data volumes and how much is used? | Tenant or SYSTEMDB |
M_DISKS | Disks used by the database | HOST, PATH, USAGE_TYPE, TOTAL_SIZE, USED_SIZE | How full are the data, log and trace file systems? | Tenant or SYSTEMDB |
M_DISK_USAGE | Disk usage by usage type | HOST, USAGE_TYPE, USED_SIZE | How much disk goes to data, log, trace and backup? | Tenant or SYSTEMDB |
M_BACKUP_CATALOG | Backup catalog entries | BACKUP_ID, ENTRY_TYPE_NAME, SYS_START_TIME, SYS_END_TIME, STATE_NAME | When was the last successful complete data backup? | Tenant or SYSTEMDB |
M_BACKUP_CATALOG_FILES | Files of each backup | BACKUP_ID, SOURCE_TYPE_NAME, BACKUP_SIZE, DESTINATION_PATH | How big was the backup and where was it written? | Tenant or SYSTEMDB |
M_CONNECTIONS | Client connections | CONNECTION_ID, USER_NAME, CLIENT_HOST, CONNECTION_STATUS, START_TIME | Who is connected and from where? | Tenant |
M_ACTIVE_STATEMENTS | Statements currently executing | CONNECTION_ID, STATEMENT_STRING, STATEMENT_STATUS, ALLOCATED_MEMORY_SIZE | What is running right now and how much memory does it hold? | Tenant |
M_EXPENSIVE_STATEMENTS | Statements over the expensive statements trace threshold | START_TIME, DURATION_MICROSEC, STATEMENT_STRING, MEMORY_SIZE, DB_USER | Which statements were slow or memory-heavy? (trace must be enabled) | Tenant |
M_SQL_PLAN_CACHE | Cached statements with execution statistics | STATEMENT_HASH, STATEMENT_STRING, EXECUTION_COUNT, TOTAL_EXECUTION_TIME, AVG_EXECUTION_TIME | Which statements consume the most total time? | Tenant |
M_BLOCKED_TRANSACTIONS | Transactions waiting for locks | BLOCKED_TRANSACTION_ID, LOCK_OWNER_TRANSACTION_ID, BLOCKED_TIME, WAITING_TABLE_NAME, LOCK_TYPE | Who blocks whom right now? | Tenant |
M_TRANSACTIONS | Open transactions | TRANSACTION_ID, CONNECTION_ID, TRANSACTION_STATUS, START_TIME | Are there long-open transactions holding MVCC versions? | Tenant |
M_SERVICE_REPLICATION | System replication status per service | HOST, PORT, SECONDARY_HOST, REPLICATION_MODE, REPLICATION_STATUS | Is system replication active and in sync? | Tenant or SYSTEMDB |
M_LICENSE | Installed license | HARDWARE_KEY, EXPIRATION_DATE, PERMANENT, VALID, PRODUCT_LIMIT, PRODUCT_USAGE | Is the license valid and how close is usage to the limit? | SYSTEMDB |
M_INIFILE_CONTENTS | Configuration parameters by layer | FILE_NAME, LAYER_NAME, SECTION, KEY, VALUE | What is global_allocation_limit or statement_memory_limit set to, and at which layer? | Tenant or SYSTEMDB |
M_LOAD_HISTORY_SERVICE | Load history per service (the HANA cockpit load graph) | TIME, HOST, PORT, CPU, MEMORY_USED, MEMORY_ALLOCATION_LIMIT | How did CPU and memory develop over the last hours? | Tenant or SYSTEMDB |
M_TABLE_LOCATIONS | Where tables are located in scale-out | SCHEMA_NAME, TABLE_NAME, HOST, PORT, LOCATION | On which node does a table live? | Tenant |
M_ views show current state since the last restart. For history, use the statistics server tables and views in schema _SYS_STATISTICS (for example HOST_SERVICE_MEMORY, HOST_HEAP_ALLOCATORS). From SYSTEMDB, schema SYS_DATABASES offers many M_ views across all tenants with a DATABASE_NAME column. Sizes are in bytes. Column lists vary slightly by SPS: confirm in the SAP HANA SQL and System Views Reference for your revision.
HANA close to its allocation limit?
Send us the output of the memory views and we will return a reviewed list of the top consumers and what to do about each.
Optional. The tool and every export work without this. No spam.
How to check HANA database size and memory
There are three different sizes and people mix them up. Memory used by the database is in M_SERVICE_MEMORY (TOTAL_MEMORY_USED_SIZE per service, against EFFECTIVE_ALLOCATION_LIMIT) and at host level in M_HOST_RESOURCE_UTILIZATION. Table data in memory is in M_CS_TABLES (MEMORY_SIZE_IN_TOTAL) and M_RS_TABLES. Data on disk is in M_TABLE_PERSISTENCE_STATISTICS (DISK_SIZE) and M_VOLUME_FILES for the volumes. A licence or sizing question usually needs memory; a storage question needs disk. Sum column store memory with SELECT SCHEMA_NAME, ROUND(SUM(MEMORY_SIZE_IN_TOTAL)/1024/1024/1024, 2) AS GB FROM M_CS_TABLES GROUP BY SCHEMA_NAME ORDER BY GB DESC.
Worked example: who are the top memory consumers
The indexserver is at 92 percent of its allocation limit. Step 1: SELECT SERVICE_NAME, TOTAL_MEMORY_USED_SIZE, EFFECTIVE_ALLOCATION_LIMIT FROM M_SERVICE_MEMORY confirms the indexserver. Step 2: M_HEAP_MEMORY ordered by EXCLUSIVE_SIZE_IN_USE descending shows whether column store tables (allocator Pool/ColumnStore) or something else, such as SQL execution or caches, dominate. Step 3: if it is tables, M_CS_TABLES ordered by MEMORY_SIZE_IN_TOTAL shows the top tables and MEMORY_SIZE_IN_DELTA reveals delta that needs a merge. Step 4: if it is execution memory, M_ACTIVE_STATEMENTS and M_EXPENSIVE_STATEMENTS show the statements; statement_memory_limit in M_INIFILE_CONTENTS shows whether a cap is set.
- Large MEMORY_SIZE_IN_DELTA: check M_DELTA_MERGE_STATISTICS
- LOADED = PARTIALLY or NO: tables unloaded, check M_CS_UNLOADS
- Repeated LOW MEMORY unloads: sizing or a runaway statement
Tenant versus SYSTEMDB
In a multitenant system each tenant's SYS schema shows only that tenant. Connect to SYSTEMDB for M_DATABASES and for licence information, and use the SYS_DATABASES schema there to query many M_ views across tenants at once with a DATABASE_NAME column. Host-level views such as M_HOST_RESOURCE_UTILIZATION show the whole host, which is shared by all tenants, so do not read host free memory as tenant free memory.
Gotchas
M_ views reset on restart; for trends use _SYS_STATISTICS. M_EXPENSIVE_STATEMENTS is empty unless the expensive statements trace is enabled with a threshold. M_SQL_PLAN_CACHE is evicted under pressure, so a statement can disappear. Sizes are bytes. Querying M_CS_TABLES on a very large system can itself take time; filter by schema. Finally, SAP provides a curated SQL statement collection (SAP Note 1969700) that builds on these views and is worth using before writing your own.
Frequently Asked Questions
How do I check SAP HANA memory usage?
Query M_SERVICE_MEMORY for TOTAL_MEMORY_USED_SIZE and EFFECTIVE_ALLOCATION_LIMIT per service, and M_HOST_RESOURCE_UTILIZATION for host-level used and free memory. M_HEAP_MEMORY breaks usage down by allocator to find the top consumers.
How do I check the HANA DB size?
For memory size of table data, sum MEMORY_SIZE_IN_TOTAL from M_CS_TABLES plus row store sizes from M_RS_TABLES. For disk size, use M_TABLE_PERSISTENCE_STATISTICS (DISK_SIZE) per table or M_VOLUME_FILES for the data volumes. The last complete backup size in M_BACKUP_CATALOG_FILES is another practical measure.
How do I see table memory usage in SAP HANA?
Select SCHEMA_NAME, TABLE_NAME, MEMORY_SIZE_IN_TOTAL, MEMORY_SIZE_IN_DELTA, RECORD_COUNT and LOADED from M_CS_TABLES, ordered by MEMORY_SIZE_IN_TOTAL descending. Partitioned tables return one row per partition, so group by table to get totals.
Where is historical HANA monitoring data?
The embedded statistics service writes history into schema _SYS_STATISTICS, for example HOST_SERVICE_MEMORY for service memory over time. M_LOAD_HISTORY_SERVICE also holds recent load history used by HANA cockpit. M_ views themselves only show current state since restart.
If you want your DBAs to ask HANA what is using memory in plain English and get the SQL behind the answer, on your own servers, we can set that up.
Related Tools
SAP HANA SQL Error Codes Reference
Searchable table of common SAP HANA 2.0 SQL error codes with the error text, typical cause, the view or trace to check first and the fix.
SAPSAP HANA Largest Tables SQL Query Generator
Generates SAP HANA SQL for the biggest tables and the usual archiving suspects, to size and reduce data before migration.
SAPSAP HANA Memory Sizing Calculator
First-pass SAP HANA memory and disk estimate from source database size, compression ratio, growth and work space, with a growth-by-year chart.
SAPSAP NetWeaver Release to SAP_BASIS and Kernel Reference
Which SAP_BASIS release belongs to each NetWeaver and ABAP Platform release, which products run on it, which kernel lines apply and how to check your own system.
More SAP tools
See all- SAP HANA Memory Usage SQL Generator (Used, Resident, Heap)
- SAP HANA Table Load, Unload and Preload SQL Generator
- SAP HANA Backup SQL Statement Generator (Data, Delta, Catalog)
- SAP HANA Disk Sizing Calculator (/hana/data, /hana/log, /hana/shared)
- SAP HANA Backup Storage and Retention Calculator
- SAP HANA Log Volume Full Time Calculator (Log Backup Outage)
- SAP HANA Table Partition Calculator (2 Billion Row Limit)
- SAP HANA Global Allocation Limit Calculator
- SAP HANA Revision and SPS Upgrade Checklist (hdblcm)
Keep exploring
Free tools
- SAP HANA SQL Error Codes ReferenceSearchable table of common SAP HANA 2.0 SQL error codes with the error text, typical cause, the view or trace to check first and the fix.
- SAP HANA Performance Health Checklist (Memory, CPU, Locks, Merges)A 36-point SAP HANA 2.0 health check where every item names the monitoring view, parameter or SAP Note to look at.
- SAP HANA Memory Sizing CalculatorFirst-pass SAP HANA memory and disk estimate from source database size, compression ratio, growth and work space, with a growth-by-year chart.
ERP fixes and how-tos
- SAP S/4HANA Standard Reports: Fiori, Embedded Analytics and CDS ViewsWhere standard reports live in SAP S/4HANA: Fiori analytical apps, embedded analytics and CDS views, with examples for sales reporting and Group Reporting in finance.
- How to Create a Material in SAP S/4HANA: MM01, Fiori and Manufacturing ViewsCreate a material in SAP S/4HANA with MM01 or the Manage Product Master Fiori app, and see which views a manufactured part needs (MRP, costing).
- Private AI for SAP Business One: Service Layer, a read replica and a local modelAdd a private AI assistant to SAP Business One: Service Layer reads, SQL Server or HANA replica, document index, local LLM, permissions and approvals.
AI on your ERP
- AI for SAP Business One, Without Sending Your Books to a Public APIAdd AI to SAP Business One without sending customer data or financials to a public API. Service Layer and DI API integration, sized for an SMB budget.
- AI for SAP Business One Inventory: Stock, Batches, Bins and ValuationPrivate AI over SAP Business One inventory: OITW stock, batches, serials, bins and valuation. Answers grounded in live data via Service Layer or SQL views.
Integrations
- How to connect Power BI to SAP S/4HANAConnect Power BI to SAP S/4HANA using the HANA connector, OData or a warehouse, set up the on-prem gateway, and build manufacturing dashboards with AI Q&A.
- How to connect Power BI to SAP Business OneConnect Power BI to SAP Business One: SQL Server or HANA direct, Service Layer OData, gateway setup, key manufacturing dashboards and natural-language Q&A.