Windows scripts to simplify start, stop, restart SAP and its Oracle RDBMS

Hi All,

In this post, I’m gonna share my handy scripts I developed to simplify (on-click) to start SAP, to shutdown SAP in Windows environment.

As I shared in my previous post, I installed SAP in my netbook with a limited CPU and RAM. Since at that time, my netbook is used for other activities (like for surfing the internet, editing Word and Powerpoint documents for my family, etc), it has to run on its top speed after I install SAP and Oracle RDBMS in it, while SAP is shut down.

So, to achieve this, I disabled all Services related to SAP and Oracle RDBMS (in Windows Services Control Panel). The goal is to have them in shutdown state whenever the netbook starts up, and keep them in shutdown state until I run my script to start SAP. I also developed another scripts, to shutdown everything (processes & services) related to SAP and Oracle RDBMS, in one-click, to free everything up when I stop using SAP in my netbook.

With this scripts, start and shutdown SAP is simply in one-click, and they keep your machine resources (CPU and RAM) optimally used. SAP and Oracle RDBMS processes and services only up when needed, and they all die when we don’t need them, in a simpler term. For start scripts, they even fires up my SAPGUI which already log me on to my specified SAP client (using SAPGUI shortcut).

Here are my scripts.

SAP start, shutdown and restart – Windows scripts

START SCRIPTS

START-SAP.BAT

c:

cd “C:\oracle\ROL\102\BIN”

lsnrctl start

oradim -startup -SID ROL -starttype srvc

cd “c:\script”

start /b /wait start-ora.bat

cd “C:\usr\sap\ROL\SYS\exe\uc\NTI386”

sapcontrol -host rolnetbook -nr 00 -user SAPServiceROL jakarta -function StopService

sapcontrol -host rolnetbook -nr 00 -user SAPServiceROL jakarta -function StartService ROL

saposcol

startsap name=ROL nr=00 SAPDIAHOST=rolnetbook

start /b “Launch SAP GUI” “C:\Program Files\SAP\FrontEnd\SAPgui\saplogon.exe” /shortcut=”C:\script\ROL SAP Easy Access.sap”

start /b “Launch SAP GUI” “C:\Program Files\SAP\FrontEnd\SAPgui\saplogon.exe” /shortcut=”C:\script\ROL SAP Easy Access.sap”

START-ORA.BAT

c:

cd c:\script

C:\oracle\ROL\102\BIN\sqlplus /nolog @start-ora.sql

exit

START-ORA.SQL

connect / as sysdba

startup

exit

SHUTDOWN SCRIPTS

SHUTDOWN-ME.BAT

start /b /wait c:\script\Shutdown-sap.bat

shutdown -f -t 10 -s

SHUTDOWN-SAP.BAT

c:

cd “C:\usr\sap\ROL\SYS\exe\uc\NTI386”

stopsap name=ROL nr=00 SAPDIAHOST=rolnetbook

saposcol -k

sapcontrol -host rolnetbook -nr 00 -user SAPServiceROL jakarta -function StopService

start /b /wait c:\script\shutdown-ora.bat

c:

cd “C:\oracle\ROL\102\BIN”

oradim -shutdown -SID ROL -shuttype srvc

lsnrctl stop

exit

SHUTDOWN-ORA.BAT

c:

cd c:\script

C:\oracle\ROL\102\BIN\sqlplus /nolog @shutdown-ora.sql

exit

SHUTDOWN-ORA.SQL

connect / as sysdba

shutdown

exit

RESTART SCRIPTS

RESTART-SAP.BAT

c:

cd c:\script

start /b /wait shutdown-sap.bat

c:

cd c:\script

start /b /wait start-sap.bat

RESTART-SAP-ONLY.BAT

c:

cd “C:\usr\sap\ROL\SYS\exe\uc\NTI386”

stopsap name=ROL nr=00 SAPDIAHOST=rolnetbook

saposcol -k

sapcontrol -host rolnetbook -nr 00 -user SAPServiceROL jakarta -function StopService

sapcontrol -host rolnetbook -nr 00 -user SAPServiceROL jakarta -function StartService ROL

saposcol

startsap name=ROL nr=00 SAPDIAHOST=rolnetbook

start /b “Launch SAP GUI” “C:\Program Files\SAP\FrontEnd\SAPgui\saplogon.exe” /shortcut=”C:\script\ROL SAP Easy Access.sap”

start /b “Launch SAP GUI” “C:\Program Files\SAP\FrontEnd\SAPgui\saplogon.exe” /shortcut=”C:\script\ROL SAP Easy Access.sap”

sapwindowsscripts

Leave a comment