cancel
Showing results for 
Search instead for 
Did you mean: 

Shell script for stopping SAP

Former Member
0 Kudos

Dear gurus,

I'm writing the shell script to stop SAP:

su - mhdadm;

stopsap;

when i execute, the script only successfully logon as user mhdadm, and not stopping the sap.

please enlight me..

Thanks for your help.

Best regards,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

su - mhdadm;

stopsap;

Above method will not work. You can use below command to execute as <sid>adm user.

Run this command or script as a ROOT...

su - mhdadm -c "stopsap"

( su - <user_name> -c "command_to_execute" ) should be on same line...

Just test it...

Regards.

Rajesh Narkhede

Former Member
0 Kudos

Thanks much Rajesh, that script's my salvation.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Bobby,

Get the udpate version of stopsap from service.sap.com. Might be you are using old stopsap script.

Also try to start the sap after going to actual path of stopsap script. For that login with sidadm user and use cdexe command

Regards,

Kamal