SAP HANA Memory Usage – What should I really monitor?

With so many memory areas of SAP HANA, What should I really Monitor with respect to Memory usage of HANA database?

Below picture is key in understanding the memory allocation sequence.

hanamemory

You can control the behaviour of total memory allocated to SAP HANA database by using allocation limit parameter (global.ini -> memorymanager -> global_allocation_limit)

Unless you have additional software running on the HANA server or the HANA licensed memory is less than you physical memory, global_allocation_limit need not be set.

Default value is 0 and most of the times this is not set assuming that the server will be only used by HANA database. This means HANA DB can use the complete memory of the server.

globallmt

Memory allocation in HANA Database implements a pool concept. That is, memory is pre-allocated (reserved) from the operating system for performance reasons. By default, the HANA database will allocate up to approximately 90% of the available physical memory.

This will be used for queries that will need additional space at once. This will be RESERVED and not released back to Operating System.

Hence the reserved memory does not indicate any memory issues with the database.

Key figure to be monitored is the active memory usage of the HANA database:

memused

Same has been clarified in below SAP Note:

2081473 – HANA Resident Memory : High Memory Usage

You can monitor the current usage of memory by each tenant by using below query:

SELECT * FROM “SYS_DATABASES”.”M_SERVICE_MEMORY”

tenmem

Total memory usage of the whole database can also be monitored with HANA_MEMORY_OVRVIEW (SAP Note 1969700 ).

memoverview

You can also monitor the history of total memory usage using _SYS_STATISTICS, like example below:

memusedgg

To check if the SAP HANA Memory parameters are set optimally, you can use HANA_Configuration_Parameters_1.00.70+ (SAP Note 1969700).

Important SAP Notes:

1969700 – SQL Statement Collection for SAP HANA

1840954 – Alerts related to HANA memory consumption

2175606 – HANA: How to set allocation limit for tenant databases

2081473 – HANA Resident Memory : High Memory Usage

 

Advertisements

Check your ports before you install the application

I have come across situations where it was necessary to check the ports before even installing an application to see if firewall is open or if no other application is already using the port.

Linux:

On Linux environments this can be done using command ln:

Use yum or zypper or apt-get to install the tool:

ln1

Now simulate your port and test:

nc2

Windows:

On windows I did not find a ready-made way to do the same. So designed my own, with some help from internet.

No installation required and it is version independent. Just download and run it from below link:

Simulate Port on Windows

Instructions:

Unzip the file to your desktop.

Double click to execute the file:

porttest

porttest1

If prompted allow firewall access.

porttest3

And you are ready to test.

telnetport

Once you are connected, you get a message in your simulator:

simutt

Note: After the test is done end the test process from your task manager. Otherwise the port will be kept occupied.

servvee

Stop Sybase ASE – Linux

If you want to shutdown backup server also, make sure too shut it down first, as you will not be able to login to isql if you shutdown main server first.

Login to isql to shudown the ASE database and issue command “shutdown”

shutdownbak

Then you can shutdown the ASE database instance.

shutdown

You can opt to kill the processes (For example: If you dont have password to login to isql). But this is not the most safer way. Please use this option only if you are not able to login to isql.

killase

Dont use -9 option. This might not allow uncommited DB transactions to rool back in a proper way.

 

Starting Sybase ASE Database (Linux)

Make sure you are logged in with user syb<sid>.

From the environment variables find you Sybase ASE install Directory:

path

Travesrse to the install path:

change dir

Here you see the configuration files (Runserver) RUN_<SID> (Database server) and RUN_<SID>_BS (Backup server).

Use command startserver to start each server process.

You can either start them individually or together.

  • -f runserverfile – specifies the relative path name of a runserver file, which is used as a reference each time you start an SAP ASE server or Backup Server. By default, the runserver file is in the current directory and is named RUN_servername. If you start a second SAP ASE server on the same machine, startserver creates a new runserver file named RUN_servername.
  • -m – starts an SAP ASE server in single-user mode, allowing only one system administrator to log in, and turns the allow updates to system tables configuration parameter on. Use this mode to restore the master database. The system administrator can use thedbo use only parameter of sp_dboption for system administration activities that require more than one process, such as bulk copying or using the data dictionary. startserver normally starts up only one server per node.The -m parameter creates an m_RUNSERVER file and overwrites any existing m_RUNSERVER file.

start

After both the processes are started the control is not returned back until you hit a key.

end of start

Now you can check the status of server using command showserver.

showserver

Check used port – Linux

Sometimes you might find issues starting up your SAP services, with a error that the service is not able to bind to a particular port.

In the example below, I was not able to start the SMTP service from SMICM.

icm

This mean, there could be another service that is already using this port.

Lets find out:

netstat -nepal | grep 25

icm1

Now we have the process ID. Lets see what is this process all about:

ps -ef | grep 6760

icm2

Postfix was using my service, which was not required.

Kill/Stop the service that is not required before starting your service again.

In my example:

# postfix stop 

Make sure that you disable the unwanted service from starting up next time when you reboot the server using chkconfig:

# chkconfig postfix off

Adobe Document Services – A complete guide

Below steps explain Adobe Document Services (ADS) configuration for SAP:

ADS component runs on the Netweaver JAVA stack of SAP. So you can use, JAVA stack of Solution Manager, PO/PI, Enterprise Portal etc.. to connect to any ABAP stack application for generating PDF documents.

Install ADS on a SAP NW JAVA system:

ADS is by default not installed on the JAVA instance.  You must install it manually install the same if not already installed on your SAP JAVA engine. Ensure that you install the right version for you Netweaver stack.

Please refer to blog to install the component using telnet.

Install required libraries if running on Linux:

If your JAVA application is running on Linux, ensure that you have installed the required libraries as per below SAP Notes:

2029940 – IFbA: Required additional RPM package for ADS on Linux

1956394 – Troubleshooting for ADS OS native module termination on Unix platform

If this is not done, you might receive following errors when running FP_PDF_TEST_00.

“ADS: com.adobe.ProcessingException: com.adobe.Processin(200101)”.

And you might see following errors in the NWA logs:

ads1

ads2

Create users on JAVA:

Create user ADSUSER on JAVA engine with roles SAP_ADSCALLER and SAP_ADSMONITOR.

I suggest to make this a technical user.

Create users on ABAP:

Create user ADSAGENT and assign roles ADSCALLERS, SAP_BC_FPADS_ICF and SAP_BC_FP_ICF.

Activate the required services from SICF:

ads3

Create Destination for ABAP server with name FP_ICF_DATA_<SID> from NWA.

ads4

ads5

ads6

Create RFC from your ABAP to JAVA:

Path Prefix: /AdobeDocumentServices/Config?style=rpc

ads7

ads8

You are now done with the configuration of ADS

Test your ADS configuration:

Run report FP_TEST_00 (SE38/SA38):

ads10

ads11

ads12

 

Run report FP_PDF_TEST_00 (SE38/SA38):

ads1

ads2

 

Run report FP_CHECK_DESTINATION_SERVICES (SE38/SA38):

ads3

ads4

If you get errors in any of these tests recheck your configuration. Check if any user is locked.

Additional SAP Notes for ADS configuration and troubleshooting:

1780404 – ADS problem on Solaris 11

2226341 – How to activate ADS trace in NW 7.1 and higher? [Video]

1503408 – Central Note for ADS on NW730

2420614 – IFbA: Suppress ADS error message from FP_PDF_TEST_00

1675976 – Password pop-up in ADS

1462986 – ADS Load Balancing

2029940 – IFbA: Required additional RPM package for ADS on Linux

1177315 – ADS RFC destination test return 403 / 404 / 405 code