on 04-03-2007 3:39 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi gopal,
What you exactly mean by system reboots abnormally.
can you tell whats the problem exactly.
regards,
yatindra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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)
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes it is possible, but you will need to buy software such as MKS toolkit and create a scheduled task in Window upon reboot.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.