This is in continuation to my earlier post on How to shutdown Siebel server in less than 5 secs.
And is suggested by a reader of this blog, who seems to be even more impatient than me(in a good way), and had automated the step to query Siebel server and step to use task kill command to bring down Siebel server as mentioned on my earlier post.
Final batch file looks something like :
FOR /F "tokens=3" %%A IN ('sc queryex siebel_service_name ^| findstr "PID"') DO (SET pid=%%A)
IF "!pid!" NEQ "0" (taskkill /pid %pid% /f)
taskkill /im siebmtshmw.exe /ftaskkill /im siebmtsh.exe /ftaskkill /im siebsess.exe /ftaskkill /im siebprocmw.exe /ftaskkill /im siebproc.exe /f
Once executed with admin privileges, it brings down Siebel server at very instant. I have tested this, and it works beautifully.
Why this is faster than usual way?
Usual way of bringing down service does memory cleanup and waits for long running processes to complete, gives some time to gracefully complete the tasks I think it copies the log files around as well.
However this batch file just pulls the trigger and knock down the server in one shot. There is a risk of data corruption, use it at your own risk!
If you have done something like this with Siebel which is not recommended but saves you time then please share it with us in comments section below.