Linux Administration, Port Architecture & Instance Numbering

Master the Linux filesystem layout, core management CLI tools (HDB start/stop/info, sapcontrol, hdbsql), instance numbering formula (00-99), and complete network port matrix for SystemDB and tenant databases.

IntermediateLinux & OS~18 min studyHANA 2.0 (All SPS)

Core Learning Objectives

  • 1.Decode the SAP HANA port calculation formula based on 2-digit Instance Number (NR).
  • 2.Understand the filesystem hierarchy (/hana/shared, /hana/data, /hana/log, /usr/sap).
  • 3.Execute database lifecycle commands safely from the Linux command line.
  • 4.Use OS diagnostics (ss, lsof, df, free, top, journalctl) to triage service blockages.
Prerequisites:hana-architecture-services-overview

Definition & Architectural Rationale

Technical Definition:

SAP HANA uses a strictly standardized port numbering scheme derived mathematically from the two-digit system instance number (00 to 99), ensuring that multiple SAP instances can coexist on a single server without port collisions.

Why this component exists:

In enterprise datacenters with firewalls, load balancers, and multi-tier SAP application architectures, understanding exact network ports and listening interfaces is essential for establishing client connectivity, configuring HSR, and diagnosing firewalled connections.

Internal Working & Mechanics

1. The Port Calculation Formula: Every port in SAP HANA follows the pattern: 3<NR><ServicePort> or 5<NR><ServicePort>. Where <NR> is the two-digit instance number (e.g. 00, 01, 10, 42). For Instance 00: - 30001: hdbnameserver internal communication port - 30002: hdbpreprocessor port - 30003: hdbindexserver internal communication port - 30010: hdbcompileserver port - 30013: SystemDB SQL client listener port - 30015: First Tenant Database SQL client listener port (Index Server) - 30040+: Dynamic SQL ports assigned to additional tenant databases - 50013: sapstartsrv HTTP SOAP port - 50014: sapstartsrv HTTPS secure port - 1128 / 1129: SAP Host Agent HTTP / HTTPS (host-level, instance independent) For Instance 02 (NR = 02): - SystemDB SQL port: 30213 - Tenant SQL port: 30215 - sapstartsrv HTTP: 50213 2. Filesystem Structure: - /hana/shared/<SID>: Binaries (exe/), instance profile (SYS/profile), HDBLCM scripts, trace history. - /hana/data/<SID>/mnt00001/: Persistent database blocks; subdivided by service (hdb00001 = nameserver, hdb00002 = first tenant indexserver). - /hana/log/<SID>/mnt00001/: Active redo log segments (typically 512 MB to 1 GB each). - /usr/sap/<SID>/HDB<NR>: Local instance directory containing symlinks to executables and instance trace directory.

Architecture Flow Diagram

Mermaid DiagramLinux Administration, Port Architecture & Instance Numbering
Architectural Flow: Port numbers are derived directly from the instance number (NR=00). SystemDB listens on 30013, default tenant on 30015, and sapstartsrv on 50013.

Linux Terminal Diagnostics & Operations

Core SAP HANA Instance Lifecycle Commands
user: <sid>adm
Provides foundational administration of the HANA instance at the operating system level.
hdbadm@host $ HDB version HDB info HDB start HDB stop

Terminal Standard Output (stdout):

HDB version:
version: 2.00.070.00.1679941421
branch:  fa/hana2sp07
compile time: 2023-03-27 19:45:00
...
HDB stop:
Stopping 5 processes...
hdbindexserver stopped.
hdbcompileserver stopped.
hdbpreprocessor stopped.
hdbnameserver stopped.
hdbdaemon stopped.
Output Analysis: HDB version prints the revision and build timestamp. HDB stop gracefully signals child services to complete active transactions and flush redo logs.
Inspect Active HANA Listening Sockets via ss
user: root
Verifies whether SystemDB (3<NR>13) and Tenant (3<NR>15) SQL listener ports are successfully bound to listening sockets.
root@host # ss -tulnp | grep -E "3[0-9]{2}(13|15)"

Terminal Standard Output (stdout):

tcp   LISTEN 0 128 0.0.0.0:30013 0.0.0.0:* users:(("hdbnameserver",pid=4812,fd=32))
tcp   LISTEN 0 128 0.0.0.0:30015 0.0.0.0:* users:(("hdbindexserver",pid=4890,fd=45))
Output Analysis: Both ports are in LISTEN state on 0.0.0.0 (all interfaces). If a port is missing, the corresponding service failed to start or is still replaying logs.
Inspect Filesystem Mounts and Free Space
user: any
Ensures data and log persistence volumes have adequate free space to prevent disk-full stalls.
$ df -hT /hana/data /hana/log /hana/shared /usr/sap

Terminal Standard Output (stdout):

Filesystem     Type  Size  Used Avail Use% Mounted on
/dev/mapper/vg_data-lv_data xfs   1.5T  620G  880G  42% /hana/data
/dev/mapper/vg_log-lv_log   xfs   512G   85G  427G  17% /hana/log
/dev/mapper/vg_shared-lv_shared xfs 500G  110G  390G  22% /hana/shared
/dev/mapper/vg_root-lv_usrsap   xfs  80G   24G   56G  30% /usr/sap
Output Analysis: Persistence mounts are formatted with XFS filesystem with healthy utilization across all volumes.

Troubleshooting & Root Cause Analysis

Production Best Practices & Operational Risks

Mandatory Best Practices

  • Always execute database maintenance commands as the <sid>adm user, never as root!
  • Never edit instance profile files under /usr/sap/<SID>/SYS/profile manually while services are running; use SAP tooling or parameter configuration files.

Senior DBA Interview Mastery

3–5 Year Experience Target

Official Documentation & SAP Notes

DBA Study Notes & Lab Observations