SAP Control Commands
SAPSTARTSRV (through SAPCONTROL interface) offers a variety of web methods that can be used to monitor/manage the instances of the system. They are specially useful for handling startup error scenarios. The "must-know" ones are listed below and also the general pattern for executing them:
GetSystemInstanceList
OK
hostname, instanceNr, httpPort, httpsPort, startPriority, features, dispstatus
testserver001, 0, 50013, 50014, 3, ABAP|GATEWAY|ICMAN|IGS, GREEN
testserver001, 1, 50113, 50114, 1, MESSAGESERVER|ENQUE, GREEN
testserver001, 2, 50213, 50214, 3, ABAP|GATEWAY|ICMAN|IGS, GREEN
sapcontrol -nr <instance number> -function <web method name>
1: "GetSystemInstanceList":
This one returns the list of active instances for the system, along with component list and the current status.
GetSystemInstanceList
OK
hostname, instanceNr, httpPort, httpsPort, startPriority, features, dispstatus
testserver001, 0, 50013, 50014, 3, ABAP|GATEWAY|ICMAN|IGS, GREEN
testserver001, 1, 50113, 50114, 1, MESSAGESERVER|ENQUE, GREEN
testserver001, 2, 50213, 50214, 3, ABAP|GATEWAY|ICMAN|IGS, GREEN
EXPECTED OUTPUT:
- One entry per instance of the system, including ASCS, SCS INSTANCES;
- GREEN values for all entries on column "dispstatus".
- For all instances running on the same host (column hostname), there must be a differente value on "instanceNr".
2: "GetProcessList":
GetProcessList web method will bring the component list currently in place on any of the instances seen in the first command. It will come in handy as soon as the web method "GetSystemInstanceList" returns one instance reporting as YELLOW. This will happen when at least one component is presenting some kind of probem, so now it is possible to check that affected process with more details:
GetProcessList
OK
name, description, dispstatus, textstatus, starttime, elapsedtime, pid
disp+work, Dispatcher, GREEN, Running, 2015 03 23 23:51:35, 263:27:26, 25549
igswd_mt, IGS Watchdog, GREEN, Running, 2015 03 23 23:51:35, 263:27:26, 25550
gwrd, Gateway, GREEN, Running, 2015 03 23 23:51:36, 263:27:25, 25590
icman, ICM, GREEN, Running, 2015 03 23 23:51:36, 263:27:25, 25591
3: "GetVersionInfo":
Great for kernel consistency checks, this output will return the current kernel release + patch for each and every of its components within the instance informed as argument in the command line.
Excluding the DB* libraries, all the remainning components of the instance must always share the same kernel and patch release on a consistent scenario.
GetVersionInfo OK Filename, VersionInfo, Time /usr/sap/WSO/DVEBMGS00/exe/sapstartsrv, 742, patch 28, changelist 1540128, RKS compatibility level 0, optU (Nov 26 2014, 19:45:41), linuxx86_64, 2014 11 26 19:29:07 /usr/sap/WSO/DVEBMGS00/exe/disp+work, 742, patch 28, changelist 1540128, RKS compatibility level 0, optU (Nov 26 2014, 19:45:41), linuxx86_64, 2014 11 26 19:36:32 /usr/sap/WSO/DVEBMGS00/exe/gwrd, 742, patch 28, changelist 1540128, RKS compatibility level 0, optU (Nov 26 2014, 19:45:41), linuxx86_64, 2014 11 26 18:48:09 /usr/sap/WSO/DVEBMGS00/exe/msg_server, 742, patch 28, changelist 1540128, RKS compatibility level 0, optU (Nov 26 2014, 19:45:41), linuxx86_64, 2014 11 26 18:48:09 /usr/sap/WSO/DVEBMGS00/exe/dboraslib.so, 742, patch 5, changelist 1503525, RKS compatibility level 0, dbgU (Jun 13 2014, 23:23:51), linuxx86_64, 2014 12 05 17:53:41 /usr/sap/WSO/DVEBMGS00/exe/dbmssslib.so, 742, patch 28, changelist 1540128, RKS compatibility level 0, optU (Nov 26 2014, 19:45:41), linuxx86_64, 2014 11 26 18:47:06 /usr/sap/WSO/DVEBMGS00/exe/dbdb2slib.so, 742, patch 28, changelist 1540128, RKS compatibility level 0, optU (Nov 26 2014, 19:45:41), linuxx86_64, 2014 11 26 18:47:03 /usr/sap/WSO/DVEBMGS00/exe/dbdb4slib.so, 742, patch 28, changelist 1540128, RKS compatibility level 0, optU (Nov 26 2014, 19:45:41), linuxx86_64, 2014 11 26 19:29:51 /usr/sap/WSO/DVEBMGS00/exe/dbdb6slib.so, 742, patch 28, changelist 1540128, RKS compatibility level 0, optU (Nov 26 2014, 19:45:41), linuxx86_64, 2014 11 26 18:47:06 /usr/sap/WSO/DVEBMGS00/exe/dbsybslib.so, 742, patch 28, changelist 1540128, RKS compatibility level 0, optU (Nov 26 2014, 19:45:41), linuxx86_64, 2014 11 26 18:47:08 /usr/sap/WSO/DVEBMGS00/exe/enserver, 742, patch 28, changelist 1540128, RKS compatibility level 0, optU (Nov 26 2014, 19:45:41), linuxx86_64, 2014 11 26 18:47:48 /usr/sap/WSO/DVEBMGS00/exe/icman, 742, patch 28, changelist 1540128, RKS compatibility level 0, optU (Nov 26 2014, 19:45:41), linuxx86_64, 2014 11 26 18:48:12 /usr/sap/WSO/DVEBMGS00/exe/sapwebdisp, 742, patch 28, changelist 1540128, RKS compatibility level 0, optU (Nov 26 2014, 19:45:41), linuxx86_64, 2014 11 26 18:48:07 /usr/sap/WSO/DVEBMGS00/exe/jcontrol, 742, patch 28, changelist 1540128, RKS compatibility level 0, optU (Nov 26 2014, 19:45:41), linuxx86_64, 2014 11 26 18:49:16 /usr/sap/WSO/DVEBMGS00/exe/jlaunch, 742, patch 28, changelist 1540128, RKS compatibility level 0, optU (Nov 26 2014, 19:45:41), linuxx86_64, 2014 11 26 19:08:36 /usr/sap/WSO/DVEBMGS00/exe/jstart, 742, patch 28, changelist 1540128, RKS compatibility level 0, optU (Nov 26 2014, 19:45:41), linuxx86_64, 2014 11 26 19:28:59
- sapcontrol
Scripts startsap/stopsap use internally sapcontrol command to start and stop the SAP system, hence it is possible to use it manually.
Follow the syntax for sapcontrol call, corresponding to startsap/stopsap:
- In order to start the system, instead of using startsap, use:
sapcontrol -nr <instance_number> -function StartSystem
- In order to stop the system, instead of using stopsap, use:
sapcontrol -nr <instance_number> -function StopSystem
For the complete option list of methods, run sapcontrol without any parameters options to see the available list.
Example :
tp1p202a
stopsap r3 tp1p202a; stopsap
sapstartsrv tp1p202a; cleanipc 20 remove stopsap SMDA97; stopsap startupsrv
SMDA97; cleanipc 97 remove startsap r3 tp1p202a startsap r3 SMDA97
tp1p203a
stopsap r3 tp1p203a; stopsap
sapstartsrv tp1p203a; cleanipc 20 remove stopsap SMDA97; stopsap startupsrv
SMDA97; cleanipc 97 remove startsap r3 tp1p203a startsap r3 SMDA97
Database:
db2 force applications all db2
deactivate db <DBNAME> db2stop ipclean -a
db2start
db2 activate db p1p
STOP Sequence:
THA -cluster (maintenance mode)
2-MSG server ()
3-ERS
4 TSA cluster in maintenance mode
between primary and secondary databases
5-database
Comments
Post a Comment