Skip to Content

Most of the time adding Autostart = 1 in the profile does not start SAP on reboot and DB doesnt stop when the machine reboots.

Here are few simple steps/scripts to Start/Stop SAP DB and Netwaver on Reboot.

Starting DB at boot is simple and it works perfectly.

Add Autostart = 1 in in the profile. You can find the DB profile at /usr/sap/DB1/SYS/profile/DB1_HDB00_<Hostname>


Below script Stops DB and SAP while going for Boot and Starts SAP once R3trans connection is successful. Copy the below script in /etc/rc.d (I am using SLES) and run chkconfig sapstart on – to start the serverice at startup


#! /bin/sh

# SAP startup script – sapstart

### BEGIN INIT INFO

# Provides: sapstart

# Required-Start: $ALL

# X-UnitedLinux-Should-Start:

# Required-Stop:

# Default-Start: 3 5

# Default-Stop: 0 1 2 6

# Short-Description: Start SAP

# Description: Startup of SAP

### END INIT INFO

. /etc/rc.status

PATH=/sbin:/bin:/usr/sbin:/usr/bin; export PATH

# Reset status of this service

rc_reset

case “$1” in

    start)

                test=””

while [[ $test -eq “” ]]; do

test=`su -s /bin/csh -l as1adm -c “cd /home/as1adm;R3trans -d ” | grep 0000`

echo “result-” $test

sleep 30

                         done

        echo “starting SAP”

su -c /usr/sap/AS1/SYS/exe/uc/linux/startsap as1adm

     # Remember status and be verbose

     rc_status -v

     ;;

    stop)

        echo “stopping SAP …”

        su -c /usr/sap/AS1/SYS/exe/uc/linux/stopsap as1adm

        sleep 60

        echo “Stopping DB …”

        cd /hana/shared/DB1/HDB00

        sudo -u db1adm ./HDB stop

     # Remember status and be verbose

     rc_status -v

     ;;

    *)

     echo “Usage: $0 {start|stop}”

     exit 1

     ;;

esac

rc_exit




To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply