cancel
Showing results for 
Search instead for 
Did you mean: 

Autostart sap on Linux

Former Member
0 Kudos

Hi,

We have an SAP system mounted on a Linux machine and want to reset and start sap automatically using a script or some other way in which I did not ask for the user's password <adm>.

Do you know some method to do this?

Thanks

Regards

Accepted Solutions (0)

Answers (1)

Answers (1)

isaias_freitas
Advisor
Advisor
0 Kudos

Hello,

You would need to ensure that the database is started first.

Otherwise, applying this suggestion would not help as SAP would start and stop right away, since the database is not running.

1) Install the "sapinit" script (if not already installed) per SAP note 823941;

2) Add the parameter "Autostart = 1" (case sensitive!) to the START profiles (or instance profiles in case your system does not use START profiles).

Regards,

Isaías

Former Member
0 Kudos

Hi Isaias,

The client wants that when it is restarted the servant starts SAP (Instance+Database) automatic, by what the database has to be started also of automatic form, this serious viable? Can you indicate a procedure to me or script more detailed?

isaias_freitas
Advisor
Advisor
0 Kudos

Hello José,

In this case I believe you would have to create a custom script that starts the database first, confirms that it was started successfully (if "R3trans -d" returns 0 that is confirmed), and then starts SAP.

How to start the database will depend on which database system is in use.

I do not have such script.

Regards,

Isaías

PS: if the database is running on the same server as SAP, maybe creating a script the switches to <sid>adm and executes "startsap" would be enough?

Former Member
0 Kudos

Hi Isaias,

I create this script:

#!/sbin/sh

#

# Start SAP

su - <SIDadm> -c "lsnrctl start"

su - <SIDadm> -c "startsap"

echo "CORRECT"


But if I execute it directly it does not do anything to me, I have to do it across Linux's terminal in which he asks me for password of the user <SIDadm>, hereby if it leaves me.

But if I execute it directly it does not do anything to me, I have to do it across Linux's terminal in which he asks me for password of the user <SIDadm>, hereby if it leaves me. But what really I want is to know if it forms someone of that when I restart the servant, east SAP completely, probably it is something that it is not possible to do automatic. I have searched very much in the forums and have not found anybody who has done it.

Thanks you in advance

Regards

isaias_freitas
Advisor
Advisor
0 Kudos

Did you execute your script while you were logged on as "root"?

Former Member
0 Kudos

Yes, with the user root.

isaias_freitas
Advisor
Advisor
0 Kudos

Then, involve your Linux team, so they verify the configuration related to "su".

There is a way to configure it so it does not ask for a password (at least when already logged on as "root").

Former Member
0 Kudos


Hi Jose,

Go through the below blog this allows to sudo and start sap.

Regards,

Prithviraj.

Former Member
0 Kudos

Hi Prithviraj,

This blog already checks it, but I do not deal very well like to do it, inside the route:/etc/init.d/sap would there be necessary to add the parameters inside the file sapini and later of the parameters that already it has? Or would there be necessary to create a file in white only with these parameters?

I have tried to add it with my <SIDadm> but on having restarted the servant does not start sap.

Might it detail do it to me like in order that it works?

Thank you very much

Regards

Former Member
0 Kudos

Hi Jose,

you can check for the sapcontrol Command lines to start and check the status of the services also after  the startup.

Please find below links for same.

Starting and Stopping SAP NetWeaver Management Agents - Infrastructure of the SAP NetWeaver Manageme...

also the sapstartsrv is auto started using init.d in Linux. so it will be easy to use sapcontrol mechanism.

And use sudo su and ssh if you want to remotely do this activity.

Let us know if you need further help. and yes as mention in earlier reply you need to take help from you linux admins.

Regards,

Ram

Former Member
0 Kudos

Hi Ram,

The Linux system we have if you have the sapinit script located in the /etc/init.d route.

I applied the steps outlined in this link:

Starting and Stopping SAP NetWeaver Management Agents - Infrastructure of the SAP NetWeaver Manageme...

All Agents of the Host

If you want to start or stop all SAP NetWeaver management agents on a host, call the sapinit script with the following parameters:

sapinit stop

sapinit start

Note Note

The command sapinit stop also shuts down all instances on the relevant host, since the command is mainly used for the shutdown of the host.

In the same way, sapinit start starts the instances on the host, although only if the profile parameterAutostart=1 is set for this instance.

Depending on the type of UNIX, the sapinit start script is at the following path:

  • Linux: /etc/init.d/
  • Solaris /etc/init.d
  • HP-UX (True64): /sbin/init.d
  • AIX: /etc/rc.d/init.d

If i run sapinit stop works.

The problem I have when I start it, I first added the parameter Autosart=1 n the instance profile, but doesn´t start. The process disp+work is stopped.

Do you know if that parameter must add in all the profiles?

Thanks

Regards

Former Member
0 Kudos

Hi Jose,

Make sure you have things in place as mentioned in the below sap note..

823941 - SAP start service on Unix platforms

Regards,

Prithviraj.

former_member415846
Discoverer
0 Kudos

Hi Prithviraj,

The file path Sapinit is correct: /etc/init.d/sapinit

I have reviewed the note 823941 and all parameters are correct, but I don´t know if i have to change something but that SAP starts automatically after a reboot of the machine.

I tried to add the parameter: Autostart=1 in the instance profile, but now SAP not start and the process "disp+work" is stopped.

Thanks

Regards

Former Member
0 Kudos

Hi Prithviraj,

The file path Sapinit is correct: /etc/init.d/sapinit

I have reviewed the note 823941 and all parameters are correct, but I don´t know if i have to change something but that SAP starts automatically after a reboot of the machine.

I tried to add the parameter: Autostart=1 in the instance profile, but now SAP not start and the process "disp+work" is stopped.

Thanks

Regards

Former Member
0 Kudos

Hi Prithviraj,

The file path Sapinit is correct: /etc/init.d/sapinit

I have reviewed the note 823941 and all parameters are correct, but I don´t know if i have to change something but that SAP starts automatically after a reboot of the machine.

I tried to add the parameter: Autostart=1 in the instance profile, but now SAP not start and the process "disp+work" is stopped.

Thanks

Regards

Former Member
0 Kudos

Hi Jose,

Do you mean that start process works fine but disp+work is stopped?

If yes....than

Please check the sapstart trace/log file placed @home directory of sidadm user to see what went wrong during startup.

Also check dev_disp, dev_w* log in work direcotry.

Regards,

Prithviraj.

former_member415846
Discoverer
0 Kudos

Hi,

When I add the parameter Autosart=1 in the instance profile will not start when you restart SAP not even if I run it manually,  I had to use a backup instance profile that not have this parameter and copying it to the Profiles folder.

Whereby the problem is that the parameter does not work correctly.

I'll do it again and check the logs that you indicate.

thanks

regards

Former Member
0 Kudos

Hi,

The other thing I noticed was

The parameter Autostart=1  (careful: watch upper and lower case) should be mentioned in START profile and not in INSTANCE profile.

Regards,

Prithviraj.