Skip to Content
Author's profile photo Adam Csaba Goetz

Autostart database and SAP on Linux

I recently tested some solutions / workarounds how to start the database and SAP automatically during boot.

Way 1

Add Autostart = 1 in startup profile. The parameter is CaSe sensitive, it begins with an uppercase A. Startup profile is the one which has Start_Program_<xx> or Restart_Program_<xx> entries. If you have any other database than HANA, it will start both the database and SAP.

Way 2

This is for SAP systems with HANA database. In this case HANA may have an own SID different from SID of SAP.

Create /etc/init.d/after.local file with content


su – <HDBSID>adm -c “/path/to/HDB start”

su – <SAPSID>adm -c “/path/to/startsap”

The after.local script will be run after all the run levels have completed.

In my test system HA0 is the HANA SID and N75 is the SAP SID and after.local looks like following:

HOST:~ # cat /etc/init.d/after.local


su – ha0adm -c “/usr/sap/HA0/HDB00/HDB start”

su – n75adm -c “/usr/sap/N75/SYS/exe/uc/linuxx86_64/startsap”

It must have execute permission for root:

HOST:~ # ls -al /etc/init.d/after.local

-rwx—— 1 root root 118 Jul 25 14:25 /etc/init.d/after.local

Give it a try.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo nivedita sadananda
      nivedita sadananda

      Hi Adam,

      Way 2 :

      It does not validate your database status, meanwhile your HANA database is coming up the scripts jumps to start the sap application.

      After later point of time only hana database comes up only not the sap application.

      Author's profile photo Cedrick Dejarme
      Cedrick Dejarme

      only Hana database is UP not the application