cancel
Showing results for 
Search instead for 
Did you mean: 

Unix Scripts for SAP

Former Member
0 Kudos

Hi All,

Is that possible to write a unix shell scripts to down the sap system,listener automatically when the system reboots abnormally

Does anyone have done it??

Please help me

Thanks

Gopal

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi

for this issue you need to extend your shutdown-sequence .

Some Unix-OS support shutdown scripts , you have to check at your site .

Otherwise you could provide an user-written shutdown procedure , which could be used at your site .

<b>On shutdown :</b>

Create an marker , that shutdown procedure was at least called .

For instance create an file , that states , that shutdown was ok

touch <your_marker_file>

<b>On startup</b>

You have to wrap your startsap call on system initialization by an script

This could have the following logic

if file <your_marker_file> exists
  then
  remove file <your_marker_file>
  call startsap
fi

You should take this just as a simple sample and I could imagine some other methods to implement this issue .

But these are mostly OS or system-dependent .

Hth + best regards

dirk

Former Member
0 Kudos

hi gopal,

What you exactly mean by system reboots abnormally.

can you tell whats the problem exactly.

regards,

yatindra

Former Member
0 Kudos

Requirement is this

1. I need to have a script that should automatically start and stop sap completely whenever my OS restarts, say for example: i have a sudden power failure..when the OS is down, SAP should be down.

And OS is up, SAP should start.there should be no manual intervention to start and stop sap

So basically avoid the system crash.

Thanks

Gopal

andreas_herzog
Active Contributor
0 Kudos

why not apply a rc script with the appropriate command?

GreetZ, AH

Former Member
0 Kudos

Hi,

Yes it is definately possible.

Need to write a script and schedule it with some system parameters coming up and down. Whenever the system boots up and logs it with the message boot up successfull, the script takes the control and switches the SAP to come up.

reward points......

Former Member
0 Kudos

Hello,

You can put your scripts in /etc/rc.d/ dircetory. So whener the system reboots it refers to this directory and takes care of the scripts.

Your script will take casr that you switch from root user to sidadm user and then execute the command startsap <SID>

Reward with points( 10 if it solves your problem)

Former Member
0 Kudos

hi,

the reboot of a system can be of broadly two types.

1) done by the user

2) abrupt shutdown say due to power failure.

if you closely look at the file inittab under /etc/ you will find different files are executed for different run levels. For powerfailure also there is a script called powerfail under /etc/init.d/. with different options.

under init.d directory you can find all the scripts for different run levlels starting from rc0-rc6, halt named script , and reboot named script.

. So to solve your problem you can write a script and execute it under this files. Changing all these files are not at all recommended as any mistake can lead to a system halt state. But still we can make the changes if we know what are we doing and definitely you can try if are having a test system with you.

the logic will go something like this:-->

1) for shutdown

respawn a new shell

login as <sid>adm

execute the command i.e stopsap

exit from that user

same goes for startup also.

now only you have to run this script in the appropriate files at appropriate places(most important).

but the main problem comes when system goes down as sap system takes time to stop so you have to make your OS wait uptill that which may be a tedious task.

. the above discussion was keeping SUSE linux enterprise server in mind.

Please do not make any changes in the above mentioned file if you are running a crucial

system on that OS. try only on a test system.

revert back in case of any query..

cheers,

yatindra

null

Former Member
0 Kudos

Hi

most probably your SAP system starts up automatically after reboot and you want to avoid this after system crash , right ?

Could you please explain your request more detailed .

Best regards

dirk

Former Member
0 Kudos

Yes Dirk..you are exactly right..is there any possible way

Thanks

Gopal

former_member204746
Active Contributor
0 Kudos

yes it is possible, but you will need to buy software such as MKS toolkit and create a scheduled task in Window upon reboot.